[PATCH net v4 0/2] bonding: fix the initial last_rx seed for the ARP monitor

From: Ramses de Norre via B4 Relay

Date: Wed Oct 28 2026 - 07:50:55 EST


bond_enslave() seeds a new slave's last_rx before it has received
anything. The ARP monitor checks that seed with an up test for a slave
that starts DOWN, and with a down test for a slave that starts UP. The
seed is wrong for both.

Patch 1 fixes a slave that starts DOWN. Since the up test gained
arp_interval/2 of slack, the seed falls inside the up window, so the
slave is reported UP for half an interval without having received
anything.

Patch 2 fixes a slave that starts UP. The seed brings its down deadline
forward by one interval compared to what arp_missed_max implies. In
load-balance mode, which has no grace period after enslavement, a
healthy slave can flap DOWN with arp_missed_max=1.

Jay, on your v3 question: the up test always uses a single interval, so
the fix for a slave that starts DOWN holds for any arp_missed_max. But
v3 also changed the seed of a slave that starts UP, which made the
load-balance flap happen with the default arp_missed_max=2 too. v4 only
uses the older seed for a slave that starts DOWN, and patch 2 gives a
slave that starts UP a full arp_missed_max window.

Signed-off-by: Ramses de Norre <ramses@xxxxxxxxxxxxxxxx>
---
Changes in v4:
- Patch 1: only use the older seed for a slave that starts DOWN. v3
also applied it to a slave that starts UP, which brought its down
deadline forward by one interval (Jay).
- New patch 2: seed a slave that starts UP with last_link_up, giving it
a full arp_missed_max window. Fixes an existing flap in load-balance
mode with arp_missed_max=1.
- Drop Hangbin's Reviewed-by, patch 1 changed.
- Link to v3: https://patch.msgid.link/20261027-bonding-last-rx-v3-1-54907f1fb042@xxxxxxxxxxxxxxxx

Changes in v3:
- No code changes. Rebase on current net.
- Reword the commit message along the lines of the v2 discussion: lead
with what the last_rx seed is for, state that the false UP happens
independent of primary_reselect, and that the initial link state is
unchanged.
- Pick up Reviewed-by from Hangbin.
- Cc Nikolay. Hangbin asked for a second review, Jay or Nikolay, would
you have a look?
- Link to v2: https://patch.msgid.link/20260827-bonding-last-rx-v2-1-7c3833822c23@xxxxxxxxxxxxxxxx

Changes in v2:
- No code changes. Resend with my personal name in the From and
Signed-off-by lines instead of my handle, as requested for the DCO.
- Link to v1: https://patch.msgid.link/20260817-bonding-last-rx-v1-1-9da6f7fdf812@xxxxxxxxxxxxxxxx

---
Ramses de Norre (2):
bonding: fix initial last_rx vs ARP-monitor slack window
bonding: give a slave that starts UP a full arp_missed_max window

drivers/net/bonding/bond_main.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
---
base-commit: f75062536e2d45ee182828f0e47e0124be2fdc8d
change-id: 20260817-bonding-last-rx-0303fa048f9d

Best regards,
--
Ramses de Norre <ramses@xxxxxxxxxxxxxxxx>