Useful function which ensures that all worker functions terminate */
| 187 | |
| 188 | /* Useful function which ensures that all worker functions terminate */ |
| 189 | static void |
| 190 | quit_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 | |
| 213 | static int |
| 214 | test_distributor_perf(void) |
no test coverage detected