| 72 | } |
| 73 | |
| 74 | void |
| 75 | app_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 | |
| 111 | void |
| 112 | app_main_loop_tx(void) { |
no test coverage detected