netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] bonding: Force slave speed check after link state recovery for 802.3ad
@ 2019-07-16 22:25 Thomas Falcon
  2019-07-22 19:09 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Falcon @ 2019-07-16 22:25 UTC (permalink / raw)
  To: netdev
  Cc: bjking1, pradeep, Thomas Falcon, Jarod Wilson, Jay Vosburgh,
	Veaceslav Falico, Andy Gospodarek

The following scenario was encountered during testing of logical
partition mobility on pseries partitions with bonded ibmvnic
adapters in LACP mode.

1. Driver receives a signal that the device has been
   swapped, and it needs to reset to initialize the new
   device.

2. Driver reports loss of carrier and begins initialization.

3. Bonding driver receives NETDEV_CHANGE notifier and checks
   the slave's current speed and duplex settings. Because these
   are unknown at the time, the bond sets its link state to
   BOND_LINK_FAIL and handles the speed update, clearing
   AD_PORT_LACP_ENABLE.

4. Driver finishes recovery and reports that the carrier is on.

5. Bond receives a new notification and checks the speed again.
   The speeds are valid but miimon has not altered the link
   state yet.  AD_PORT_LACP_ENABLE remains off.

Because the slave's link state is still BOND_LINK_FAIL,
no further port checks are made when it recovers. Though
the slave devices are operational and have valid speed
and duplex settings, the bond will not send LACPDU's. The
simplest fix I can see is to force another speed check
in bond_miimon_commit. This way the bond will update
AD_PORT_LACP_ENABLE if needed when transitioning from
BOND_LINK_FAIL to BOND_LINK_UP.

CC: Jarod Wilson <jarod@redhat.com>
CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
---
 drivers/net/bonding/bond_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 9b7016a..02fd782 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2196,6 +2196,15 @@ static void bond_miimon_commit(struct bonding *bond)
 	bond_for_each_slave(bond, slave, iter) {
 		switch (slave->new_link) {
 		case BOND_LINK_NOCHANGE:
+			/* For 802.3ad mode, check current slave speed and
+			 * duplex again in case its port was disabled after
+			 * invalid speed/duplex reporting but recovered before
+			 * link monitoring could make a decision on the actual
+			 * link status
+			 */
+			if (BOND_MODE(bond) == BOND_MODE_8023AD &&
+			    slave->link == BOND_LINK_UP)
+				bond_3ad_adapter_speed_duplex_changed(slave);
 			continue;
 
 		case BOND_LINK_UP:
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] bonding: Force slave speed check after link state recovery for 802.3ad
  2019-07-16 22:25 [PATCH net] bonding: Force slave speed check after link state recovery for 802.3ad Thomas Falcon
@ 2019-07-22 19:09 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-07-22 19:09 UTC (permalink / raw)
  To: tlfalcon; +Cc: netdev, bjking1, pradeep, jarod, j.vosburgh, vfalico, andy

From: Thomas Falcon <tlfalcon@linux.ibm.com>
Date: Tue, 16 Jul 2019 17:25:10 -0500

> The following scenario was encountered during testing of logical
> partition mobility on pseries partitions with bonded ibmvnic
> adapters in LACP mode.
> 
> 1. Driver receives a signal that the device has been
>    swapped, and it needs to reset to initialize the new
>    device.
> 
> 2. Driver reports loss of carrier and begins initialization.
> 
> 3. Bonding driver receives NETDEV_CHANGE notifier and checks
>    the slave's current speed and duplex settings. Because these
>    are unknown at the time, the bond sets its link state to
>    BOND_LINK_FAIL and handles the speed update, clearing
>    AD_PORT_LACP_ENABLE.
> 
> 4. Driver finishes recovery and reports that the carrier is on.
> 
> 5. Bond receives a new notification and checks the speed again.
>    The speeds are valid but miimon has not altered the link
>    state yet.  AD_PORT_LACP_ENABLE remains off.
> 
> Because the slave's link state is still BOND_LINK_FAIL,
> no further port checks are made when it recovers. Though
> the slave devices are operational and have valid speed
> and duplex settings, the bond will not send LACPDU's. The
> simplest fix I can see is to force another speed check
> in bond_miimon_commit. This way the bond will update
> AD_PORT_LACP_ENABLE if needed when transitioning from
> BOND_LINK_FAIL to BOND_LINK_UP.
> 
> CC: Jarod Wilson <jarod@redhat.com>
> CC: Jay Vosburgh <j.vosburgh@gmail.com>
> CC: Veaceslav Falico <vfalico@gmail.com>
> CC: Andy Gospodarek <andy@greyhouse.net>
> Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>

Applied, thanks Thomas.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-22 19:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-16 22:25 [PATCH net] bonding: Force slave speed check after link state recovery for 802.3ad Thomas Falcon
2019-07-22 19:09 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).