[v2] net/ixgbe: fix mbuf leak
Checks
Commit Message
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: abf7275bbaa2 ("ixgbe: move to drivers/net/")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
v2:
Sync to stable@dpdk.org
---
drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++
1 file changed, 4 insertions(+)
Comments
On 31/08/2021 09:06, Qiming Chen wrote:
> 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: abf7275bbaa2 ("ixgbe: move to drivers/net/")
That is a file rename, it should be when the functionality was
introduced, so in this case:
Fixes: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
>
> Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
> ---
> v2:
> Sync to stable@dpdk.org
> ---
> drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> 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;
>
>
This is already the oldest commit node in git, and it has not been recorded before。
Which commit should I fill in?
| |
Qiming Chen
|
|
chenqiming_huawei@163.com
|
签名由网易邮箱大师定制
On 8/31/2021 18:00,Kevin Traynor<ktraynor@redhat.com> wrote:
On 31/08/2021 09:06, Qiming Chen wrote:
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: abf7275bbaa2 ("ixgbe: move to drivers/net/")
That is a file rename, it should be when the functionality was
introduced, so in this case:
Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
v2:
Sync to stable@dpdk.org
---
drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++
1 file changed, 4 insertions(+)
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;
Please reply with plain text format. ;-)
This is better:
Fixes: af75078fece3 ("first public release")
From: Qiming Chen <chenqiming_huawei@163.com>
Sent: Wednesday, September 1, 2021 09:51
To: ktraynor@redhat.com
Cc: dev@dpdk.org; Wang, Haiyue <haiyue.wang@intel.com>; stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix mbuf leak
This is already the oldest commit node in git, and it has not been recorded before。
Which commit should I fill in?
Qiming Chen
mailto:chenqiming_huawei@163.com
签名由 https://mail.163.com/dashi/dlpro.html?from=mail81 定制
On 8/31/2021 18:00,mailto:ktraynor@redhat.com wrote:
On 31/08/2021 09:06, Qiming Chen wrote:
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: abf7275bbaa2 ("ixgbe: move to drivers/net/")
That is a file rename, it should be when the functionality was
introduced, so in this case:
Fixes: af75078fece3 ("first public release")
Cc: mailto:stable@dpdk.org
Signed-off-by: Qiming Chen <mailto:chenqiming_huawei@163.com>
---
v2:
Sync to mailto:stable@dpdk.org
---
drivers/net/ixgbe/ixgbe_rxtx.c | 4 ++++
1 file changed, 4 insertions(+)
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;
@@ -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;