Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: cpaasch@openai.com
Cc: David Ahern <dsahern@kernel.org>,
	Nikolay Aleksandrov <razor@blackwall.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: When removing nexthops, don't call synchronize_net if it is not necessary
Date: Sun, 17 Aug 2025 11:44:51 +0300	[thread overview]
Message-ID: <aKGWg7tmkEAC9Wu0@shredder> (raw)
In-Reply-To: <20250816-nexthop_dump-v2-2-491da3462118@openai.com>

On Sat, Aug 16, 2025 at 04:12:49PM -0700, Christoph Paasch via B4 Relay wrote:
> From: Christoph Paasch <cpaasch@openai.com>
> 
> When removing a nexthop, commit
> 90f33bffa382 ("nexthops: don't modify published nexthop groups") added a
> call to synchronize_rcu() (later changed to _net()) to make sure
> everyone sees the new nexthop-group before the rtnl-lock is released.
> 
> When one wants to delete a large number of groups and nexthops, it is
> fastest to first flush the groups (ip nexthop flush groups) and then
> flush the nexthops themselves (ip -6 nexthop flush). As that way the
> groups don't need to be rebalanced.
> 
> However, `ip -6 nexthop flush` will still take a long time if there is
> a very large number of nexthops because of the call to
> synchronize_net(). Now, if there are no more groups, there is no point
> in calling synchronize_net(). So, let's skip that entirely by checking
> if nh->grp_list is empty.

[...]

> Signed-off-by: Christoph Paasch <cpaasch@openai.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

  reply	other threads:[~2025-08-17  8:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-16 23:12 [PATCH net-next v2 0/2] net: Speedup some nexthop handling when having A LOT of nexthops Christoph Paasch via B4 Relay
2025-08-16 23:12 ` [PATCH net-next v2 1/2] net: Make nexthop-dumps scale linearly with the number " Christoph Paasch via B4 Relay
2025-08-17  8:42   ` Ido Schimmel
2025-08-17  9:40   ` Nikolay Aleksandrov
2025-08-18  9:54   ` Eric Dumazet
2025-08-16 23:12 ` [PATCH net-next v2 2/2] net: When removing nexthops, don't call synchronize_net if it is not necessary Christoph Paasch via B4 Relay
2025-08-17  8:44   ` Ido Schimmel [this message]
2025-08-17  9:40   ` Nikolay Aleksandrov
2025-08-18 10:02   ` Eric Dumazet
2025-08-18 13:33 ` [PATCH net-next v2 0/2] net: Speedup some nexthop handling when having A LOT of nexthops David Ahern
2025-08-20  1:00 ` patchwork-bot+netdevbpf

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=aKGWg7tmkEAC9Wu0@shredder \
    --to=idosch@idosch.org \
    --cc=cpaasch@openai.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --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