[dpdk-dev] net/bond: change link status check to no-wait

Message ID 20170626151347.16680-1-declan.doherty@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Doherty, Declan June 26, 2017, 3:13 p.m. UTC
  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.

Fixes: 46fb4368 ("bond:add mode 4")

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Chas Williams June 26, 2017, 8:53 p.m. UTC | #1
On Mon, 2017-06-26 at 16:13 +0100, Declan Doherty wrote:
> 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.
> 
> Fixes: 46fb4368 ("bond:add mode 4")
> 
> Signed-off-by: Declan Doherty <declan.doherty@intel.com>
> ---
>  drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
> index d2b7592..3a97336 100644
> --- a/drivers/net/bonding/rte_eth_bond_8023ad.c
> +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
> @@ -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.
  
Doherty, Declan June 28, 2017, 9:13 a.m. UTC | #2
On 26/06/2017 9:53 PM, Chas Williams wrote:
> On Mon, 2017-06-26 at 16:13 +0100, Declan Doherty wrote:
>> 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.
>>
>> Fixes: 46fb4368 ("bond:add mode 4")
>>
>> Signed-off-by: Declan Doherty <declan.doherty@intel.com>
>> ---
...
>
> 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

diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
index d2b7592..3a97336 100644
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
@@ -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) {