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

Function launch_timer

dpdk/examples/l3fwd-power/main.c:2380–2413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2378}
2379
2380static int
2381launch_timer(unsigned int lcore_id)
2382{
2383 int64_t prev_tsc = 0, cur_tsc, diff_tsc, cycles_10ms;
2384
2385 RTE_SET_USED(lcore_id);
2386
2387
2388 if (rte_get_main_lcore() != lcore_id) {
2389 rte_panic("timer on lcore:%d which is not main core:%d\n",
2390 lcore_id,
2391 rte_get_main_lcore());
2392 }
2393
2394 RTE_LOG(INFO, POWER, "Bring up the Timer\n");
2395
2396 telemetry_setup_timer();
2397
2398 cycles_10ms = rte_get_timer_hz() / 100;
2399
2400 while (!is_done()) {
2401 cur_tsc = rte_rdtsc();
2402 diff_tsc = cur_tsc - prev_tsc;
2403 if (diff_tsc > cycles_10ms) {
2404 rte_timer_manage();
2405 prev_tsc = cur_tsc;
2406 cycles_10ms = rte_get_timer_hz() / 100;
2407 }
2408 }
2409
2410 RTE_LOG(INFO, POWER, "Timer_subsystem is done\n");
2411
2412 return 0;
2413}
2414
2415static int
2416autodetect_mode(void)

Callers 1

mainFunction · 0.85

Calls 5

rte_get_main_lcoreFunction · 0.85
telemetry_setup_timerFunction · 0.85
is_doneFunction · 0.85
rte_timer_manageFunction · 0.85
rte_rdtscFunction · 0.50

Tested by

no test coverage detected