Skip to content

Commit 16541c3

Browse files
Mahesh BandewarSomasundaram Krishnasamy
authored andcommitted
bonding: speed/duplex update at NETDEV_UP event
Orabug: 31730609 Some NIC drivers don't have correct speed/duplex settings at the time they send NETDEV_UP notification and that messes up the bonding state. Especially 802.3ad mode which is very sensitive to these settings. In the current implementation we invoke bond_update_speed_duplex() when we receive NETDEV_UP, however, ignore the return value. If the values we get are invalid (UNKNOWN), then slave gets removed from the aggregator with speed and duplex set to UNKNOWN while link is still marked as UP. This patch fixes this scenario. Also 802.3ad mode is sensitive to these conditions while other modes are not, so making sure that it doesn't change the behavior for other modes. Signed-off-by: Mahesh Bandewar <[email protected]> Signed-off-by: David S. Miller <[email protected]> (cherry picked from commit 4d2c0cd) Signed-off-by: Brian Maly <[email protected]> Reviewed-by: Venkat Venkatsubra <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent c2951b7 commit 16541c3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3087,7 +3087,16 @@ static int bond_slave_netdev_event(unsigned long event,
30873087
break;
30883088
case NETDEV_UP:
30893089
case NETDEV_CHANGE:
3090-
bond_update_speed_duplex(slave);
3090+
/* For 802.3ad mode only:
3091+
* Getting invalid Speed/Duplex values here will put slave
3092+
* in weird state. So mark it as link-down for the time
3093+
* being and let link-monitoring (miimon) set it right when
3094+
* correct speeds/duplex are available.
3095+
*/
3096+
if (bond_update_speed_duplex(slave) &&
3097+
BOND_MODE(bond) == BOND_MODE_8023AD)
3098+
slave->link = BOND_LINK_DOWN;
3099+
30913100
if (BOND_MODE(bond) == BOND_MODE_8023AD)
30923101
bond_3ad_adapter_speed_duplex_changed(slave);
30933102
/* Fallthrough */

0 commit comments

Comments
 (0)