net/ixgbe: slove mbuf leak

Message ID 20210831032805.5520-1-chenqiming_huawei@163.com (mailing list archive)
State Superseded, archived
Headers
Series net/ixgbe: slove mbuf leak |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance fail Performance Testing issues
ci/github-robot: build success github build: passed
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Qiming Chen Aug. 31, 2021, 3:28 a.m. UTC
  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.

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

Wang, Haiyue Aug. 31, 2021, 6:04 a.m. UTC | #1
> -----Original Message-----
> From: Qiming Chen <chenqiming_huawei@163.com>
> Sent: Tuesday, August 31, 2021 11:28
> To: dev@dpdk.org
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; Qiming Chen <chenqiming_huawei@163.com>
> Subject: [PATCH] net/ixgbe: slove 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.
> 
> Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>

Backport ?

Cc: stable@dpdk.org

> ---
>  drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 


Acked-by: Haiyue Wang <haiyue.wang@intel.com>

> 
> --
> 2.30.1.windows.1
  
Qiming Chen Aug. 31, 2021, 6:40 a.m. UTC | #2
Do you mean let me sync to stable@dpdk.org?


| |
Qiming Chen
|
|
chenqiming_huawei@163.com
|
签名由网易邮箱大师定制
On 8/31/2021 14:04,Wang, Haiyue<haiyue.wang@intel.com> wrote:
-----Original Message-----
From: Qiming Chen <chenqiming_huawei@163.com>
Sent: Tuesday, August 31, 2021 11:28
To: dev@dpdk.org
Cc: Wang, Haiyue <haiyue.wang@intel.com>; Qiming Chen <chenqiming_huawei@163.com>
Subject: [PATCH] net/ixgbe: slove 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.

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>

Backport ?

Cc: stable@dpdk.org

---
drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++
1 file changed, 4 insertions(+)



Acked-by: Haiyue Wang <haiyue.wang@intel.com>


--
2.30.1.windows.1
  
Wang, Haiyue Aug. 31, 2021, 6:51 a.m. UTC | #3
From: Qiming Chen <chenqiming_huawei@163.com> 
Sent: Tuesday, August 31, 2021 14:41
To: Wang, Haiyue <haiyue.wang@intel.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH] net/ixgbe: slove mbuf leak

Do you mean let me sync to mailto:stable@dpdk.org?

Yes. ;-)

Qiming Chen
mailto:chenqiming_huawei@163.com
签名由 https://mail.163.com/dashi/dlpro.html?from=mail81 定制 
On 8/31/2021 14:04,mailto:haiyue.wang@intel.com wrote: 
-----Original Message-----
From: Qiming Chen <mailto:chenqiming_huawei@163.com>
Sent: Tuesday, August 31, 2021 11:28
To: mailto:dev@dpdk.org
Cc: Wang, Haiyue <mailto:haiyue.wang@intel.com>; Qiming Chen <mailto:chenqiming_huawei@163.com>
Subject: [PATCH] net/ixgbe: slove 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.

Signed-off-by: Qiming Chen <mailto:chenqiming_huawei@163.com>

Backport ?

Cc: mailto:stable@dpdk.org
---
drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++
1 file changed, 4 insertions(+)


Acked-by: Haiyue Wang <mailto:haiyue.wang@intel.com>

--
2.30.1.windows.1
  

Patch

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;