From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796471245; b=sEBxVUeinHV8p4IDVveirbOHCGpv7xp7Zfn6egFpy5Bq0S35s8FIRGNa0KAvGMXuHVl3 NtowAaCVMRSY8adZv0IiRBe4Tur5Ns+nXEjU/we7eKS1vhRuVLVqc9n1d4MW1C4eynX0T 2cwg+Ctj66NdHYtSE84uL2HMK0Ae6h4gsx7i40PyhduovMbs4wBFWGifIb7rGextL2P/O mrZ/JYSHFPm3yezscK1e4S/6Q5Gc4Vn1DCXZm1QiVMOGalWdYow3yM9KOwQGnQdVPtfAF 1faINBey4uWTEdkT9048LdEz0vpGR+G2SvQe/fOWBp9e5ESO3OtHz3m4/G82GwTEUDA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796471245; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=8O2/4ruNLaO8x9ERsO1UmXDhGDe34WMZDg8+OJHUgCo=; b=g7RHYBw2b1BoqUaAxTpQdcKTzRbcNtqgqqS5N4VcmxCHad9pcL9w+CPits5gEgzyaBHh y8+Y1udWFgU7AJQuHaNjY7ucWTx6+fFW3t0uB0x2iSG/mx7HkrytZLLJrjIBzB7oTp8p/ oTSxWDKrkh0nKkz+t0DgHvtZ5vqcXJr78uXgbJPy1J7hAgCNPoaKurc2CRucgPG+SScYb VtLvJQvyDuqT9+AfqfSKPjB8Ad6YtmZvlEIk36HRmvLZLTTil35rAz9cJj8BDJBe60Sas pP7mO+6LNWnMyY8kzlEcQTgc9KOEHzyPmsMBpC9VUwAnt2xzi3lpoEtBkqtAoPFEnUw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nADza0wm; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EBE4606A332; Sat, 5 Dec 2026 11:47:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=nADza0wm Received: by smtp.kernel.org (Postfix) with ESMTPSA id 650FD1F00936; Sat, 5 Dec 2026 11:47:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796471245; bh=8O2/4ruNLaO8x9ERsO1UmXDhGDe34WMZDg8+OJHUgCo=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=nADza0wmaKKJCuk4s1Amdivq8ocdTFEUC5pomd1u00KVR1XHEwOlRGJSbCeG5zamF xkmZ7QTO2JaeFXKQ7AvGsegwYoTUta6+ECWzhUhB9fKzNfDBwAgZCocMxH0l+Nrz9b Rl6puWXWaNnxE3EUKmXi3op4xZJuBCslx2IxW2wjAxh31IqBdvu5euz7Q/gY9ABIzt s+pCET9MIryvb0YT9K4q6SeT83xQmajE1uJRgWkQlWMY2ws+YZwjbEmM8QmO1l1yvN KqzKbUvN5yfe25MeiiLA5y705TitzWMYGGd9UqqnixOE2UbGmrVYiCdLsh+F9p/bGr WpBWc+OFCAe0g== Subject: Re: [PATCH net-next 2/2] ipv6: allocate the flush serial under each table's lock From: netdev-bot+sashiko@kernel.org To: ralf@mandelbit.com Cc: netdev@vger.kernel.org, dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, linux-kernel@vger.kernel.org, antonio@mandelbit.com Date: Sat, 05 Dec 2026 11:47:23 +0000 Message-ID: <179647124393.3146.12155290401829441082@kernel.org> In-Reply-To: <97a514831d146250ac95222f55ee5a9334b624d1.1796382778.git.ralf@mandelbit.com> References: <97a514831d146250ac95222f55ee5a9334b624d1.1796382778.git.ralf@mandelbit.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] ipv6: __fib6_clean_all() bumps fib6_sernum per table, thrashing nexthop dsts -- > diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c > --- a/net/ipv6/ip6_fib.c > +++ b/net/ipv6/ip6_fib.c > @@ -2344,8 +2347,10 @@ static void __fib6_clean_all(struct net *net, > head = &net->ipv6.fib_table_hash[h]; > hlist_for_each_entry_rcu(table, head, tb6_hlist) { > spin_lock_bh(&table->tb6_lock); > - fib6_clean_tree(net, &table->tb6_root, > - func, sernum, arg, skip_notify); > + if (sernum == FIB6_NEW_SERNUM) > + table_sn = fib6_new_sernum(net); > + fib6_clean_tree(net, &table->tb6_root, func, > + table_sn, arg, skip_notify); > spin_unlock_bh(&table->tb6_lock); > } > } [Severity: Medium] This now advances net->ipv6.fib6_sernum once per table in fib_table_hash, where before it advanced once per flush. That counter is not only used for node stamps. rt_genid_ipv6() returns it directly, and nexthop-backed routes (f6i->nh != NULL) record it in pcpu_rt->sernum in ip6_rt_pcpu_alloc(). rt6_is_valid() then checks it with exact equality. So a single fib6_flush_trees() call can now invalidate every nexthop-backed dst up to T times, with a full fib6_clean_tree() walk between each bump. A CPU that hits rt6_get_pcpu_route() during the flush can drop its pcpu_rt with dst_dev_put() and dst_release(), then reallocate it in rt6_make_pcpu_route(). That new dst goes stale again as soon as the walk moves on to the next table. Likewise, ip6_dst_check() keeps failing for connected sockets for the whole flush. fib6_link_table() never unlinks tables, so empty tables in a VRF or policy routing setup add to the count for the lifetime of the netns. On a default setup with only main and local this is minor. With many tables, though, one global invalidation turns into many. rt_genid_bump_ipv6() is called from addrconf, fib rules, nexthop replace and xfrm, so routine control plane events reach this path. Could the per-table allocation be skipped for tables that have nothing to stamp? Alternatively, fib6_flush_trees() could keep a single serial and have fib6_clean_node() leave alone nodes that already carry a newer one, once the age comparison lands later in the series. Either way, it would be good to mention the effect on nexthop dsts in the changelog. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1796382778.git.ralf%40mandelbit.com