From: Qiming Chen Date: Sat, 11 Sep 2021 01:47:09 +0000 (+0800) Subject: net/iavf: fix mbuf leak X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;ds=sidebyside;h=a38df1edd6324f922ca46a043e87b2489f7bc17e;p=dpdk.git net/iavf: fix mbuf leak A local test found that repeated port start and stop operations during the continuous SSE vector bufflist receiving process will cause the mbuf resource to run out. The final positioning is when the port is stopped, the mbuf of the pkt_first_seg pointer is not released. Resources leak. The patch scheme is to judge whether the pointer is empty when the port is stopped, and release the corresponding mbuf if it is not empty. Fixes: 69dd4c3d0898 ("net/avf: enable queue and device") Cc: stable@dpdk.org Signed-off-by: Qiming Chen Acked-by: Qi Zhang --- diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index e33fe4576b..7240e70f9e 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -225,6 +225,10 @@ reset_rx_queue(struct iavf_rx_queue *rxq) rxq->rx_tail = 0; rxq->nb_rx_hold = 0; + + if (rxq->pkt_first_seg != NULL) + rte_pktmbuf_free(rxq->pkt_first_seg); + rxq->pkt_first_seg = NULL; rxq->pkt_last_seg = NULL; rxq->rxrearm_nb = 0;