Article View: linux.kernel.netdev
Article #27481Re: [PATCH net-next v3 07/13] ipv6: make rt_genid_bump_ipv6() a plain counter increment
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 19:20
Date: Sat, 05 Dec 2026 19:20
76 lines
10445 bytes
10445 bytes
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
Technical Details
Message-ID:
<179649845771.3148.18160229809237331625@kernel.org>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378105-linux-kernel-netdev=dewy.ruReferences:
<20261201174021.7211-8-dsahern@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378105-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v3 07/13] ipv6: make rt_genid_bump_ipv6() a plain counter increment Date: Sat, 05 Dec 2026 19:20:57 +0000 Organization: Usenet Network Message-ID: <179649845771.3148.18160229809237331625@kernel.org> References: <20261201174021.7211-8-dsahern@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3103439"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:36/8yelg+zYWemVHb8/mtCBTAaY= sha256:sJ3Snti6DfR6WZDOlrZZ18+trlc8kJymbXMiArdbSyg= sha1:mpXEpMpSdpixCtV42s0V17qReyQ= sha256:JF8jvdlBu7VBxuv5uad3+OFfhOpaOB+zOG28FVgmu4A= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id E768D117E9C; Sat, 5 Dec 2026 22:21:25 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.539 X-Spam-Status: No, score=-3.539 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.14, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O7uvTjoTuAYs; Sat, 5 Dec 2026 22:21:23 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378105-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id C5B1C117E97; Sat, 5 Dec 2026 22:21:14 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 3BC72324B1; Sat, 5 Dec 2026 19:21:00 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796498459; b=AaJ1oAoujKWMIK2ywl26LNlJ8nk6H1X2biMHBF6Ie4IQDVm2GfiWRLntiXLslE4rBBED ZLY5lvw2efNMJroAvEJr/XzoYt8rS+qrWwWK2qKv82CekcvjXLKjT2jEHIOtPNfgv1lP8 tc3Gw1VjbrhEFwHiXijdu061W6TXJy5y/LMZgFS739Qa2P3bQlh26SLuKq37i0EsElQWl 3MKGYqC5AizeEWN0cy/hUxQbXfR5tT6lDl4DbQyOqvij9IaMv1oC9RxyGoXj7fAvbeAMz Ovjqp1pOU0AU5+pO9fdSfjdiWKPRiNSwF1WAT4YnLWpWfXLcdIOJEb8Nwy1LaRpPCaQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796498459; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=gzTe9IxVzEKBskl+5L6PzWkejAIVpuHmpSmH2p2Df6A=; b=mCOx1JowFm4VxpeRTuHPF9pqGuyKdhopuTuvaNInbkfmw8hd4rbDiW5jM+Ngy5PRQj05 1/vhamSGf/EBQmwv9D7MgYx4w1fdHeiRtMWtbECIrPTMGLAq/D6yT6rfPr1ImngcweV/q JloPSCHtrXZPu88Ea08a+nVazBHxdCKCKi4eqWy9EVhCJ3sAKvTT1DjAxtIWQqGNODI80 +PcC/PTa+4LBF0ZaJlX0smfPV/bsjpqBUu0J0IkJOX8sCSVZJiyfmZjnA2/u3h2e055eQ AKGHXkTWwnUlokhWTNS7Ihip8P82kSs2cmWvHMMzsjE8vA2TCZ2rGOwqhULln9RxnUw== X-ARC-Authentication-Results: i=2; 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=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3F63606A33A; Sat, 5 Dec 2026 19:20:59 +0000 (UTC) X-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 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-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== X-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== X-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 X-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 <netdev@vger.kernel.org>; Sat, 5 Dec 2026 19:20:58 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23F111F00936; Sat, 5 Dec 2026 19:20:58 +0000 (UTC) X-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== X-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 X-In-Reply-To: <20261201174021.7211-8-dsahern@kernel.org> X-sashiko-severity: Low X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list