When Rx queue interrupts are enabled, the PF
and VF start functions create eventfds with
rte_intr_efd_enable().
If start fails afterwards, the eventfds are not
released: the ethdev layer does not call dev_stop
after a failed start, and the next start creates
new eventfds over the old ones.
For the VF, close does not release them either,
because ixgbevf_dev_stop() returns early once
the adapter is stopped.

Disable the eventfds on the start error paths,
and free the PF interrupt vector list there as
well, as dev_stop does.

Fixes: 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF")
Cc: [email protected]

Signed-off-by: Anurag Mandal <[email protected]>
Acked-by: Bruce Richardson <[email protected]>
---
 drivers/net/intel/ixgbe/ixgbe_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c 
b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
index 6df98f2d09..4181bbcd17 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
@@ -2583,6 +2583,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
                                                   dev->data->nb_rx_queues)) {
                        PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues"
                                     " intr_vec", dev->data->nb_rx_queues);
+                       rte_intr_efd_disable(intr_handle);
                        return -ENOMEM;
                }
        }
@@ -2803,6 +2804,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 error:
        PMD_INIT_LOG(ERR, "failure in ixgbe_dev_start(): %d", err);
        ixgbe_dev_clear_queues(dev);
+       rte_intr_efd_disable(intr_handle);
+       rte_intr_vec_list_free(intr_handle);
        return -EIO;
 }
 
@@ -5539,6 +5542,7 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
                        PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues"
                                     " intr_vec", dev->data->nb_rx_queues);
                        ixgbe_dev_clear_queues(dev);
+                       rte_intr_efd_disable(intr_handle);
                        return -ENOMEM;
                }
        }
-- 
2.25.1

Reply via email to