# Re: \[PATCH net\] selftests: bonding: feed link monitor to deflake prio\_test

- From: Hangbin Liu \<hidden\>
- Date: 2026-11-05 02:19:25 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/11/17867413
- Thread: https://ratatoskr.run/netdev/2026/11/17861182/t.md

```text
Hi Bjoern,
On Wed, Nov 04, 2026 at 02:20:18PM +0000, Bjoern Doebel wrote:
> 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


Thanks for the fix. I also saw this issue but haven't checked it yet.

> 
> 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 <redacted>
> ---
>  .../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

If the kill fails for some reason, will we wait here forever and hang the
entire test?

Thanks
Hangbin
```
