[dpdk-dev] [PATCH v3 4/8] app/test: collect return mbufs in distributor test

Lukasz Wojciechowski l.wojciechow at partner.samsung.com
Wed Sep 23 15:25:37 CEST 2020


During quit_workers function distributor's main core processes
some packets to wake up pending worker cores so they can quit.
As quit_workers acts also as a cleanup procedure for next test
case it should also collect these packages returned by workers'
handlers, so the cyclic buffer with returned packets
in distributor remains empty.

Fixes: c3eabff124e6 ("distributor: add unit tests")
Cc: bruce.richardson at intel.com
Fixes: c0de0eb82e40 ("distributor: switch over to new API")
Cc: david.hunt at intel.com
Cc: stable at dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
Acked-by: David Hunt <david.hunt at intel.com>
---
 app/test/test_distributor.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c
index 94b65b382..f31b54edf 100644
--- a/app/test/test_distributor.c
+++ b/app/test/test_distributor.c
@@ -610,6 +610,10 @@ quit_workers(struct worker_params *wp, struct rte_mempool *p)
 	rte_distributor_process(d, NULL, 0);
 	rte_distributor_flush(d);
 	rte_eal_mp_wait_lcore();
+
+	while (rte_distributor_returned_pkts(d, bufs, RTE_MAX_LCORE))
+		;
+
 	quit = 0;
 	worker_idx = 0;
 	zero_idx = 0;
-- 
2.17.1



More information about the dev mailing list