DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix mbuf leak in the case of multi-segment Tx
@ 2019-05-08 10:27 Andrew Rybchenko
  2019-05-08 10:27 ` Andrew Rybchenko
  2019-05-08 18:32 ` Ferruh Yigit
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2019-05-08 10:27 UTC (permalink / raw)
  To: Ferruh Yigit, Bernard Iremonger, Jingjing Wu, Wenzhuo Lu
  Cc: dev, Pavan Nikhilesh, Thomas Monjalon

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@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-08 18:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-08 10:27 [dpdk-dev] [PATCH] app/testpmd: fix mbuf leak in the case of multi-segment Tx Andrew Rybchenko
2019-05-08 10:27 ` Andrew Rybchenko
2019-05-08 18:32 ` Ferruh Yigit
2019-05-08 18:32   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).