From: Andrew Rybchenko Date: Fri, 21 Jun 2019 09:40:39 +0000 (+0100) Subject: ethdev: avoid error on PCI unplug of closed port X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ca5ba1b6972f381d410f9e53b650ba179e776225;p=dpdk.git ethdev: avoid error on PCI unplug of closed port If PCI Ethernet device driver removes it on close (RTE_ETH_DEV_CLOSE_REMOVE) and later PCI device itself is unplugged, it should not fail because of Ethernet device is already removed. Fixes: 23ea57a2a0ce ("ethdev: complete closing of port") Cc: stable@dpdk.org Signed-off-by: Andrew Rybchenko Reviewed-by: Ivan Malov Reported-by: David Marchand Acked-by: Ferruh Yigit --- diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h index 23257e9862..ccdbb46ec0 100644 --- a/lib/librte_ethdev/rte_ethdev_pci.h +++ b/lib/librte_ethdev/rte_ethdev_pci.h @@ -184,7 +184,7 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev, eth_dev = rte_eth_dev_allocated(pci_dev->device.name); if (!eth_dev) - return -ENODEV; + return 0; if (dev_uninit) { ret = dev_uninit(eth_dev);