]> git.droids-corp.org - dpdk.git/commitdiff
net/ixgbe: fix queue resource leak
authorQiming Chen <chenqiming_huawei@163.com>
Tue, 31 Aug 2021 13:40:17 +0000 (21:40 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Mon, 6 Sep 2021 01:43:06 +0000 (03:43 +0200)
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>
Acked-by: Haiyue Wang <haiyue.wang@intel.com>
drivers/net/ixgbe/ixgbe_ethdev.c

index 7b198d95c21a4e07bfc0c69e7c64254b2ba0bf16..3371a7df78a540861c6b88443b892303e6b966e7 100644 (file)
@@ -5362,8 +5362,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) {
@@ -5373,6 +5375,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;
                }
        }