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

Function timer_stress_cb

dpdk/app/test/test_timer.c:138–162  ·  view source on GitHub ↗

timer callback for stress tests */

Source from the content-addressed store, hash-verified

136
137/* timer callback for stress tests */
138static void
139timer_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
164static int
165timer_stress_main_loop(__rte_unused void *arg)

Callers

nothing calls this directly

Calls 6

rte_lcore_idFunction · 0.85
rte_timer_pendingFunction · 0.85
rte_randFunction · 0.85
mytimer_resetFunction · 0.85
rte_get_next_lcoreFunction · 0.85
rte_timer_stopFunction · 0.85

Tested by

no test coverage detected