Netdev List
 help / color / mirror / Atom feed
* [PATCH net] bonding: avoid ARP flood on RTNL contention in active-backup mode
@ 2026-08-31  9:09 Eric Dumazet
  2026-09-01 10:06 ` Hangbin Liu
  2026-09-01 11:32 ` Paolo Abeni
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2026-08-31  9:09 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Andrew Lunn, netdev, eric.dumazet, Eric Dumazet,
	Tonghao Zhang, Hangbin Liu, Jay Vosburgh

Commit f1986b3a9f2e ("net: bonding: skip the 2nd trylock when first one
fail") changed bond_activebackup_arp_mon() to reschedule arp_work in
1 tick if the second rtnl_trylock() fails (for sending peer/slave
notifications).

However, by the time bond_activebackup_arp_mon() reaches this second lock
check, bond_ab_arp_probe() has already been executed and sent an ARP probe.
If RTNL remains contended, rescheduling every 1 tick causes
bond_activebackup_arp_mon() to re-execute bond_ab_arp_probe() every jiffy,
flooding the network with ARP probes at HZ frequency (e.g. 1000 pkts/sec)
instead of respecting the configured arp_interval.

If rtnl_trylock() fails at the second check, do not change delta_in_ticks
to 1 so that the next ARP monitor execution is scheduled according to the
configured arp_interval, matching the behavior in
bond_loadbalance_arp_mon().

Fixes: f1986b3a9f2e ("net: bonding: skip the 2nd trylock when first one fail")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
Cc: Tonghao Zhang <tonghao@bamaicloud.com>
Cc: Hangbin Liu <liuhangbin@gmail.com>
Cc: Jay Vosburgh <jv@jvosburgh.net>
---
 drivers/net/bonding/bond_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ef9eb0c53c66..c23cf18a996a 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3871,10 +3871,8 @@ static void bond_activebackup_arp_mon(struct bonding *bond)
 	rcu_read_unlock();
 
 	if (READ_ONCE(bond->send_peer_notif) || should_notify_rtnl) {
-		if (!rtnl_trylock()) {
-			delta_in_ticks = 1;
+		if (!rtnl_trylock())
 			goto re_arm;
-		}
 
 		if (bond->send_peer_notif)
 			bond_peer_notify_may_events(bond, true);
-- 
2.55.0.897.gb25b4bd76c-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-01 23:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31  9:09 [PATCH net] bonding: avoid ARP flood on RTNL contention in active-backup mode Eric Dumazet
2026-09-01 10:06 ` Hangbin Liu
2026-09-01 11:32 ` Paolo Abeni
2026-09-01 23:44   ` Jay Vosburgh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox