[dpdk-dev] [PATCH v2] net/i40e: fix device hotplug remove

Ye Xiaolong xiaolong.ye at intel.com
Thu Nov 7 03:50:29 CET 2019


On 11/06, 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 at intel.com>
>
>v2:
>change the code in driver.
>---
> drivers/net/i40e/i40e_ethdev.c | 12 +-----------
> 1 file changed, 1 insertion(+), 11 deletions(-)
>
>diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
>index 77a46832c..64842867d 100644
>--- a/drivers/net/i40e/i40e_ethdev.c
>+++ b/drivers/net/i40e/i40e_ethdev.c
>@@ -694,17 +694,7 @@ eth_i40e_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
> 
> static int eth_i40e_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, 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);

What about i40e_vf_representor_uninit, you also need to take it into consideration.

And you should also call rte_eth_dev_release_port in remove ops in case user 
detach a port directly without closing it first.

This comment also applies your ixgbe fix.


Thanks,
Xiaolong


> }
> 
> static struct rte_pci_driver rte_i40e_pmd = {
>-- 
>2.17.1
>


More information about the dev mailing list