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
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 [thread overview]
Message-ID: <179649845514.3148.1069693018519451695@kernel.org> (raw)
In-Reply-To: <20261201174021.7211-6-dsahern@kernel.org>
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
next prev parent reply other threads:[~2026-12-05 19:20 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 17:40 [PATCH net-next v3 00/13] ipv6: validate cached dsts against the netns route generation David Ahern
2026-12-01 17:40 ` [PATCH net-next v3 01/13] ipv6: allocate the exception entry before removing the one it replaces David Ahern
2026-12-02 16:02 ` Ido Schimmel
2026-12-01 17:40 ` [PATCH net-next v3 02/13] ipv6: keep a superseded pcpu dst working until its holders notice David Ahern
2026-12-02 16:19 ` Ido Schimmel
2026-12-05 19:20 ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 03/13] ipv6: don't insert a PMTU exception whose MTU could not be stored David Ahern
2026-12-05 19:20 ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 04/13] ipv6: invalidate the failing dst in ip6_link_failure() David Ahern
2026-12-05 19:20 ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 05/13] ipv6: tell route dumps about exception inserts with a table sequence David Ahern
2026-12-05 19:20 ` netdev-bot+sashiko [this message]
2026-12-01 17:40 ` [PATCH net-next v3 06/13] ipv6: validate dsts against the netns route generation David Ahern
2026-12-05 19:20 ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 07/13] ipv6: make rt_genid_bump_ipv6() a plain counter increment David Ahern
2026-12-05 19:20 ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 08/13] nexthop: factor out nh_has_f6i() David Ahern
2026-12-01 17:40 ` [PATCH net-next v3 09/13] nexthop: bump the IPv6 route generation on group changes David Ahern
2026-12-05 19:20 ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 10/13] ipv6: stamp dsts with the generation sampled before the FIB lookup David Ahern
2026-12-05 19:21 ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 11/13] selftests: net: pmtu: check that a deleted cached exception stays deleted David Ahern
2026-12-01 17:40 ` [PATCH net-next v3 12/13] selftests: net: fib_tests: Add stale pcpu test David Ahern
2026-12-05 19:21 ` netdev-bot+sashiko
2026-12-01 17:40 ` [PATCH net-next v3 13/13] selftests: net: ipvs: check a PMTU learned after the DR route was cached David Ahern
2026-12-05 19:21 ` netdev-bot+sashiko
2026-12-01 17:43 ` [PATCH net-next v3 00/13] ipv6: validate cached dsts against the netns route generation netdev-bot+sinfo
2026-12-02 9:45 ` Ralf Lici
2026-12-03 15:34 ` Ido Schimmel
2026-12-03 16:55 ` Ralf Lici
2026-12-03 17:16 ` Ido Schimmel
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=179649845514.3148.1069693018519451695@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=dahern@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=ja@ssi.bg \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=noreply@anthropic.com \
--cc=pabeni@redhat.com \
--cc=ralf@mandelbit.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.