Netdev List
 help / color / mirror / Atom feed
* [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode
@ 2026-11-26  2:30 Hangbin Liu
  2026-11-26  2:30 ` [PATCH net 1/3] Revert "bonding: do not set usable_slaves for broadcast mode" Hangbin Liu
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Hangbin Liu @ 2026-11-26  2:30 UTC (permalink / raw)
  To: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Tonghao Zhang, Nikolay Aleksandrov,
	Shuah Khan
  Cc: jiangjiehua (A), Hangbin Liu, netdev, linux-kernel,
	linux-kselftest, Hangbin Liu

This patchset fixes updelay handling for bonding broadcast mode (mode 3)
to align with bonding documentation section 13.1 paragraph 4: when a
bond has no active links, the first link that comes up must be reused
immediately even if updelay is configured; when usable links exist,
updelay must be honored.

Commit 45fc134bcfad ("bonding: do not set usable_slaves for broadcast
mode") tried to fix the second half of that rule by never updating
usable_slaves in broadcast mode. That made ignore_updelay permanently
false, so updelay was always applied and a broadcast bond with no
active links could not recover within the miimon window when one usable
slave up.

We revert 45fc134bcfad to restore the enslave/release side of the
usable_slaves updates, and add the missing bond_miimon_link_change()
case so the snapshot also tracks link-state transitions. Both halves
are needed:

  - revert alone: the snapshot is only rebuilt on enslave/release, so
    batch enslave with updelay (new slaves start in BOND_LINK_BACK)
    leaves count == 0 forever and updelay is never honored, even once
    other slaves are usable;
  - link_change case alone: with 45fc134bcfad applied,
    bond_set_slave_arr() discards the refreshed array for broadcast.

A selftest is added to cover mode 3; the existing mode 1 and mode 2
recovery-updelay tests are merged into a single script covering
modes 1, 2 and 3.

Before revert 45fc134bcfad:
  TEST: mode (3) bond recovery                               [FAIL]
          No connectivity
  TEST: mode (3) bond recovery                               [FAIL]
          No connectivity
  TEST: mode (3) bond recovery                               [FAIL]
          No connectivity

After revert 45fc134bcfad:
  TEST: mode (3) bond recovery                               [ OK ]
  TEST: mode (3) bond recovery                               [ OK ]
  TEST: mode (3) bond recovery                               [ OK ]

For the second patch, I use test script
  ```
  ip link add veth0 type veth peer name veth0p
  ip link add veth1 type veth peer name veth1p
  ip link set veth0p up
  ip link set veth1p up
  ip link add bond0 type bond mode broadcast miimon 100 updelay 1000
  ip link set veth0 down
  ip link set veth1 down
  ip link set veth0 master bond0 && ip link set veth1 master bond0
  ip link set bond0 up
  sleep 2
  dmesg -C

  # Test A — bullet 1: batch enslave, snapshot stuck at count == 0,
  # updelay never honored
  ip link set veth0p down
  sleep 2
  ip link set veth0p up
  sleep 1
  dmesg | tail -n 5

  # Test B — bullet 2: stale non-empty snapshot, recovery delayed with
  # zero usable links
  ip link set veth0 nomaster
  ip link set veth1 nomaster
  ip link set veth0 master bond0
  sleep 2 # wait veth0 up
  ip link set veth1 master bond0
  sleep 2 # veth1 comes up after its own updelay; snapshot stays
  # drop both links (bond has zero usable links after this)
  ip link set veth0p down
  ip link set veth1p down
  sleep 2
  ip link set veth0p up
  sleep 2
  dmesg | tail -n 5
  ```

With revert only:
Test A:
[   13.190593] bond0: (slave veth0): link status definitely down, disabling slave
[   15.165875] bond0: (slave veth0): link status up, enabling it in 0 ms
[   15.165919] bond0: (slave veth0): link status definitely up, 10000 Mbps full duplex
Test B:
[   20.366724] bond0: (slave veth1): link status definitely down, disabling slave
[   20.366957] bond0: now running without any active interface!
[   22.341960] bond0: (slave veth0): link status up, enabling it in 1000 ms
[   23.382194] bond0: (slave veth0): link status definitely up, 10000 Mbps full duplex
[   23.382428] bond0: active interface up!

With the second patch
Test A:
[    6.208526] bond0: (slave veth0): link status definitely down, disabling slave
[    8.184359] bond0: (slave veth0): link status up, enabling it in 1000 ms
Test B:
[   13.384852] bond0: (slave veth1): link status definitely down, disabling slave
[   13.385093] bond0: now running without any active interface!
[   15.360849] bond0: (slave veth0): link status up, enabling it in 0 ms

We can see when there is active slave, the second slave follow the
updelay rule (Test A). When there is no active slave, the first up
slave will be in use immediately (Test B).

Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
Hangbin Liu (3):
      Revert "bonding: do not set usable_slaves for broadcast mode"
      bonding: update slave array on link change for broadcast mode
      selftests: bonding: add recovery updelay test for broadcast mode

 drivers/net/bonding/bond_main.c                    | 14 +++----
 .../testing/selftests/drivers/net/bonding/Makefile |  3 +-
 .../drivers/net/bonding/mode-2-recovery-updelay.sh | 45 ----------------------
 ...e-1-recovery-updelay.sh => recovery-updelay.sh} | 13 +++----
 4 files changed, 12 insertions(+), 63 deletions(-)
---
base-commit: 1ab3fb564f20b78615a6d88b8c90da292f29e227
change-id: 20261126-bond_broadcast_updelay-cc4cfb6e0e37

Best regards,
--  
Hangbin Liu <liuhangbin@kylinos.cn>


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

* [PATCH net 1/3] Revert "bonding: do not set usable_slaves for broadcast mode"
  2026-11-26  2:30 [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode Hangbin Liu
@ 2026-11-26  2:30 ` Hangbin Liu
  2026-11-26  2:30 ` [PATCH net 2/3] bonding: update slave array on link change for broadcast mode Hangbin Liu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2026-11-26  2:30 UTC (permalink / raw)
  To: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Tonghao Zhang, Nikolay Aleksandrov,
	Shuah Khan
  Cc: jiangjiehua (A), Hangbin Liu, netdev, linux-kernel,
	linux-kselftest, Hangbin Liu

From: Hangbin Liu <liuhangbin@kylinos.cn>

This reverts commit 45fc134bcfadde456639c1b1e206e6918d69a553.

Commit 45fc134bcfad ("bonding: do not set usable_slaves for broadcast mode")
assumes the bond updelay always applies. However, per commit f8a65ab2f3ff
("bonding: fix link recovery in mode 2 when updelay is nonzero") and
section 13.1 paragraph 4 of the bonding documentation, when a slave is
enslaved and there are no active slaves, the slave should become usable
immediately once its link comes up, updelay should be ignored.

Before this revert: with no active interfaces, the only slave still waited
out the 1000 ms updelay before being brought into use.

  [  154.846629] bond0: (slave veth0): link status definitely down, disabling slave
  [  154.849879] bond0: now running without any active interface!
  [  159.544736] bond0: (slave veth0): link status up, enabling it in 1000 ms
  [  160.586299] bond0: (slave veth0): link status definitely up, 10000 Mbps full duplex
  [  160.603278] bond0: active interface up!

After this revert: the first slave can be used immediately on link up.
Subsequent slave veth2 still honor the 1000 ms updelay.

  [   94.106425] bond0: (slave veth0): link status definitely down, disabling slave
  [   94.109130] bond0: now running without any active interface!
  [   98.272494] bond0: (slave veth0): link status up, enabling it in 0 ms
  [   98.273279] bond0: (slave veth0): link status definitely up, 10000 Mbps full duplex
  [   98.275056] bond0: active interface up!
  [  110.855705] bond0: (slave veth2): Enslaving as an active interface with an up link
  [  111.904688] bond0: (slave veth2): link status definitely up, 10000 Mbps full duplex
  [  114.608488] bond0: (slave veth2): link status definitely down, disabling slave
  [  117.624491] bond0: (slave veth2): link status up, enabling it in 1000 ms
  [  118.664636] bond0: (slave veth2): link status definitely up, 10000 Mbps full duplex

The stale-empty side of the problem that motivated 45fc134bcfad is
addressed by the follow-up patch in this series, "bonding: update
slave array on link change for broadcast mode", which rebuilds the
array on link transitions, together they keep ignore_updelay correct
in both directions.

Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
 drivers/net/bonding/bond_main.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 042d7c75548f..d6675e87d06b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -5140,18 +5140,13 @@ static void bond_set_slave_arr(struct bonding *bond,
 {
 	struct bond_up_slave *usable, *all;
 
-	all = rtnl_dereference(bond->all_slaves);
-	rcu_assign_pointer(bond->all_slaves, all_slaves);
-	kfree_rcu(all, rcu);
-
-	if (BOND_MODE(bond) == BOND_MODE_BROADCAST) {
-		kfree_rcu(usable_slaves, rcu);
-		return;
-	}
-
 	usable = rtnl_dereference(bond->usable_slaves);
 	rcu_assign_pointer(bond->usable_slaves, usable_slaves);
 	kfree_rcu(usable, rcu);
+
+	all = rtnl_dereference(bond->all_slaves);
+	rcu_assign_pointer(bond->all_slaves, all_slaves);
+	kfree_rcu(all, rcu);
 }
 
 static void bond_reset_slave_arr(struct bonding *bond)

-- 
2.56.0


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

* [PATCH net 2/3] bonding: update slave array on link change for broadcast mode
  2026-11-26  2:30 [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode Hangbin Liu
  2026-11-26  2:30 ` [PATCH net 1/3] Revert "bonding: do not set usable_slaves for broadcast mode" Hangbin Liu
@ 2026-11-26  2:30 ` Hangbin Liu
  2026-11-26  2:30 ` [PATCH net 3/3] selftests: bonding: add recovery updelay test " Hangbin Liu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2026-11-26  2:30 UTC (permalink / raw)
  To: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Tonghao Zhang, Nikolay Aleksandrov,
	Shuah Khan
  Cc: jiangjiehua (A), Hangbin Liu, netdev, linux-kernel,
	linux-kselftest, Hangbin Liu

From: Hangbin Liu <liuhangbin@kylinos.cn>

bond_miimon_link_change() rebuilds the slave array when a slave's
link state changes, but it has no broadcast case, so broadcast only
rebuilds usable_slaves on enslave/release. bond_miimon_inspect()
then derives ignore_updelay from a stale snapshot:

  - if the last rebuild ran while no slave was can_tx (common for
    batch enslave with updelay, since new slaves start in
    BOND_LINK_BACK), the snapshot keeps count == 0 forever and
    updelay is never honored, even once other slaves are usable;
  - if the snapshot still lists a slave that has since gone down,
    ignore_updelay stays false and updelay delays recovery even
    when the bond has no usable links, contrary to section 13.1
    paragraph 4 of the bonding documentation.

Add the broadcast case so the snapshot follows link transitions the
same way balance-xor does. This needs the revert of 45fc134bcfad as
a prerequisite: with 45fc134bcfad applied, bond_set_slave_arr()
discards the refreshed array for broadcast.

Fixes: e0caeb24f538 ("net: bonding: update the slave array for broadcast mode")
Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
 drivers/net/bonding/bond_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index d6675e87d06b..b1efbdf597ec 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2780,6 +2780,7 @@ static void bond_miimon_link_change(struct bonding *bond,
 		bond_alb_handle_link_change(bond, slave, link);
 		break;
 	case BOND_MODE_XOR:
+	case BOND_MODE_BROADCAST:
 		bond_update_slave_arr(bond, NULL);
 		break;
 	}

-- 
2.56.0


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

* [PATCH net 3/3] selftests: bonding: add recovery updelay test for broadcast mode
  2026-11-26  2:30 [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode Hangbin Liu
  2026-11-26  2:30 ` [PATCH net 1/3] Revert "bonding: do not set usable_slaves for broadcast mode" Hangbin Liu
  2026-11-26  2:30 ` [PATCH net 2/3] bonding: update slave array on link change for broadcast mode Hangbin Liu
@ 2026-11-26  2:30 ` Hangbin Liu
  2026-11-26  2:32 ` [PATCH net 0/3] bonding: ignore updelay when no active links " netdev-bot+sinfo
  2026-11-26  7:28 ` jiangjiehua (A)
  4 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2026-11-26  2:30 UTC (permalink / raw)
  To: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Tonghao Zhang, Nikolay Aleksandrov,
	Shuah Khan
  Cc: jiangjiehua (A), Hangbin Liu, netdev, linux-kernel,
	linux-kselftest, Hangbin Liu

From: Hangbin Liu <liuhangbin@kylinos.cn>

Add a recovery updelay test for bonding mode 3. Merge all related tests
into a single test file.

Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
---
 .../testing/selftests/drivers/net/bonding/Makefile |  3 +-
 .../drivers/net/bonding/mode-2-recovery-updelay.sh | 45 ----------------------
 ...e-1-recovery-updelay.sh => recovery-updelay.sh} | 13 +++----
 3 files changed, 7 insertions(+), 54 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/bonding/Makefile b/tools/testing/selftests/drivers/net/bonding/Makefile
index e337c099fb40..c186310c2d6e 100644
--- a/tools/testing/selftests/drivers/net/bonding/Makefile
+++ b/tools/testing/selftests/drivers/net/bonding/Makefile
@@ -15,9 +15,8 @@ TEST_PROGS := \
 	bond_stacked_header_parse.sh \
 	bond_vlan_real_dev.sh \
 	dev_addr_lists.sh \
-	mode-1-recovery-updelay.sh \
-	mode-2-recovery-updelay.sh \
 	netcons_over_bonding.sh \
+	recovery-updelay.sh \
 # end of TEST_PROGS
 
 TEST_FILES := \
diff --git a/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh b/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh
deleted file mode 100755
index 2d275b3e47dd..000000000000
--- a/tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/bash
-# SPDX-License-Identifier: GPL-2.0
-
-# Regression Test:
-#  When the bond is configured with down/updelay and the link state of
-#  slave members flaps if there are no remaining members up the bond
-#  should immediately select a member to bring up. (from bonding.txt
-#  section 13.1 paragraph 4)
-#
-#  +-------------+       +-----------+
-#  | client      |       | switch    |
-#  |             |       |           |
-#  |    +--------| link1 |-----+     |
-#  |    |        +-------+     |     |
-#  |    |        |       |     |     |
-#  |    |        +-------+     |     |
-#  |    | bond   | link2 | Br0 |     |
-#  +-------------+       +-----------+
-#     172.20.2.1           172.20.2.2
-
-
-REQUIRE_MZ=no
-REQUIRE_JQ=no
-NUM_NETIFS=0
-lib_dir=$(dirname "$0")
-source "$lib_dir"/../../../net/forwarding/lib.sh
-source "$lib_dir"/lag_lib.sh
-
-cleanup()
-{
-	lag_cleanup
-}
-
-trap cleanup 0 1 2
-
-lag_setup_network
-test_bond_recovery mode 2 miimon 100 updelay 0
-test_bond_recovery mode 2 miimon 100 updelay 200
-test_bond_recovery mode 2 miimon 100 updelay 500
-test_bond_recovery mode 2 miimon 100 updelay 1000
-test_bond_recovery mode 2 miimon 100 updelay 2000
-test_bond_recovery mode 2 miimon 100 updelay 5000
-test_bond_recovery mode 2 miimon 100 updelay 10000
-
-exit "$EXIT_STATUS"
diff --git a/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh b/tools/testing/selftests/drivers/net/bonding/recovery-updelay.sh
similarity index 72%
rename from tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh
rename to tools/testing/selftests/drivers/net/bonding/recovery-updelay.sh
index 9d26ab4cad0b..05edf9915cc0 100755
--- a/tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh
+++ b/tools/testing/selftests/drivers/net/bonding/recovery-updelay.sh
@@ -34,12 +34,11 @@ cleanup()
 trap cleanup 0 1 2
 
 lag_setup_network
-test_bond_recovery mode 1 miimon 100 updelay 0
-test_bond_recovery mode 1 miimon 100 updelay 200
-test_bond_recovery mode 1 miimon 100 updelay 500
-test_bond_recovery mode 1 miimon 100 updelay 1000
-test_bond_recovery mode 1 miimon 100 updelay 2000
-test_bond_recovery mode 1 miimon 100 updelay 5000
-test_bond_recovery mode 1 miimon 100 updelay 10000
+
+for mode in 1 2 3; do
+	for delay in 0 200 500 1000 2000 5000 10000; do
+		test_bond_recovery mode "${mode}" miimon 100 updelay "${delay}"
+	done
+done
 
 exit "$EXIT_STATUS"

-- 
2.56.0


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

* Re: [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode
  2026-11-26  2:30 [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode Hangbin Liu
                   ` (2 preceding siblings ...)
  2026-11-26  2:30 ` [PATCH net 3/3] selftests: bonding: add recovery updelay test " Hangbin Liu
@ 2026-11-26  2:32 ` netdev-bot+sinfo
  2026-11-26  7:28 ` jiangjiehua (A)
  4 siblings, 0 replies; 7+ messages in thread
From: netdev-bot+sinfo @ 2026-11-26  2:32 UTC (permalink / raw)
  To: Hangbin Liu
  Cc: Jay Vosburgh, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Tonghao Zhang, Nikolay Aleksandrov,
	Shuah Khan, jiangjiehua (A), netdev, linux-kernel,
	linux-kselftest

Hi!

This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:

 - How the issue was discovered, e.g. hit in production, hit during
   development, syzbot report, manual code inspection, LLM or static
   analysis tool scan.

Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.

*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
-- 
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.

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

* Re: [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode
  2026-11-26  2:30 [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode Hangbin Liu
                   ` (3 preceding siblings ...)
  2026-11-26  2:32 ` [PATCH net 0/3] bonding: ignore updelay when no active links " netdev-bot+sinfo
@ 2026-11-26  7:28 ` jiangjiehua (A)
  2026-11-26  8:04   ` Hangbin Liu
  4 siblings, 1 reply; 7+ messages in thread
From: jiangjiehua (A) @ 2026-11-26  7:28 UTC (permalink / raw)
  To: Hangbin Liu, Jay Vosburgh, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Tonghao Zhang,
	Nikolay Aleksandrov, Shuah Khan
  Cc: netdev, linux-kernel, linux-kselftest

Hi Hangbin,

On 11/26/2026 10:30 AM, Hangbin Liu wrote:
> This patchset fixes updelay handling for bonding broadcast mode (mode 3)
> to align with bonding documentation section 13.1 paragraph 4: when a
> bond has no active links, the first link that comes up must be reused
> immediately even if updelay is configured; when usable links exist,
> updelay must be honored.
> 
> Commit 45fc134bcfad ("bonding: do not set usable_slaves for broadcast
> mode") tried to fix the second half of that rule by never updating
> usable_slaves in broadcast mode. That made ignore_updelay permanently
> false, so updelay was always applied and a broadcast bond with no
> active links could not recover within the miimon window when one usable
> slave up.
> 
> We revert 45fc134bcfad to restore the enslave/release side of the
> usable_slaves updates, and add the missing bond_miimon_link_change()
> case so the snapshot also tracks link-state transitions. Both halves
> are needed:
> 
>    - revert alone: the snapshot is only rebuilt on enslave/release, so
>      batch enslave with updelay (new slaves start in BOND_LINK_BACK)
>      leaves count == 0 forever and updelay is never honored, even once
>      other slaves are usable;
>    - link_change case alone: with 45fc134bcfad applied,
>      bond_set_slave_arr() discards the refreshed array for broadcast.
> 
> A selftest is added to cover mode 3; the existing mode 1 and mode 2
> recovery-updelay tests are merged into a single script covering
> modes 1, 2 and 3.
> 
> Before revert 45fc134bcfad:
>    TEST: mode (3) bond recovery                               [FAIL]
>            No connectivity
>    TEST: mode (3) bond recovery                               [FAIL]
>            No connectivity
>    TEST: mode (3) bond recovery                               [FAIL]
>            No connectivity
> 
> After revert 45fc134bcfad:
>    TEST: mode (3) bond recovery                               [ OK ]
>    TEST: mode (3) bond recovery                               [ OK ]
>    TEST: mode (3) bond recovery                               [ OK ]
> 
> For the second patch, I use test script
>    ```
>    ip link add veth0 type veth peer name veth0p
>    ip link add veth1 type veth peer name veth1p
>    ip link set veth0p up
>    ip link set veth1p up
>    ip link add bond0 type bond mode broadcast miimon 100 updelay 1000
>    ip link set veth0 down
>    ip link set veth1 down
>    ip link set veth0 master bond0 && ip link set veth1 master bond0
>    ip link set bond0 up
>    sleep 2
>    dmesg -C
> 
>    # Test A — bullet 1: batch enslave, snapshot stuck at count == 0,
>    # updelay never honored
>    ip link set veth0p down
>    sleep 2
>    ip link set veth0p up
>    sleep 1
>    dmesg | tail -n 5
> 
>    # Test B — bullet 2: stale non-empty snapshot, recovery delayed with
>    # zero usable links
>    ip link set veth0 nomaster
>    ip link set veth1 nomaster
>    ip link set veth0 master bond0
>    sleep 2 # wait veth0 up
>    ip link set veth1 master bond0
>    sleep 2 # veth1 comes up after its own updelay; snapshot stays
>    # drop both links (bond has zero usable links after this)
>    ip link set veth0p down
>    ip link set veth1p down
>    sleep 2
>    ip link set veth0p up
>    sleep 2
>    dmesg | tail -n 5
>    ```
> 
> With revert only:
> Test A:
> [   13.190593] bond0: (slave veth0): link status definitely down, disabling slave
> [   15.165875] bond0: (slave veth0): link status up, enabling it in 0 ms
> [   15.165919] bond0: (slave veth0): link status definitely up, 10000 Mbps full duplex
> Test B:
> [   20.366724] bond0: (slave veth1): link status definitely down, disabling slave
> [   20.366957] bond0: now running without any active interface!
> [   22.341960] bond0: (slave veth0): link status up, enabling it in 1000 ms
> [   23.382194] bond0: (slave veth0): link status definitely up, 10000 Mbps full duplex
> [   23.382428] bond0: active interface up!
> 
> With the second patch
> Test A:
> [    6.208526] bond0: (slave veth0): link status definitely down, disabling slave
> [    8.184359] bond0: (slave veth0): link status up, enabling it in 1000 ms
> Test B:
> [   13.384852] bond0: (slave veth1): link status definitely down, disabling slave
> [   13.385093] bond0: now running without any active interface!
> [   15.360849] bond0: (slave veth0): link status up, enabling it in 0 ms
> 
> We can see when there is active slave, the second slave follow the
> updelay rule (Test A). When there is no active slave, the first up
> slave will be in use immediately (Test B).
> 
> Signed-off-by: Hangbin Liu <liuhangbin@kylinos.cn>
> ---
> Hangbin Liu (3):
>        Revert "bonding: do not set usable_slaves for broadcast mode"
>        bonding: update slave array on link change for broadcast mode
>        selftests: bonding: add recovery updelay test for broadcast mode
> 
>   drivers/net/bonding/bond_main.c                    | 14 +++----
>   .../testing/selftests/drivers/net/bonding/Makefile |  3 +-
>   .../drivers/net/bonding/mode-2-recovery-updelay.sh | 45 ----------------------
>   ...e-1-recovery-updelay.sh => recovery-updelay.sh} | 13 +++----
>   4 files changed, 12 insertions(+), 63 deletions(-)
> ---
> base-commit: 1ab3fb564f20b78615a6d88b8c90da292f29e227
> change-id: 20261126-bond_broadcast_updelay-cc4cfb6e0e37
> 
> Best regards,
> --
> Hangbin Liu <liuhangbin@kylinos.cn>

Tested on v7.4-rc4 in a virtme-ng guest. Ran recovery-updelay.sh (21/21 
OK) and the cover-letter Test A/B; both match the expected updelay behavior.

Tested-by: JiangJieHua <jiangjiehua1@huawei.com>

Thanks,
Jiehua


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

* Re: [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode
  2026-11-26  7:28 ` jiangjiehua (A)
@ 2026-11-26  8:04   ` Hangbin Liu
  0 siblings, 0 replies; 7+ messages in thread
From: Hangbin Liu @ 2026-11-26  8:04 UTC (permalink / raw)
  To: jiangjiehua (A); +Cc: netdev

Hi Jiehua,
On Thu, Nov 26, 2026 at 03:28:52PM +0800, jiangjiehua (A) wrote:
> Hi Hangbin,
> 
> Tested on v7.4-rc4 in a virtme-ng guest. Ran recovery-updelay.sh (21/21 OK)
> and the cover-letter Test A/B; both match the expected updelay behavior.
> 
> Tested-by: JiangJieHua <jiangjiehua1@huawei.com>

Thanks for your testing.

Regards
Hangbin

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

end of thread, other threads:[~2026-11-26  8:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26  2:30 [PATCH net 0/3] bonding: ignore updelay when no active links for broadcast mode Hangbin Liu
2026-11-26  2:30 ` [PATCH net 1/3] Revert "bonding: do not set usable_slaves for broadcast mode" Hangbin Liu
2026-11-26  2:30 ` [PATCH net 2/3] bonding: update slave array on link change for broadcast mode Hangbin Liu
2026-11-26  2:30 ` [PATCH net 3/3] selftests: bonding: add recovery updelay test " Hangbin Liu
2026-11-26  2:32 ` [PATCH net 0/3] bonding: ignore updelay when no active links " netdev-bot+sinfo
2026-11-26  7:28 ` jiangjiehua (A)
2026-11-26  8:04   ` Hangbin Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox