net/i40e: fix hotplug remove
authorChenxu Di <chenxux.di@intel.com>
Tue, 12 Nov 2019 05:56:06 +0000 (05:56 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 20 Nov 2019 16:36:05 +0000 (17:36 +0100)
testpmd will occur infinite loops when device hotplug remove.
We can fix the issue by using the pci generic remove function

Fixes: ac89d46096d5 ("net/i40e: release port upon close")

Signed-off-by: Chenxu Di <chenxux.di@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/i40e/i40e_ethdev.c

index 27d2c0e..9a81f99 100644 (file)
@@ -698,13 +698,14 @@ static int eth_i40e_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, i40e_vf_representor_uninit);
+               return rte_eth_dev_pci_generic_remove(pci_dev,
+                                       i40e_vf_representor_uninit);
        else
-               return rte_eth_dev_destroy(ethdev, eth_i40e_dev_uninit);
+               return rte_eth_dev_pci_generic_remove(pci_dev,
+                                               eth_i40e_dev_uninit);
 }
 
 static struct rte_pci_driver rte_i40e_pmd = {