[PATCH net 0/2] bond: fix 2 link state issues

Hangbin Liu posted 2 patches 1 month, 1 week ago
drivers/net/bonding/bond_main.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
[PATCH net 0/2] bond: fix 2 link state issues
Posted by Hangbin Liu 1 month, 1 week ago
This patch set fixes two bonding link state issues:

1. Broadcast mode incorrectly sets usable_slaves, causing updelay to be ignored
2. BOND_LINK_FAIL and BOND_LINK_BACK are treated as invalid states, generating
   confusing error messages

Here is the reproducer:

```
ip netns add ns
ip -n ns link add bond0 type bond mode 3 miimon 100 updelay 200 downdelay 200
ip -n ns link add type veth
ip -n ns link add type veth
ip -n ns link set veth1 up
ip -n ns link set veth3 up
ip -n ns link set veth0 master bond0
ip -n ns link set veth2 master bond0
ip -n ns link set bond0 up
sleep 1
ip -n ns link set veth3 down
sleep 1
ip -n ns link set veth3 up
sleep 1
dmesg | tail
```

---
Hangbin Liu (2):
      bonding: do not set usable_slaves for broadcast mode
      bonding: handle BOND_LINK_FAIL, BOND_LINK_BACK as valid link states

 drivers/net/bonding/bond_main.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
---
base-commit: 46d0d6f50dab706637f4c18a470aac20a21900d3
change-id: 20260304-b4-bond_updelay-266e8ce1048e

Best regards,
-- 
Hangbin Liu <liuhangbin@gmail.com>
Re: [PATCH net 0/2] bond: fix 2 link state issues
Posted by Jakub Kicinski 1 month, 1 week ago
On Wed, 04 Mar 2026 15:13:52 +0800 Hangbin Liu wrote:
> Here is the reproducer:
> 
> ```
> ip netns add ns
> ip -n ns link add bond0 type bond mode 3 miimon 100 updelay 200 downdelay 200
> ip -n ns link add type veth
> ip -n ns link add type veth
> ip -n ns link set veth1 up
> ip -n ns link set veth3 up
> ip -n ns link set veth0 master bond0
> ip -n ns link set veth2 master bond0
> ip -n ns link set bond0 up
> sleep 1
> ip -n ns link set veth3 down
> sleep 1
> ip -n ns link set veth3 up
> sleep 1
> dmesg | tail

Are you planning to add a regression test? Or you think this is too
much of a one-off regression? Just curious..
Re: [PATCH net 0/2] bond: fix 2 link state issues
Posted by Hangbin Liu 1 month, 1 week ago
On Fri, Mar 06, 2026 at 04:26:13PM -0800, Jakub Kicinski wrote:
> On Wed, 04 Mar 2026 15:13:52 +0800 Hangbin Liu wrote:
> > Here is the reproducer:
> > 
> > ```
> > ip netns add ns
> > ip -n ns link add bond0 type bond mode 3 miimon 100 updelay 200 downdelay 200
> > ip -n ns link add type veth
> > ip -n ns link add type veth
> > ip -n ns link set veth1 up
> > ip -n ns link set veth3 up
> > ip -n ns link set veth0 master bond0
> > ip -n ns link set veth2 master bond0
> > ip -n ns link set bond0 up
> > sleep 1
> > ip -n ns link set veth3 down
> > sleep 1
> > ip -n ns link set veth3 up
> > sleep 1
> > dmesg | tail
> 
> Are you planning to add a regression test? Or you think this is too
> much of a one-off regression? Just curious.. 

Hmm, I didn't plan to write a test case for this corner issue. But with your
reminder, may be I can add a common updealy/downdelay parameter test case.
I will add this on my todo list.

Thanks
Hangbin