From 674effd868865edbb06c49119e0ff215498d32b5 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Thu, 20 Jun 2019 10:34:34 +0800 Subject: [PATCH] net/virtio: fix memory leak in mergeable Rx When there is no enough segments for a packet in mergeable Rx path, we should free the whole mbuf chain instead of just recycling the last segment. Fixes: bcac5aa207f8 ("net/virtio: improve batching in mergeable path") Cc: stable@dpdk.org Reviewed-by: Maxime Coquelin Signed-off-by: Tiwei Bie --- drivers/net/virtio/virtio_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index e4d5b6f099..98f4b00a17 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -1736,7 +1736,7 @@ virtio_recv_mergeable_pkts(void *rx_queue, } else { PMD_RX_LOG(ERR, "No enough segments for packet."); - virtio_discard_rxbuf(vq, prev); + rte_pktmbuf_free(rx_pkts[nb_rx]); rxvq->stats.errors++; break; } -- 2.20.1