🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27479

Re: [PATCH net-next v3 05/13] ipv6: tell route dumps about exception inserts with a table sequence

#27479
From: netdev-bot+sashiko
Date: Sat, 05 Dec 2026 19:20
171 lines
14556 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 1

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] The patch says it corrects the comment in
  rt6_nh_dump_exceptions() (net/ipv6/route.c), but the rewritten comment…
- [Low] The new comment on fib6_update_excp_seq() (net/ipv6/ip6_fib.c)
  says "A dump notices a changed tree through the root node, so only an…

--

ipv6: tell route dumps about exception inserts with a table sequence

This adds a per-table tb6_excp_seq. rt6_insert_exception() bumps it under
tb6_lock when the exception is inserted on the root node, and
fib6_dump_table() restarts a resumed dump when either the root's
fn_sernum or tb6_excp_seq has changed. The patch also rewrites the
comment in rt6_nh_dump_exceptions() about which exception changes a
dump notices.

> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> index e1d49897d6ab0..4da83c22bbde8 100644
> --- a/net/ipv6/ip6_fib.c
> +++ b/net/ipv6/ip6_fib.c
> @@ -148,6 +148,25 @@ void fib6_update_sernum(struct net *net, struct fib6_info *f6i)
>  		WRITE_ONCE(fn->fn_sernum, fib6_new_sernum(net));
>  }
>  
> +/* Tell route dumps that an exception was added under @f6i. A dump notices
> + * a changed tree through the root node, so only an exception on the root
> + * needs to be visible. Use a table sequence for that, rather than a fresh
> + * fn_sernum, so that it does not depend on what else a change to fn_sernum
> + * does: fresh values can only come from the netns counter, and a made-up
> + * one could later be issued by the counter to the same node.
> + * Caller holds tb6_lock.
> + */
> +void fib6_update_excp_seq(struct fib6_info *f6i)
> +{
> +	struct fib6_table *table = f6i->fib6_table;
> +	struct fib6_node *fn;
> +
> +	fn = rcu_dereference_protected(f6i->fib6_node,
> +				       lockdep_is_held(&table->tb6_lock));
> +	if (fn == &table->tb6_root)
> +		WRITE_ONCE(table->tb6_excp_seq, table->tb6_excp_seq + 1);
> +}

[Severity: Low]
This isn't a bug, but does this comment contradict the one this patch
adds to rt6_nh_dump_exceptions()?

This comment says only an exception on the root "needs to be visible".
The rt6_nh_dump_exceptions() comment says a change under any other node
"is not noticed: a dump suspended in the middle of that route's
exceptions can skip or repeat some of them."

tb6_excp_seq is table-wide, so fib6_dump_table() would also notice a bump
for a non-root exception. Limiting the bump to fn == &table->tb6_root
looks like a way to keep the old behaviour. It does not seem to be
enough for dump consistency.

Could the wording say this, so a later reader doesn't assume root-only
signalling is complete? The wording also looks unchanged at the end of
the series.

[ ... ]

> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 5af0f26332ffa..836bd7aa05cd7 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c

[ ... ]

> @@ -6125,11 +6126,15 @@ static int rt6_nh_dump_exceptions(struct fib6_nh *nh, void *arg)
>  				continue;
>  			}
>  
> -			/* Expiration of entries doesn't bump sernum, insertion
> -			 * does. Removal is triggered by insertion, so we can
> -			 * rely on the fact that if entries change between two
> -			 * partial dumps, this node is scanned again completely,
> -			 * see rt6_insert_exception() and fib6_dump_table().
> +			/* Expiration of entries doesn't bump anything. An
> +			 * insertion on the root node changes the root's
> +			 * fn_sernum or tb6_excp_seq, and removal is triggered
> +			 * by insertion, so if entries of the root change
> +			 * between two partial dumps, the table is scanned
> +			 * again, see rt6_insert_exception() and
> +			 * fib6_dump_table(). A change under any other node is
> +			 * not noticed: a dump suspended in the middle of that
> +			 * route's exceptions can skip or repeat some of them.
>  			 *
>  			 * Count expired entries we go through as handled
>  			 * entries that we'll skip next time, in case of partial

[Severity: Medium]
The commit message says this corrects the comment. Is the part saying
"removal is triggered by insertion" still accurate?

Only two rt6_remove_exception() calls run under rt6_insert_exception().
One is the eviction in rt6_exception_remove_oldest(), the other replaces
a matching entry. rt6_insert_exception() is also the only caller of
fib6_update_excp_seq().

The other removals change neither the root's fn_sernum nor
tb6_excp_seq:

  fib6_nh_remove_exception(), reached via rt6_remove_exception_rt() on
  RTM_DELROUTE of a cached route, on negative advice and on link failure
  fib6_nh_exceptions_clean_tohost()
  fib6_nh_flush_exceptions()
  rt6_age_examine_exception(), called from GC

net/ipv6/route.c:rt6_age_examine_exception() {
    ...
		if (time_after_eq(now, READ_ONCE(rt->dst.lastuse) +
				       gc_args->timeout)) {
			pr_debug("aging clone %p\n", rt);
			rt6_remove_exception(bucket, rt6_ex);
			return;
		}
	} else if (time_after(jiffies, READ_ONCE(rt->dst.expires))) {
		pr_debug("purging expired route %p\n", rt);
		rt6_remove_exception(bucket, rt6_ex);
		return;
	}
    ...
}

GC removes more than expired entries. It also removes aged
non-RTF_EXPIRES clones and gateway exceptions whose gateway is not a
router.

Say a dump is suspended part-way through the root route's exceptions
with skip_in_node = k. One of the entries already sent is then removed
by one of these paths. On resume, fib6_dump_table() sees the same values:

	if (cb->args[5] != sernum || w->excp_seq != excp_seq) {

So there is no restart, and rt6_nh_dump_exceptions() applies the stale
skip count to the shorter chain:

			if (w->skip) {
				w->skip--;
				continue;
			}

Wouldn't that drop a valid exception that was never sent, without
setting NLM_F_DUMP_INTR?

The skipping itself is older than this patch. The rewritten comment,
though, repeats the inaccurate premise.

The comment is also inaccurate for insertions. With nexthop objects, an
exception can be inserted through a non-root route that shares the
nexthop's fib6_nh. That changes the root route's dumped exceptions, and
neither fn_sernum nor tb6_excp_seq is bumped.

This comment also appears unchanged at the end of the series.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201174021.7211-1-dsahern%40kernel.org
Technical Details
Message-ID: <179649845514.3148.1069693018519451695@kernel.org>
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378103-linux-kernel-netdev=dewy.ru
References: <20261201174021.7211-6-dsahern@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-378103-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v3 05/13] ipv6: tell route dumps about exception
 inserts with a table sequence
Date: Sat, 05 Dec 2026 19:20:55 +0000
Organization: Usenet Network
Message-ID: <179649845514.3148.1069693018519451695@kernel.org>
References: <20261201174021.7211-6-dsahern@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3103326"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:7YqYALsxS/VY3ytp8xiXO5WfK7c= sha256:wdW6CiNJRN1/JfvxpscaNgo0E/Dg2Lt3u42fX1bCZaQ=
	sha1:hVhBny3Kiy08vWNtBd1l3JAoKvE= sha256:8tNntHoD1u+GCoXh5KWFj/CybSW2lkQdaeMCHuYH2tQ=
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 B89FF117E92; Sat,  5 Dec 2026 22:21:16 +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 PaPhAl0MBr32;
	Sat,  5 Dec 2026 22:21:14 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-378103-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 996F9117E96; Sat,  5 Dec 2026 22:21:05 +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 65B24321EA; Sat,  5 Dec 2026 19:20:57 +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=1796498457;
	b=hlIuLDCxbSO3NUOzqa1pUiNDPjJhbECYAlGaymAImkK5twHEVEG3TcBPn0DmoWzdlPyP
	 lwi/CebLA29xqJmXXWPg1EkF1DiuIE6ehAeQz4v3mUc49DXUr2oz75LLMifSZ93FBoGIO
	 CbQiPARzi5TDXQ1RWM79zCVaf/0/yyGoN7qzDBcfB3nmi4CSQkr8d2dskMdpAzWw2DGDY
	 QbpRXJ7XwglaRW9gjqilxAvp/FhWRdZBzhoHMZmgoOBMHm6HcntA4R2KBc1cDjo9Bl/++
	 5KYxX36/8m72/B82elokBhZxGY6ORIQsg270gYKpJmBjKAuGLtoaAzEWQrIIQgOz+RQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796498457;
	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=aH2YOvhmYc8RXCzNhU6b/4Cr4n1VF0Dsd7KIsAsnzoc=;
	b=P4BF+acvpMDMsfl48wDJG4Zu4tiIVTXNQyMw+cVl7SaKIiSyI+EzEhnZlumpLO4e332c
	 wC8yuIKWNoQYL0+j1mHTX1OokiaM6s/p7zHwuTkv2Hk3d+BFIxMDopNo9ZIZHFKVsH2Nd
	 vPKBxHCLqnpfrM8ToIcikOAOSqTP1oDnuLCSKdzoB3fIpZ0EBksxaY09FOeMafve/pHTA
	 hIAvEyiuDefie1+kzz5T4d5bC9N22o7iC1kKjQOvZsfvE9/vHZnRa1Jd1NabxaOmJiCeC
	 XJZktQFC4m7OWmuIHl9K/f7718UmV5GsVXUoqJmEqnYKraPtNOB4B76mH2y44CZIEPw==
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=JjZVwysk;
	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 3DB4E606A337;
	Sat,  5 Dec 2026 19:20:57 +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=JjZVwysk
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=1796498456;
	b=bfqByNPsZ5HHZtgre4YkEDYGPBl9CkNfejyKo5zhfaS1WrNBA2CTJ3ZKd0krOpqOBHQo
	 Rsfac+xvXoQM1p7DPPFY3YRAJwcxVQ0qJS8rQu3eibBTiy0slGMyBvDhDVGM9lc9OrdcW
	 Kaa4wLkf2zPR6J4+Nwow2684YcEj1sCvu8R6iztX4+ti8i64XrFv9JB90+M6kl/MCpSDv
	 9icazlq9kpu1Uy06SScXRGuv4RC5fxcCCSK81a1THCKiwXLTeEVaYihXz1xNTtYxxIM02
	 0gyUQiKSVVFVVL9/AwkXnCwOEXWbZAeKL2R7+bePf/I5m1cofIwW3v7BUgFwLBD+YPw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796498456;
	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=aH2YOvhmYc8RXCzNhU6b/4Cr4n1VF0Dsd7KIsAsnzoc=;
	b=4X4QWS7V2kNAFdKnLIt/R+UfVsh0Bk21QdRBvKceO3EV3Mc71nH4FFYEfb4SwrUxz3Sz
	 oNESJ9PCZu7+z8tLFH+0Ta9khpzxKQfKlK+tGDTu6hmZAAX14K1a/8sdaJkjrKNyGGt4I
	 MTwq6866Zl/uQ+GeqrJw605TjRwUxshVji659/gTp/LSJm9SNUShLaMnh/nf4jAA0Oh4g
	 pLsNCZ+IS5/87RoXW2pyYnj0rh+n5WeyMd6yIheIqI2sHB1IdYICQSqs0F9v6YFOuWpkk
	 9wyxwcCUPzZKY/zb+eFi2d2xwjZ27dEh/ssB4MnRLj/vPH9JNUhvDLyqmol9fTGa5XQ==
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=JjZVwysk;
	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 5E6BD606A322
	for <netdev@vger.kernel.org>; Sat,  5 Dec 2026 19:20:56 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93F9A1F00A11;
	Sat,  5 Dec 2026 19:20:55 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796498456;
	bh=aH2YOvhmYc8RXCzNhU6b/4Cr4n1VF0Dsd7KIsAsnzoc=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=JjZVwyskiEcw0oyA7J/BtKjTBY+RK5LtkTCTJfm4RZr9+LPWSewcWAI86IN6zn0ti
	 P9TqxAht/8cn/RioBJrZTjb5xzuOFJrCa9y2krhq8+o86vdgY+8abNKQIXR+oz6ma7
	 57zgCZpURuM3Z9M+ErzvQi0xQ34dgUikG1TJepMqkJ6H/9t28QInUUHXAq0izkuEbD
	 2kfuGolLsCCFuzipfiV2RfkkxE2Ce8K8j4M7zZBXDODl8rEVgbr3wJpkDD96+2F2rW
	 nWodA/3/NrTwdgpgVaFySWJ4WpA/xcosjSmSMH39dPckXFUgt8OrE3Uwd9CdvW4d0Z
	 4YCl8Ho+xA93g==
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-6-dsahern@kernel.org>
X-sashiko-severity: Medium
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