From: Qiming Chen Date: Wed, 1 Sep 2021 07:22:37 +0000 (+0800) Subject: net/ixgbe: fix mbuf leak X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d54b51efb6ef12b8cdfc7316316d99e2a762e1cd;p=dpdk.git net/ixgbe: 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: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Qiming Chen Acked-by: Haiyue Wang --- diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index c814a28cb4..bfdfd5e755 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -2981,6 +2981,10 @@ ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue *rxq) rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_thresh - 1); 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;