X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fethdev%2Fethdev_pci.h;h=71aa4b2e982e39b75529ce7c2a1a77a3f8a8996d;hb=a75ab6e519431fcd00ba435fdb7de8dac516e081;hp=12015b6b8724ad1fd5ea7d804226e74b80c729b8;hpb=0d9f56a857c6e1219636f3e75d8964d81083018a;p=dpdk.git diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h index 12015b6b87..71aa4b2e98 100644 --- a/lib/ethdev/ethdev_pci.h +++ b/lib/ethdev/ethdev_pci.h @@ -32,7 +32,7 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, return; } - eth_dev->intr_handle = &pci_dev->intr_handle; + eth_dev->intr_handle = pci_dev->intr_handle; if (rte_eal_process_type() == RTE_PROC_PRIMARY) { eth_dev->data->dev_flags = 0; @@ -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)