From: Ramses de Norre via B4 Relay <devnull+ramses.well-founded.dev@kernel.org>
To: 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>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Nikolay Aleksandrov <razor@blackwall.org>,
Hangbin Liu <hangbin.liu@linux.dev>,
Ramses de Norre <ramses@well-founded.dev>
Subject: [PATCH net v4 2/2] bonding: give a slave that starts UP a full arp_missed_max window
Date: Wed, 28 Oct 2026 12:48:08 +0100 [thread overview]
Message-ID: <20261028-bonding-last-rx-v4-2-4d8e4cd47467@well-founded.dev> (raw)
In-Reply-To: <20261028-bonding-last-rx-v4-0-4d8e4cd47467@well-founded.dev>
From: Ramses de Norre <ramses@well-founded.dev>
The ARP monitor marks an UP slave DOWN once jiffies passes
last_rx + arp_missed_max * arp_interval + arp_interval/2. bond_enslave()
seeds last_rx one arp_interval (plus a tick) in the past, which brings
the down deadline of a slave that starts UP forward by one interval
compared to what arp_missed_max promises.
Active-backup mode hides this with a grace period after enslavement in
bond_ab_arp_inspect(). Load-balance mode has no grace period after
enslavement. With arp_missed_max=1 the deadline is half an interval
after enslavement, and the first monitor run checks the slave before it
sends the first probe. If that run lands in the second half of the
interval, a healthy slave is reported "interface is now down" and comes
back UP on the next run.
Seed a slave that starts UP with last_link_up instead, so it gets a full
arp_missed_max window for its first reply. bond_arp_rcv() and
bond_na_rcv() only trust ARPs seen on backup slaves once the active
slave's last_rx is after its last_link_up. A seed equal to last_link_up
keeps that check false until a real reply arrives, as it is today.
Fixes: 5944b5abd864 ("Bonding: add arp_missed_max option")
Signed-off-by: Ramses de Norre <ramses@well-founded.dev>
---
drivers/net/bonding/bond_main.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index bfa4cb97e647c..de5b196f4a1ee 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -2160,9 +2160,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
if (new_slave->link == BOND_LINK_DOWN)
new_slave->last_rx = jiffies -
(2 * msecs_to_jiffies(bond->params.arp_interval) + 1);
+ /* Give a slave that starts UP a full arp_missed_max window. Not
+ * seeding it later than last_link_up keeps bond_arp_rcv() from
+ * trusting ARPs on backup slaves before the active one got a reply.
+ */
else
- new_slave->last_rx = jiffies -
- (msecs_to_jiffies(bond->params.arp_interval) + 1);
+ new_slave->last_rx = new_slave->last_link_up;
for (i = 0; i < BOND_MAX_ARP_TARGETS; i++)
new_slave->target_last_arp_rx[i] = new_slave->last_rx;
--
2.56.0
next prev parent reply other threads:[~2026-10-28 11:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 11:48 [PATCH net v4 0/2] bonding: fix the initial last_rx seed for the ARP monitor Ramses de Norre via B4 Relay
2026-10-28 11:48 ` [PATCH net v4 1/2] bonding: fix initial last_rx vs ARP-monitor slack window Ramses de Norre via B4 Relay
2026-10-30 2:59 ` Hangbin Liu
2026-10-30 11:50 ` netdev-bot+sashiko
2026-10-28 11:48 ` Ramses de Norre via B4 Relay [this message]
2026-10-30 11:50 ` [PATCH net v4 2/2] bonding: give a slave that starts UP a full arp_missed_max window netdev-bot+sashiko
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=20261028-bonding-last-rx-v4-2-4d8e4cd47467@well-founded.dev \
--to=devnull+ramses.well-founded.dev@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hangbin.liu@linux.dev \
--cc=jbohac@suse.cz \
--cc=jv@jvosburgh.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ramses@well-founded.dev \
--cc=razor@blackwall.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®