[dpdk-dev] [PATCH] app/testpmd: fix mbuf leak in the case of multi-segment Tx

Andrew Rybchenko arybchenko at solarflare.com
Wed May 8 12:27:37 CEST 2019


The last mbuf allocated in bulk is never used and never freed.

Fixes: 01b645dcff7f ("app/testpmd: move txonly prepare in separate function")
Fixes: 561ddcf8d099 ("app/testpmd: allocate txonly segments per bulk")

Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 app/test-pmd/txonly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index fa8e0c0..fdfca14 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -167,7 +167,7 @@
 		nb_segs = tx_pkt_nb_segs;
 
 	if (nb_segs > 1) {
-		if (rte_mempool_get_bulk(mbp, (void **)pkt_segs, nb_segs))
+		if (rte_mempool_get_bulk(mbp, (void **)pkt_segs, nb_segs - 1))
 			return false;
 	}
 
-- 
1.8.3.1



More information about the dev mailing list