/**
* @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
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)