summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Rybchenko <arybchenko@solarflare.com>2019-05-08 11:27:37 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-08 20:31:43 +0200
commitb3711336280364172e48ccd38d965abfb854d7a9 (patch)
tree9f4a191a49090a919eb0fbb3cb39204f3abf95f2
parent617ecc900087868adca9bccd148e7446aabf5743 (diff)
downloaddpdk-draft-windows-b3711336280364172e48ccd38d965abfb854d7a9.zip
dpdk-draft-windows-b3711336280364172e48ccd38d965abfb854d7a9.tar.gz
dpdk-draft-windows-b3711336280364172e48ccd38d965abfb854d7a9.tar.xz
app/testpmd: fix mbuf leak with multi-segment Tx
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> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
-rw-r--r--app/test-pmd/txonly.c2
1 files changed, 1 insertions, 1 deletions
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 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,
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;
}