net/ixgbe: fix device hotplug remove

Message ID 20191106050930.82723-1-chenxux.di@intel.com (mailing list archive)
State Superseded, archived
Delegated to: xiaolong ye
Headers
Series net/ixgbe: fix device hotplug remove |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance fail Performance Testing issues
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed
ci/Intel-compilation fail Compilation issues

Commit Message

Chenxu Di Nov. 6, 2019, 5:09 a.m. UTC
  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: Di ChenxuX <chenxux.di@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a80e..84b98071d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1796,16 +1796,7 @@  eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev)
 {
-	struct rte_eth_dev *ethdev;
-
-	ethdev = rte_eth_dev_allocated(pci_dev->device.name);
-	if (!ethdev)
-		return -ENODEV;
-
-	if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
-		return rte_eth_dev_destroy(ethdev, 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 = {