mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjoern Doebel <doebel@amazon.de>
To: Jay Vosburgh <jv@jvosburgh.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Shuah Khan <shuah@kernel.org>
Cc: Hangbin Liu <liuhangbin@gmail.com>, Liang Li <liali@redhat.com>,
	<netdev@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Bjoern Doebel <doebel@amazon.de>
Subject: [PATCH net] selftests: bonding: feed link monitor to deflake prio_test
Date: Wed, 4 Nov 2026 14:20:18 +0000	[thread overview]
Message-ID: <20261104142018.552135-1-doebel@amazon.de> (raw)

With the bond idle between test steps, the arp/ns link monitor can
declare a healthy slave down (~300ms without RX/TX). If this hits a
failover step, the bond picks a different active slave than expected,
and primary_reselect=failure/better never reverts it:

  TEST: prio (active-backup ns_ip6_target primary_reselect 2) [FAIL]
      Current active slave is eth0 but not eth2

Reproducible when running tests under load (2-4 / 100 runs).

Fix by pinging a non-existent neighbor for the duration of the test to
keep traffic coming. 100 runs under the same load with the patch
applied: 0 failures.

Fixes: 42a8d4aaea84 ("selftests: bonding: add bonding prio option test")
Signed-off-by: Bjoern Doebel <doebel@amazon.de>
---
 .../selftests/drivers/net/bonding/bond_options.sh   | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tools/testing/selftests/drivers/net/bonding/bond_options.sh b/tools/testing/selftests/drivers/net/bonding/bond_options.sh
index 187b478d0ddf2..f599a2a8ef156 100755
--- a/tools/testing/selftests/drivers/net/bonding/bond_options.sh
+++ b/tools/testing/selftests/drivers/net/bonding/bond_options.sh
@@ -74,6 +74,16 @@ prio_test()
 
 	# create bond
 	bond_reset "${param}"
+
+	# Keep the arp/ns link monitor fed for the duration of the test:
+	# ping a non-existent neighbor, which generates steady broadcast
+	# ARP requests sourced from the bond's own address. These egress on
+	# the active slave and are flooded onto the backup slaves' links,
+	# where they validate as RX activity. Without traffic, idle slaves
+	# are declared down by the monitor between test steps and the
+	# failover checks below race with the monitor.
+	ip netns exec ${s_ns} ping -i 0.1 -W 1 192.0.2.99 &> /dev/null &
+	local ping_pid=$!
 	# set active_slave to primary eth1 specifically
 	ip -n ${s_ns} link set bond0 type bond active_slave eth1
 
@@ -157,6 +167,9 @@ prio_test()
 		check_active_slave "eth0"
 		bond_check_connection "change slave prio"
 	fi
+
+	kill $ping_pid 2>/dev/null
+	wait $ping_pid 2>/dev/null
 }
 
 prio_miimon()

base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d
-- 
2.50.1


                 reply	other threads:[~2026-11-04 14:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261104142018.552135-1-doebel@amazon.de \
    --to=doebel@amazon.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=liali@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /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

all inboxes | Powered by JetHome®