[v4] net/i40e: fix device hotplug remove
Checks
Commit Message
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: Di ChenxuX <chenxux.di@intel.com>
v4:
used generic remove function for i40e_vf_representor_uninit.
v3:
reverted the code about i40e_vf_representor_uninit.
v2:
changed the code in driver.
---
drivers/net/i40e/i40e_ethdev.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Comments
On 11/12, Di ChenxuX wrote:
>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: Di ChenxuX <chenxux.di@intel.com>
>
>v4:
>used generic remove function for i40e_vf_representor_uninit.
>v3:
>reverted the code about i40e_vf_representor_uninit.
>v2:
>changed the code in driver.
>---
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
Applied to dpdk-next-net-intel with changelog removed. Thanks.
@@ -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 = {