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.richard...@intel.com
Fixes: c0de0eb82e40 ("distributor: switch over to new API")
Cc: david.h...@intel.com
Cc: sta...@dpdk.org

Signed-off-by: Lukasz Wojciechowski <l.wojciec...@partner.samsung.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

Reply via email to