Skip to content

Commit

Permalink
net/i40e: fix mbuf leak
Browse files Browse the repository at this point in the history
[ upstream commit 4b45867 ]

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: 4861cde ("i40e: new poll mode driver")

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
Qiming Chen authored and cpaelzer committed Nov 30, 2021
1 parent 0b0a33d commit ba9d67f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/i40e/i40e_rxtx.c
Expand Up @@ -2487,6 +2487,10 @@ i40e_reset_rx_queue(struct i40e_rx_queue *rxq)
#endif /* RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC */
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;

Expand Down

0 comments on commit ba9d67f

Please sign in to comment.