Subject: Re: bonding: link state question

From: Willy Tarreau <[email-masked]>
Date: Mon, 9 Aug 2021 12:10:21 +0200

Hi Jonathan,

On Sun, Aug 08, 2021 at 09:31:39PM -0400, Jonathan Toppins wrote:
> I am likely very wrong but the lack of a recalculation of the bond carrier
> state after a lower notifies of an up/down event seemed incorrect. Maybe a
> place to start?

Thanks for the test, it could have been a good candidate but it does
not work :-)

That's what I have after the following sequence:

  - link is up
  - suspend-to-ram
  - unplug the cable
  - resume

  $ ip -br li
  eth0             DOWN           e8:6a:64:5d:19:ed <NO-CARRIER,BROADCAST,MULTICAST,SLAVE,UP> 
  eth0.2@eth0      UP             e8:6a:64:5d:19:ed <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> 
  bond0            UP             e8:6a:64:5d:19:ed <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> 

My bond interface uses eth0 and eth0.2 in active-backup scenario allowing
me to instantly switch between tagged/untagged network depending on the
port I'm connecting to.

I just figured the problem. It's not the bonding driver which is causing
this issue, the issue is with the VLAN interface which incorrectly shows
up while it ought not to, as can be seen above, and the bond naturally
selected it:

  Primary Slave: eth0 (primary_reselect always)
  Currently Active Slave: eth0.2
  MII Status: up
  MII Polling Interval (ms): 200
  Up Delay (ms): 0
  Down Delay (ms): 0
  Peer Notification Delay (ms): 0

So the bond driver works well, I'll have to dig into the 802.1q code
and/or see how the no-carrier state is propagated upstream. So you were
not very wrong at all and put me on the right track :-)

Cheers,
Willy