-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bonding-fix-bond-recovery-in-mode-2'
Jonathan Toppins says: ==================== bonding: fix bond recovery in mode 2 When a bond is configured with a non-zero updelay and in mode 2 the bond never recovers after all slaves lose link. The first patch adds selftests that demonstrate the issue and the second patch fixes the issue by ignoring the updelay when there are no usable slaves. ==================== Link: https://lore.kernel.org/r/cover.1669147951.git.jtoppins@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
- Loading branch information
Showing
6 changed files
with
210 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
tools/testing/selftests/drivers/net/bonding/mode-1-recovery-updelay.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
# 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 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 | ||
|
||
exit "$EXIT_STATUS" |
45 changes: 45 additions & 0 deletions
45
tools/testing/selftests/drivers/net/bonding/mode-2-recovery-updelay.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/sh | ||
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
timeout=60 | ||
timeout=120 |