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=1796498459; b=14astsM++OUcSE1xv32T2/LMRy9rL7GkZpsNTKFg8M3R5QzTtOnyJj+NgeZ5OfB2IlUs +zM2xeWcqQdZ3XfoyaqjgcYPX4NKlXEXRdFxmqVS4Roqx4ANzhyDtI2jOGXsxKbB4fYIH kJ1OtuyGo3v1naCJhN9l/eZtPri+DSOFUuGP682uK7vqVB71aqlFAsp9kxhnaSuCQwKiD ZlXYN1yrC4/aH5gdO2LEpAr3KWurE8LhEew2/NiWrLhYXzgWk/IPNUbimYxDin2UWcI7t kyO6qXJmKXLEWaBHAFQ6H5Yt0qlTEWzbTpWvE9Xcxgb3muCbhOPKHVhmqUYoS5h61wA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796498459; 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=gzTe9IxVzEKBskl+5L6PzWkejAIVpuHmpSmH2p2Df6A=; b=miX9pVacA5tmK3oI7QsNb7/6XWigt0nUh3BARPemi5xuTvuAd6SV9Yu7iqiWPnD0oeAP XqWZJD1gayqxDQrwQxsS0x/i5BBUcuelsaNHBY3/ql9zYSluoPUJi4Jd2FmFbRJU+69cs 0W8JY2vt9y79D4ke/SMyw04UnHcTM7rp8id9HKKStFmZ9pOQP21kIr7+pl3OFDn8/n+6/ EWQZ08uDfT8Ct6+oq8eWwkpZG4Y0PWuCYCg27MvEH0PV7vWrzueQzWI1NztWSK6vCW133 qrO8IdNyWK0EViileIFqQWtqkjzbjMPKS/jDNJFle8i0Qw0yK+ifPs0C3l+Eh4dddig== 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=UAVYSIXv; 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 E71EA606A322 for ; Sat, 5 Dec 2026 19:20:58 +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=UAVYSIXv Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23F111F00936; Sat, 5 Dec 2026 19:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796498458; bh=gzTe9IxVzEKBskl+5L6PzWkejAIVpuHmpSmH2p2Df6A=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=UAVYSIXvsBfoGbVdZx3f3hgzdCbwMOnIAmUwCXyglKgawjJr++nxgbrwtd8optxvx 2ioObvhrqFceADnQYIply/YFxQRHYYuiCjWRd5L0sKGdnxewH/WoivfrPg87h+eMK+ Ahqxzx3D3j2YNWy+G8sDW/LwQ5oroUdjR6h0ra97vvg7ZmjaRoNH7DXkmFzNOnYk88 VKbaGKuSc90r8Jtu83oL7oh3AoicfSJF7ynXn/nOiB7fLIj+Syw3HOqx/zfCqbrHQN dGPp/K30xTf0IF39EfdmmLuOpeSSt7fd0kxtaPXTyxsUVu5vT951I0aWtXY70aOBx0 j8P6kFC3ns7gQ== Subject: Re: [PATCH net-next v3 07/13] ipv6: make rt_genid_bump_ipv6() a plain counter increment From: netdev-bot+sashiko@kernel.org To: dsahern@kernel.org Cc: netdev@vger.kernel.org, idosch@nvidia.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, ralf@mandelbit.com, ja@ssi.bg, dahern@nvidia.com, noreply@anthropic.com Date: Sat, 05 Dec 2026 19:20:57 +0000 Message-ID: <179649845771.3148.18160229809237331625@kernel.org> In-Reply-To: <20261201174021.7211-8-dsahern@kernel.org> References: <20261201174021.7211-8-dsahern@kernel.org> X-sashiko-severity: Low 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 more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] In include/net/net_namespace.h, this patch changes rt_genid_bump_ipv6() from void to int. -- ipv6: make rt_genid_bump_ipv6() a plain counter increment This patch replaces the fib6_flush_trees() walk behind rt_genid_bump_ipv6() with an increment of net->ipv6.fib6_sernum. The increment wraps to 1 so the value is never 0. It also drops the __fib6_flush_trees pointer and its export, fib6_new_sernum(), and the sernum handling in fib6_cleaner. > diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h > index 4a4d72080acdc..f39baf51bcc5d 100644 > --- a/include/net/net_namespace.h > +++ b/include/net/net_namespace.h > @@ -556,18 +556,30 @@ static inline int rt_genid_ipv6(const struct net *net) > { > return atomic_read(&net->ipv6.fib6_sernum); > } > -#endif > > -static inline void rt_genid_bump_ipv4(struct net *net) > +/* Invalidate every cached IPv6 dst in @net. Returns the new generation, > + * which is never 0. > + */ > +static inline int rt_genid_bump_ipv6(struct net *net) > { > - atomic_inc(&net->ipv4.rt_genid); > + int new, old = atomic_read(&net->ipv6.fib6_sernum); > + > + do { > + new = old < INT_MAX ? old + 1 : 1; > + } while (!atomic_try_cmpxchg(&net->ipv6.fib6_sernum, &old, new)); > + > + return new; > } > +#else > +static inline int rt_genid_bump_ipv6(struct net *net) > +{ > + return 0; > +} > +#endif [Severity: Low] This isn't a bug, but the new comment on rt_genid_bump_ipv6() says the return value is never 0. The !CONFIG_IPV6 stub added just below returns exactly 0. No current caller is affected. The callers that use the return value are fib6_update_sernum(), fib6_update_sernum_upto_root() and fib6_add() in net/ipv6/ip6_fib.c, which only builds with IPv6. Every other caller ignores the result: rt_genid_bump_all(), xfrm_policy.c, nexthop.c, addrconf.c and fib6_rules.c. The later patch in the series, "ipv6: stamp dsts with the generation sampled before the FIB lookup", adds rt_genid_ipv6_sample() but leaves this comment and the stub unchanged. Would it be clearer for the comment to say the non-zero guarantee holds only with CONFIG_IPV6? Another option is to have the stub return a non-zero value, so a future caller outside IPv6 can't rely on 0 meaning something. [ ... ] -- Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201174021.7211-1-dsahern%40kernel.org