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

Function app_main_loop_worker

dpdk/app/test-pipeline/runtime.c:74–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74void
75app_main_loop_worker(void) {
76 struct app_mbuf_array *worker_mbuf;
77 uint32_t i;
78
79 RTE_LOG(INFO, USER1, "Core %u is doing work (no pipeline)\n",
80 rte_lcore_id());
81
82 worker_mbuf = rte_malloc_socket(NULL, sizeof(struct app_mbuf_array),
83 RTE_CACHE_LINE_SIZE, rte_socket_id());
84 if (worker_mbuf == NULL)
85 rte_panic("Worker thread: cannot allocate buffer space\n");
86
87 while (!force_quit) {
88 for (i = 0; i < app.n_ports; i++) {
89 int ret;
90
91 ret = rte_ring_sc_dequeue_bulk(
92 app.rings_rx[i],
93 (void **) worker_mbuf->array,
94 app.burst_size_worker_read,
95 NULL);
96
97 if (ret == 0)
98 continue;
99
100 do {
101 ret = rte_ring_sp_enqueue_bulk(
102 app.rings_tx[i ^ 1],
103 (void **) worker_mbuf->array,
104 app.burst_size_worker_write,
105 NULL);
106 } while (ret == 0 && !force_quit);
107 }
108 }
109}
110
111void
112app_main_loop_tx(void) {

Callers 1

app_lcore_main_loopFunction · 0.85

Calls 5

rte_lcore_idFunction · 0.85
rte_malloc_socketFunction · 0.85
rte_socket_idFunction · 0.85
rte_ring_sc_dequeue_bulkFunction · 0.85
rte_ring_sp_enqueue_bulkFunction · 0.85

Tested by

no test coverage detected