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

Function quit_workers

dpdk/app/test/test_distributor_perf.c:189–211  ·  view source on GitHub ↗

Useful function which ensures that all worker functions terminate */

Source from the content-addressed store, hash-verified

187
188/* Useful function which ensures that all worker functions terminate */
189static void
190quit_workers(struct rte_distributor *d, struct rte_mempool *p)
191{
192 const unsigned int num_workers = rte_lcore_count() - 1;
193 unsigned int i;
194 struct rte_mbuf *bufs[RTE_MAX_LCORE];
195
196 rte_mempool_get_bulk(p, (void *)bufs, num_workers);
197
198 quit = 1;
199 for (i = 0; i < num_workers; i++) {
200 bufs[i]->hash.usr = i << 1;
201 rte_distributor_process(d, &bufs[i], 1);
202 }
203
204 rte_mempool_put_bulk(p, (void *)bufs, num_workers);
205
206 rte_distributor_process(d, NULL, 0);
207 rte_distributor_flush(d);
208 rte_eal_mp_wait_lcore();
209 quit = 0;
210 worker_idx = 0;
211}
212
213static int
214test_distributor_perf(void)

Callers 1

test_distributor_perfFunction · 0.70

Calls 6

rte_lcore_countFunction · 0.85
rte_mempool_get_bulkFunction · 0.85
rte_distributor_processFunction · 0.85
rte_mempool_put_bulkFunction · 0.85
rte_distributor_flushFunction · 0.85
rte_eal_mp_wait_lcoreFunction · 0.85

Tested by

no test coverage detected