summaryrefslogtreecommitdiff
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorChas Williams <chas3@att.com>2018-05-17 19:22:52 -0400
committerFerruh Yigit <ferruh.yigit@intel.com>2018-06-14 19:54:56 +0200
commit0e677a35349f316d50ba25485354363f3e65c12e (patch)
tree055f5f981e72590bb9e4a6613e6e4185987f09fd /drivers/net/bonding
parent422515b9aab0f1161631276d682303356e243c07 (diff)
downloaddpdk-next-eventdev-0e677a35349f316d50ba25485354363f3e65c12e.zip
dpdk-next-eventdev-0e677a35349f316d50ba25485354363f3e65c12e.tar.gz
dpdk-next-eventdev-0e677a35349f316d50ba25485354363f3e65c12e.tar.xz
net/bonding: always update bonding link status
When the first ETH_LINK_UP slave is added to a bonding device, it is immediately activated. If these are polling slaves, there will be a later link state event, when last_link_status doesn't match link_status. But because this slave is already activated, the bonding device's link status isn't updated. To fix this, we always attempt to update the bonding device's link status in the link state change callback. Fixes: 46fb43683679 ("bond: add mode 4") Cc: stable@dpdk.org Signed-off-by: Chas Williams <chas3@att.com>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/rte_eth_bond_pmd.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 02d94b1..f155ff7 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2664,10 +2664,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
rte_eth_link_get_nowait(port_id, &link);
if (link.link_status) {
- if (active_pos < internals->active_slave_count) {
- rte_spinlock_unlock(&internals->lsc_lock);
- return rc;
- }
+ if (active_pos < internals->active_slave_count)
+ goto link_update;
/* if no active slave ports then set this port to be primary port */
if (internals->active_slave_count < 1) {
@@ -2686,10 +2684,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
internals->primary_port == port_id)
bond_ethdev_primary_set(internals, port_id);
} else {
- if (active_pos == internals->active_slave_count) {
- rte_spinlock_unlock(&internals->lsc_lock);
- return rc;
- }
+ if (active_pos == internals->active_slave_count)
+ goto link_update;
/* Remove from active slave list */
deactivate_slave(bonded_eth_dev, port_id);
@@ -2708,6 +2704,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
}
}
+link_update:
/**
* Update bonded device link properties after any change to active
* slaves
@@ -2745,7 +2742,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
rte_spinlock_unlock(&internals->lsc_lock);
- return 0;
+ return rc;
}
static int