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

Function worker_main_loop

dpdk/app/test/test_timer_racecond.c:77–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77static int
78worker_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
113static int
114test_timer_racecond(void)

Callers

nothing calls this directly

Calls 5

rte_lcore_idFunction · 0.85
rte_timer_pendingFunction · 0.85
reload_timerFunction · 0.85
printfFunction · 0.50
rte_pauseFunction · 0.50

Tested by

no test coverage detected