net/ixgbe: fix queue resource leak

Message ID 20210831134017.8060-1-chenqiming_huawei@163.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series net/ixgbe: fix queue resource leak |

Checks

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

Commit Message

Qiming Chen Aug. 31, 2021, 1:40 p.m. UTC
  In the ixgbevf_dev_start function, after initializing the rxtx queue, if
an exception occurs in the subsequent function, the rxtx queue needs to
be released. The patch solves the problem of queue resource leakage.

Fixes: 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF")
Cc: stable@dpdk.org

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

Comments

Wang, Haiyue Sept. 6, 2021, 1:34 a.m. UTC | #1
> -----Original Message-----
> From: Qiming Chen <chenqiming_huawei@163.com>
> Sent: Tuesday, August 31, 2021 21:40
> To: dev@dpdk.org
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; Qiming Chen <chenqiming_huawei@163.com>; stable@dpdk.org
> Subject: [PATCH] net/ixgbe: fix queue resource leak
> 
> In the ixgbevf_dev_start function, after initializing the rxtx queue, if
> an exception occurs in the subsequent function, the rxtx queue needs to
> be released. The patch solves the problem of queue resource leakage.
> 
> Fixes: 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 

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

> --
> 2.30.1.windows.1
  
Qi Zhang Sept. 6, 2021, 1:41 a.m. UTC | #2
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wang, Haiyue
> Sent: Monday, September 6, 2021 9:35 AM
> To: Qiming Chen <chenqiming_huawei@163.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix queue resource leak
> 
> > -----Original Message-----
> > From: Qiming Chen <chenqiming_huawei@163.com>
> > Sent: Tuesday, August 31, 2021 21:40
> > To: dev@dpdk.org
> > Cc: Wang, Haiyue <haiyue.wang@intel.com>; Qiming Chen
> > <chenqiming_huawei@163.com>; stable@dpdk.org
> > Subject: [PATCH] net/ixgbe: fix queue resource leak
> >
> > In the ixgbevf_dev_start function, after initializing the rxtx queue,
> > if an exception occurs in the subsequent function, the rxtx queue
> > needs to be released. The patch solves the problem of queue resource
> leakage.
> >
> > Fixes: 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and
> > VF")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_ethdev.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> 
> Acked-by: Haiyue Wang <haiyue.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
> 
> > --
> > 2.30.1.windows.1
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 3fd3249150..7d3a821300 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -5367,8 +5367,10 @@  ixgbevf_dev_start(struct rte_eth_dev *dev)
 		 * now only one vector is used for Rx queue
 		 */
 		intr_vector = 1;
-		if (rte_intr_efd_enable(intr_handle, intr_vector))
+		if (rte_intr_efd_enable(intr_handle, intr_vector)) {
+			ixgbe_dev_clear_queues(dev);
 			return -1;
+		}
 	}
 
 	if (rte_intr_dp_is_en(intr_handle) && !intr_handle->intr_vec) {
@@ -5378,6 +5380,7 @@  ixgbevf_dev_start(struct rte_eth_dev *dev)
 		if (intr_handle->intr_vec == NULL) {
 			PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues"
 				     " intr_vec", dev->data->nb_rx_queues);
+			ixgbe_dev_clear_queues(dev);
 			return -ENOMEM;
 		}
 	}