MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_delay_us_sleep

Function rte_delay_us_sleep

dpdk/lib/eal/windows/eal_timer.c:17–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#define CYC_PER_10MHZ 1E7
16
17void
18rte_delay_us_sleep(unsigned int us)
19{
20 HANDLE timer;
21 LARGE_INTEGER due_time;
22
23 /* create waitable timer */
24 timer = CreateWaitableTimer(NULL, TRUE, NULL);
25 if (!timer) {
26 RTE_LOG_WIN32_ERR("CreateWaitableTimer()");
27 rte_errno = ENOMEM;
28 return;
29 }
30
31 /*
32 * due_time's uom is 100 ns, multiply by 10 to convert to microseconds
33 * set us microseconds time for timer
34 */
35 due_time.QuadPart = -((int64_t)us * 10);
36 if (!SetWaitableTimer(timer, &due_time, 0, NULL, NULL, FALSE)) {
37 RTE_LOG_WIN32_ERR("SetWaitableTimer()");
38 rte_errno = EINVAL;
39 goto end;
40 }
41 /* start wait for timer for us microseconds */
42 if (WaitForSingleObject(timer, INFINITE) == WAIT_FAILED) {
43 RTE_LOG_WIN32_ERR("WaitForSingleObject()");
44 rte_errno = EINVAL;
45 }
46
47end:
48 CloseHandle(timer);
49}
50
51uint64_t
52get_tsc_freq(void)

Callers 15

get_tsc_freqFunction · 0.70
main_loopFunction · 0.50
estimate_tsc_freqFunction · 0.50
gve_tx_clean_dqoFunction · 0.50
cpfl_send_ctlq_msgFunction · 0.50
cpfl_receive_ctlq_msgFunction · 0.50
mlx5_txpp_init_timestampFunction · 0.50
mlx5_hws_cnt_svcFunction · 0.50
mlx5_dev_closeFunction · 0.50
mlx5_dev_stopFunction · 0.50
__flow_hw_pull_compFunction · 0.50

Calls

no outgoing calls

Tested by 5

test_dma_completedFunction · 0.40
await_hwFunction · 0.40
test_m2d_auto_freeFunction · 0.40
mainFunction · 0.40