| 75 | } |
| 76 | |
| 77 | static int |
| 78 | worker_main_loop(__rte_unused void *arg) |
| 79 | { |
| 80 | unsigned lcore_id = rte_lcore_id(); |
| 81 | unsigned i; |
| 82 | |
| 83 | RTE_PER_LCORE(n_reset_collisions) = 0; |
| 84 | |
| 85 | printf("Starting main loop on core %u\n", lcore_id); |
| 86 | |
| 87 | while (!stop_workers) { |
| 88 | /* Wait until the timer manager is running. |
| 89 | * We know it's running when we see timer[0] NOT pending. |
| 90 | */ |
| 91 | if (rte_timer_pending(&timer[0])) { |
| 92 | rte_pause(); |
| 93 | continue; |
| 94 | } |
| 95 | |
| 96 | /* Now, go cause some havoc! |
| 97 | * Reload our timers. |
| 98 | */ |
| 99 | for (i = 0; i < N_TIMERS; i++) { |
| 100 | if (timer_lcore_id[i] == lcore_id) |
| 101 | (void)reload_timer(&timer[i]); |
| 102 | } |
| 103 | usec_delay(100*1000); /* sleep 100 ms */ |
| 104 | } |
| 105 | |
| 106 | if (RTE_PER_LCORE(n_reset_collisions) != 0) { |
| 107 | printf("- core %u, %u reset collisions (OK)\n", |
| 108 | lcore_id, RTE_PER_LCORE(n_reset_collisions)); |
| 109 | } |
| 110 | return 0; |
| 111 | } |
| 112 | |
| 113 | static int |
| 114 | test_timer_racecond(void) |
nothing calls this directly
no test coverage detected