From 1709cb10a8c9eadda28d90f8aba751864a04c6dd Mon Sep 17 00:00:00 2001 From: Chenxu Di Date: Tue, 12 Nov 2019 06:00:14 +0000 Subject: [PATCH] net/ixgbe: fix hotplug remove testpmd will occur infinite loops when device hotplug remove. We can fix the issue by using the pci generic remove function Fixes: f2f4990eff94 ("net/ixgbe: release port upon close") Signed-off-by: Chenxu Di Acked-by: Xiaolong Ye --- drivers/net/ixgbe/ixgbe_ethdev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 8c1caac18c..797f321e0e 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1800,12 +1800,14 @@ static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev) ethdev = rte_eth_dev_allocated(pci_dev->device.name); if (!ethdev) - return -ENODEV; + return 0; if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR) - return rte_eth_dev_destroy(ethdev, ixgbe_vf_representor_uninit); + return rte_eth_dev_pci_generic_remove(pci_dev, + ixgbe_vf_representor_uninit); else - return rte_eth_dev_destroy(ethdev, eth_ixgbe_dev_uninit); + return rte_eth_dev_pci_generic_remove(pci_dev, + eth_ixgbe_dev_uninit); } static struct rte_pci_driver rte_ixgbe_pmd = { -- 2.20.1