Netdev List
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Jay Vosburgh <jv@jvosburgh.net>
Cc: Simon Horman <horms@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	Tonghao Zhang <tonghao@bamaicloud.com>,
	Hangbin Liu <liuhangbin@gmail.com>
Subject: Re: [PATCH net] bonding: avoid ARP flood on RTNL contention in active-backup mode
Date: Tue, 1 Sep 2026 13:32:54 +0200	[thread overview]
Message-ID: <06d2e605-6d3d-40f0-b247-031756c0d752@redhat.com> (raw)
In-Reply-To: <20260831090937.3342052-1-edumazet@google.com>

On 8/31/26 11:09 AM, Eric Dumazet wrote:
> 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;

Sashiko noted this should cause a regression, with notifications
potentially delayed for an unbounded time:

https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260831090937.3342052-1-edumazet%40google.com

That was also the behavior prior to f1986b3a9f2e, so I guess is 
a reasonable trade-off, but a 2nd opinion would help :)

/P


  parent reply	other threads:[~2026-09-01 11:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-09-01 23:44   ` Jay Vosburgh

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=06d2e605-6d3d-40f0-b247-031756c0d752@redhat.com \
    --to=pabeni@redhat.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=tonghao@bamaicloud.com \
    /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