summaryrefslogtreecommitdiff
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorQi Zhang <qi.z.zhang@intel.com>2018-10-16 08:16:30 +0800
committerThomas Monjalon <thomas@monjalon.net>2018-10-17 10:16:18 +0200
commit4852aa8f6e2125664698afc43b820bd787b02756 (patch)
treeb4cea53ad6dc17a1c81c0c594bb602b13f4a175c /drivers/net/bonding
parentac9e4a17370f19497d41da46bdb2d89bd307e59f (diff)
downloaddpdk-next-eventdev-4852aa8f6e2125664698afc43b820bd787b02756.zip
dpdk-next-eventdev-4852aa8f6e2125664698afc43b820bd787b02756.tar.gz
dpdk-next-eventdev-4852aa8f6e2125664698afc43b820bd787b02756.tar.xz
drivers/net: enable hotplug on secondary process
Attach port from secondary should ignore devargs since the private device is not necessary to support. Also 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_dev_release_port_secondary to release a port. Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/rte_eth_bond_pmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 31c83a2..b731132 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3152,8 +3152,7 @@ bond_probe(struct rte_vdev_device *dev)
name = rte_vdev_device_name(dev);
RTE_BOND_LOG(INFO, "Initializing pmd_bond for %s", name);
- if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
- strlen(rte_vdev_device_args(dev)) == 0) {
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
eth_dev = rte_eth_dev_attach_secondary(name);
if (!eth_dev) {
RTE_BOND_LOG(ERR, "Failed to probe %s", name);
@@ -3268,6 +3267,9 @@ bond_remove(struct rte_vdev_device *dev)
if (eth_dev == NULL)
return -ENODEV;
+ if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+ return rte_eth_dev_release_port_secondary(eth_dev);
+
RTE_ASSERT(eth_dev->device == &dev->device);
internals = eth_dev->data->dev_private;