[dpdk-dev] [PATCH v3 12/23] net/fm10k: enable port detach on secondary process
Qi Zhang
qi.z.zhang at intel.com
Mon Jun 25 09:17:34 CEST 2018
Previously, detach port on secondary process will mess primary
process and cause same device can't be attached again, by take
advantage of rte_eth_release_port_private, we can support this
with minor change.
Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
---
drivers/net/fm10k/fm10k_ethdev.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 3ff1b0e0f..f73301182 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -3264,6 +3264,15 @@ static int eth_fm10k_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
static int eth_fm10k_pci_remove(struct rte_pci_device *pci_dev)
{
+ struct rte_eth_dev *ethdev =
+ rte_eth_dev_allocated(pci_dev->device.name);
+
+ if (!ethdev)
+ return -ENODEV;
+
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return rte_eth_dev_release_port_private(ethdev);
+
return rte_eth_dev_pci_generic_remove(pci_dev, eth_fm10k_dev_uninit);
}
--
2.13.6
More information about the dev
mailing list