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

Function handle_and_mark_work

dpdk/app/test/test_distributor.c:591–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591static int
592handle_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.

Callers

nothing calls this directly

Calls 3

rte_distributor_get_pktFunction · 0.85
seq_fieldFunction · 0.85

Tested by

no test coverage detected