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 <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
This commit is contained in:
Qiming Chen 2021-09-11 09:47:09 +08:00 committed by Qi Zhang
parent da9cdcd1f3
commit a38df1edd6

View File

@ -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;