From: Hangbin Liu <hangbin.liu@linux.dev>
To: ramses@well-founded.dev
Cc: Jay Vosburgh <jv@jvosburgh.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Jiri Bohac <jbohac@suse.cz>, Eric Dumazet <edumazet@kernel.org>,
Willem de Bruijn <willemb@google.com>,
Simon Horman <horms@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org,
Nikolay Aleksandrov <razor@blackwall.org>,
Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH net-next 2/2] selftests: bonding: test that the ARP monitor keeps UP slaves when it starts
Date: Thu, 3 Dec 2026 11:23:18 +0800 [thread overview]
Message-ID: <axDgWrEy4NTneD4l@fedora> (raw)
In-Reply-To: <20261201-bonding-arp-reseed-v1-2-984d4a3991cb@well-founded.dev>
Hi Ramses,
On Tue, Dec 01, 2026 at 12:20:30PM +0200, Ramses de Norre via B4 Relay wrote:
> From: Ramses de Norre <ramses@well-founded.dev>
>
> Add a test for the two ways the ARP monitor can start after the slaves
> were enslaved: bringing the bond up after enslaving into it while it is
> down, and setting arp_interval on a running bond that uses miimon. In
> both cases the test waits longer than the arp_missed_max window before
> the monitor starts, and checks that the primary stays active and that no
> slave gets a link failure.
>
> Without the previous patch, both cases fail: the first monitor run takes
> both slaves down and the bond comes back on eth1, where it stays with
> primary_reselect=failure.
>
> Signed-off-by: Ramses de Norre <ramses@well-founded.dev>
> ---
> .../testing/selftests/drivers/net/bonding/Makefile | 1 +
> .../drivers/net/bonding/bond_arp_monitor_start.sh | 154 +++++++++++++++++++++
> 2 files changed, 155 insertions(+)
>
> diff --git a/tools/testing/selftests/drivers/net/bonding/Makefile b/tools/testing/selftests/drivers/net/bonding/Makefile
> index 46d9fede59185..12276c942506e 100644
> --- a/tools/testing/selftests/drivers/net/bonding/Makefile
> +++ b/tools/testing/selftests/drivers/net/bonding/Makefile
> @@ -6,6 +6,7 @@ TEST_PROGS := \
> bond-break-lacpdu-tx.sh \
> bond-eth-type-change.sh \
> bond-lladdr-target.sh \
> + bond_arp_monitor_start.sh \
> bond_ipsec_offload.sh \
> bond_lacp_independent_control.sh \
> bond_lacp_prio.sh \
> diff --git a/tools/testing/selftests/drivers/net/bonding/bond_arp_monitor_start.sh b/tools/testing/selftests/drivers/net/bonding/bond_arp_monitor_start.sh
> new file mode 100755
> index 0000000000000..a718292172244
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/bonding/bond_arp_monitor_start.sh
> @@ -0,0 +1,154 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# Check that the ARP monitor does not take UP slaves down when it starts
> +# after the slaves were enslaved. That happens when the slaves are enslaved
> +# while the bond is down, or when arp_interval is set on a running bond
> +# that used miimon. The monitor must give the slaves a full arp_missed_max
> +# window from when it starts, not from when they were enslaved.
> +#
> +# +------------------------+
> +# | bond0 192.0.2.1/24 | h_ns
> +# | eth0 eth1 |
> +# +---+-------------+------+
> +# | |
> +# +---+-------------+------+
> +# | sw0 sw1 | sw_ns
> +# | br0 192.0.2.254/24 |
> +# +------------------------+
> +
> +# shellcheck disable=SC2034,SC2329
> +ALL_TESTS="
> + arp_monitor_start_on_open
> + arp_monitor_start_on_interval_set
> +"
> +REQUIRE_MZ=no
> +NUM_NETIFS=0
> +lib_dir=$(dirname "$0")
> +# shellcheck disable=SC1091
> +source "$lib_dir"/../../../net/forwarding/lib.sh
> +
> +require_command jq
> +
[...]
> +
> +trap cleanup EXIT
> +
> +setup_prepare
> +setup_wait
Since we don't need the NUM_NETIFS, there is no need to call setup_wait.
With that, we can include net/lib.sh directly, and remove the
REQUIRE_MZ/NUM_NETIFS setting.
Thanks
Hangbin
> +
> +tests_run
> +
> +exit "$EXIT_STATUS"
>
> --
> 2.56.1
>
>
prev parent reply other threads:[~2026-12-03 3:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 10:20 [PATCH net-next 0/2] bonding: reseed the ARP monitor when it starts Ramses de Norre via B4 Relay
2026-12-01 10:20 ` [PATCH net-next 1/2] " Ramses de Norre via B4 Relay
2026-12-03 3:18 ` Hangbin Liu
2026-12-01 10:20 ` [PATCH net-next 2/2] selftests: bonding: test that the ARP monitor keeps UP slaves " Ramses de Norre via B4 Relay
2026-12-03 3:23 ` Hangbin Liu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=axDgWrEy4NTneD4l@fedora \
--to=hangbin.liu@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jbohac@suse.cz \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ramses@well-founded.dev \
--cc=razor@blackwall.org \
--cc=shuah@kernel.org \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox