app/testpmd: fix mbuf leak with multi-segment Tx
The last mbuf allocated in bulk is never used and never freed. Fixes:01b645dcff
("app/testpmd: move txonly prepare in separate function") Fixes:561ddcf8d0
("app/testpmd: allocate txonly segments per bulk") Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
parent
617ecc9000
commit
b371133628
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user