| 453 | } |
| 454 | |
| 455 | static int |
| 456 | timer_basic_main_loop(__rte_unused void *arg) |
| 457 | { |
| 458 | uint64_t hz = rte_get_timer_hz(); |
| 459 | unsigned lcore_id = rte_lcore_id(); |
| 460 | uint64_t cur_time; |
| 461 | int64_t diff = 0; |
| 462 | |
| 463 | /* launch all timers on core 0 */ |
| 464 | if (lcore_id == rte_get_main_lcore()) { |
| 465 | mytimer_reset(&mytiminfo[0], hz/4, SINGLE, lcore_id, |
| 466 | timer_basic_cb); |
| 467 | mytimer_reset(&mytiminfo[1], hz/2, SINGLE, lcore_id, |
| 468 | timer_basic_cb); |
| 469 | mytimer_reset(&mytiminfo[2], hz/4, PERIODICAL, lcore_id, |
| 470 | timer_basic_cb); |
| 471 | mytimer_reset(&mytiminfo[3], hz/4, PERIODICAL, |
| 472 | rte_get_next_lcore(lcore_id, 0, 1), |
| 473 | timer_basic_cb); |
| 474 | } |
| 475 | |
| 476 | while (diff >= 0) { |
| 477 | |
| 478 | /* call the timer handler on each core */ |
| 479 | rte_timer_manage(); |
| 480 | |
| 481 | /* simulate the processing of a packet |
| 482 | * (3 us = 6000 cycles at 2 Ghz) */ |
| 483 | rte_delay_us(3); |
| 484 | |
| 485 | cur_time = rte_get_timer_cycles(); |
| 486 | diff = end_time - cur_time; |
| 487 | } |
| 488 | RTE_LOG(INFO, TESTTIMER, "core %u finished\n", lcore_id); |
| 489 | |
| 490 | return 0; |
| 491 | } |
| 492 | |
| 493 | static int |
| 494 | timer_sanity_check(void) |
nothing calls this directly
no test coverage detected