Re: [PATCH net-next 2/2] selftests: bonding: test that the ARP monitor keeps UP slaves when it starts
From: netdev-bot+sashiko
Date: Wed Dec 02 2026 - 22:35:10 EST
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The comment in arp_monitor_start_on_interval_set()…
--
selftests: bonding: test that the ARP monitor keeps UP slaves when it starts
This adds a selftest for two ways the ARP monitor can start after the
slaves are enslaved. In the first, the bond is brought up after slaves
were enslaved while it was down. In the second, arp_interval is set on a
running bond that uses miimon. In both cases the test checks that the
primary stays active and that no slave records a link failure.
> 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
[ ... ]
> +arp_monitor_start_on_interval_set()
> +{
> + RET=0
> +
> + bond_create miimon 100
> + ip -n "$h_ns" link set bond0 up
> + bond_enslave
> + slowwait 5 active_slave_is eth0
> + check_err $? "eth0 did not become the active slave with miimon"
> + sleep "$ENSLAVE_WAIT"
> + # arp_validate cannot be set while miimon is in use. bond_changelink()
> + # sets arp_interval first, which turns miimon off.
[Severity: Low]
This isn't a bug, but does this comment match what bond_changelink()
does?
In drivers/net/bonding/bond_netlink.c, the miimon that the
arp_validate check uses is local to the request. It starts at 0, and
it is only assigned when the same netlink message carries
IFLA_BOND_MIIMON:
bond_changelink() {
int miimon = 0;
...
if (data[IFLA_BOND_MIIMON]) {
miimon = nla_get_u32(data[IFLA_BOND_MIIMON]);
...
if (arp_validate && miimon) {
NL_SET_ERR_MSG_ATTR(extack, data[IFLA_BOND_ARP_VALIDATE],
"ARP validating cannot be used with MII monitoring");
return -EINVAL;
}
...
}
bond_option_arp_validate_set() does not check miimon either. So the
bond's current miimon state never blocks arp_validate. Handling
IFLA_BOND_ARP_INTERVAL first, which clears bond->params.miimon, has no
effect on whether arp_validate is accepted.
It looks like a plain "ip link set bond0 type bond arp_validate all" on
a bond running miimon would also be accepted. The combined command
works because iproute2 does not send IFLA_BOND_MIIMON in that request.
Could the comment be reworded or dropped so it does not describe a
constraint and an ordering dependency that the kernel doesn't have?
> + ip -n "$h_ns" link set bond0 type bond arp_interval "$ARP_INTERVAL" \
> + arp_validate all
> + check_err $? "Failed to switch to the ARP monitor"
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201-bonding-arp-reseed-v1-0-984d4a3991cb%40well-founded.dev