| 589 | } |
| 590 | |
| 591 | static int |
| 592 | handle_and_mark_work(void *arg) |
| 593 | { |
| 594 | struct rte_mbuf *buf[8] __rte_cache_aligned; |
| 595 | struct worker_params *wp = arg; |
| 596 | struct rte_distributor *db = wp->dist; |
| 597 | unsigned int num, i; |
| 598 | unsigned int id = __atomic_fetch_add(&worker_idx, 1, __ATOMIC_RELAXED); |
| 599 | num = rte_distributor_get_pkt(db, id, buf, NULL, 0); |
| 600 | while (!quit) { |
| 601 | __atomic_fetch_add(&worker_stats[id].handled_packets, num, |
| 602 | __ATOMIC_RELAXED); |
| 603 | for (i = 0; i < num; i++) |
| 604 | *seq_field(buf[i]) += id + 1; |
| 605 | num = rte_distributor_get_pkt(db, id, |
| 606 | buf, buf, num); |
| 607 | } |
| 608 | __atomic_fetch_add(&worker_stats[id].handled_packets, num, |
| 609 | __ATOMIC_RELAXED); |
| 610 | rte_distributor_return_pkt(db, id, buf, num); |
| 611 | return 0; |
| 612 | } |
| 613 | |
| 614 | /* sanity_mark_test sends packets to workers which mark them. |
| 615 | * Every packet has also encoded sequence number. |
nothing calls this directly
no test coverage detected