net/bond: change link status check to no-wait
Subsystems (2)
PATCH 1/1 net/bond: change link status check to no-wait
In the 802.3ad periodic callback function the link status of all slaves is checked using rte_eth_link_get function. Depending on the slave device this function can block for up to 9 seconds and therefore could cause issues with the LACP Daemon state machine and control patches handling. This patch changes to the no-wait version of the link get function.
--- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +1 -1
@@ -758,7 +758,7 @@ bond_mode_8023ad_periodic_cb(void *arg)uint16_t key; slave_id = internals->active_slaves[i]; -rte_eth_link_get (slave_id, &link_info); +rte_eth_link_get_nowait (slave_id, &link_info);rte_eth_macaddr_get (slave_id, &slave_addr);if (link_info.link_status !=0 ) {
Signature · 1 line
2.9.4
Quoted 19 lines · Declan Doherty
In the 802.3ad periodic callback function the link status of all slaves is checked using
rte_eth_link_getfunction. Depending on the slave device this function can block for up to 9 seconds and therefore could cause issues with the LACP Daemon state machine and control patches handling. This patch changes to the no-wait version of the link get function.Fixes 46fb4368 ("bond:add mode 4")Signed-off-by Declan Doherty <[email protected]>--- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/bonding/rte_eth_bond_8023ad.c +0
-0
drivers/net/bonding/rte_eth_bond_8023ad.c bond_mode_8023ad_periodic_cb(void *arg) · line 764
Quoted 8 lines
drivers/net/bonding/rte_eth_bond_8023ad.c +1
-1@@ -758,7 +758,7 @@ bond_mode_8023ad_periodic_cb(void *arg)uint16_t key; slave_id = internals->active_slaves[i]; -rte_eth_link_get (slave_id, &link_info); +rte_eth_link_get_nowait (slave_id, &link_info);rte_eth_macaddr_get (slave_id, &slave_addr);if (link_info.link_status !=0 ) {
It seems like this should be done in bandwidth_left() as well.
Quoted 12 lines · Chas Williams
Quoted 11 lines · Declan Doherty
In the 802.3ad periodic callback function the link status of all slaves is checked using
rte_eth_link_getfunction. Depending on the slave device this function can block for up to 9 seconds and therefore could cause issues with the LACP Daemon state machine and control patches handling. This patch changes to the no-wait version of the link get function.Fixes 46fb4368 ("bond:add mode 4")Signed-off-by Declan Doherty <[email protected]>---
...
Quoted 3 lines
It seems like this should be done in
bandwidth_left()as well.
Yep, your right. I'll make that change in the v2.
Thanks
Declan
PATCH v2 1/1 net/bond: change link status check to no-wait
In reply to Declan DohertyIn 2 modes (802.3ad and TLB) of the link bonding driver, monitoring of link status is used to determine the active slaves to use. These functions are currently using the rte_link_link_get which could block for up to 9 seconds, depending on the slave device.
In the 802.3ad periodic callback and in the TLB slave callback the link status of slaves are checked using rte_eth_link_get function.
This patch changes to the no-wait version of the link get function to avoid the possible issues which could be introduced if this call was to block for an extended period of time.
--- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +1 -1
@@ -758,7 +758,7 @@ bond_mode_8023ad_periodic_cb(void *arg)uint16_t key; slave_id = internals->active_slaves[i]; -rte_eth_link_get (slave_id, &link_info); +rte_eth_link_get_nowait (slave_id, &link_info);rte_eth_macaddr_get (slave_id, &slave_addr);if (link_info.link_status !=0 ) {
drivers/net/bonding/rte_eth_bond_pmd.c +1 -1
@@ -654,7 +654,7 @@ bandwidth_left(uint8_t port_id, uint64_t load, uint8_t update_idx, {struct rte_eth_link link_status; -rte_eth_link_get (port_id, &link_status); +rte_eth_link_get_nowait (port_id, &link_status);uint64_t link_bwg = link_status.link_speed *1000000ULL /8 ;if (link_bwg ==0 )return ;
Signature · 1 line
2.9.4
Ferruh Yigit
AppliedQuoted 11 lines · Declan Doherty
In 2 modes (802.3ad and TLB) of the link bonding driver, monitoring of link status is used to determine the active slaves to use. These functions are currently using the
rte_link_link_getwhich could block for up to 9 seconds, depending on the slave device.In the 802.3ad periodic callback and in the TLB slave callback the link status of slaves are checked using
rte_eth_link_getfunction.This patch changes to the no-wait version of the link get function to avoid the possible issues which could be introduced if this call was to block for an extended period of time.
Quoted 2 lines
Signed-off-by Declan Doherty <[email protected]>
Applied to dpdk-next-net/master, thanks.