| 2378 | } |
| 2379 | |
| 2380 | static int |
| 2381 | launch_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 | |
| 2415 | static int |
| 2416 | autodetect_mode(void) |
no test coverage detected