]> git.droids-corp.org - dpdk.git/blobdiff - lib/ethdev/ethdev_pci.h
pipeline: support action annotations
[dpdk.git] / lib / ethdev / ethdev_pci.h
index 8edca82ce8699f11b3e15e73f1c96cb2e33e0be7..59c5d7b40fc53221efc53f2a57941dfda1d71f5a 100644 (file)
@@ -59,7 +59,7 @@ eth_dev_pci_specific_init(struct rte_eth_dev *eth_dev, void *bus_device) {
 
 /**
  * @internal
- * Allocates a new ethdev slot for an ethernet device and returns the pointer
+ * Allocates a new ethdev slot for an Ethernet device and returns the pointer
  * to that slot for the driver to use.
  *
  * @param dev
@@ -151,6 +151,16 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
        if (!eth_dev)
                return 0;
 
+       /*
+        * In secondary process, a released eth device can be found by its name
+        * in shared memory.
+        * If the state of the eth device is RTE_ETH_DEV_UNUSED, it means the
+        * eth device has been released.
+        */
+       if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
+           eth_dev->state == RTE_ETH_DEV_UNUSED)
+               return 0;
+
        if (dev_uninit) {
                ret = dev_uninit(eth_dev);
                if (ret)