[dpdk-dev] [PATCH v11 07/19] net/i40e: enable hotplug on secondary process

Qi Zhang qi.z.zhang at intel.com
Wed Jul 11 05:09:05 CEST 2018


Previously, detach port on a secondary process will mess primary
process and cause the same device can't be attached back again.
A secondary process should use rte_eth_release_port_private to
release a port.

Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 13c5d3296..7d1f98422 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -678,6 +678,8 @@ static int eth_i40e_pci_remove(struct rte_pci_device *pci_dev)
 	if (!ethdev)
 		return -ENODEV;
 
+	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+		return rte_eth_dev_release_port_private(ethdev);
 
 	if (ethdev->data->dev_flags & RTE_ETH_DEV_REPRESENTOR)
 		return rte_eth_dev_destroy(ethdev, i40e_vf_representor_uninit);
-- 
2.13.6



More information about the dev mailing list