DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	"Wenzhuo Lu" <wenzhuo.lu@intel.com>
Cc: <dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>,
	"Thomas Monjalon" <thomas@monjalon.net>
Subject: [dpdk-dev] [PATCH] app/testpmd: fix mbuf leak in the case of multi-segment Tx
Date: Wed, 8 May 2019 11:27:37 +0100	[thread overview]
Message-ID: <1557311257-10719-1-git-send-email-arybchenko@solarflare.com> (raw)

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

             reply	other threads:[~2019-05-08 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08 10:27 Andrew Rybchenko [this message]
2019-05-08 10:27 ` Andrew Rybchenko
2019-05-08 18:32 ` Ferruh Yigit
2019-05-08 18:32   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1557311257-10719-1-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=pbhagavatula@marvell.com \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).