timer callback for stress tests */
| 136 | |
| 137 | /* timer callback for stress tests */ |
| 138 | static void |
| 139 | timer_stress_cb(__rte_unused struct rte_timer *tim, |
| 140 | __rte_unused void *arg) |
| 141 | { |
| 142 | long r; |
| 143 | unsigned lcore_id = rte_lcore_id(); |
| 144 | uint64_t hz = rte_get_timer_hz(); |
| 145 | |
| 146 | if (rte_timer_pending(tim)) |
| 147 | return; |
| 148 | |
| 149 | r = rte_rand(); |
| 150 | if ((r & 0xff) == 0) { |
| 151 | mytimer_reset(&mytiminfo[0], hz, SINGLE, lcore_id, |
| 152 | timer_stress_cb); |
| 153 | } |
| 154 | else if ((r & 0xff) == 1) { |
| 155 | mytimer_reset(&mytiminfo[0], hz, SINGLE, |
| 156 | rte_get_next_lcore(lcore_id, 0, 1), |
| 157 | timer_stress_cb); |
| 158 | } |
| 159 | else if ((r & 0xff) == 2) { |
| 160 | rte_timer_stop(&mytiminfo[0].tim); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | static int |
| 165 | timer_stress_main_loop(__rte_unused void *arg) |
nothing calls this directly
no test coverage detected