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=1796498456; b=bfqByNPsZ5HHZtgre4YkEDYGPBl9CkNfejyKo5zhfaS1WrNBA2CTJ3ZKd0krOpqOBHQo Rsfac+xvXoQM1p7DPPFY3YRAJwcxVQ0qJS8rQu3eibBTiy0slGMyBvDhDVGM9lc9OrdcW Kaa4wLkf2zPR6J4+Nwow2684YcEj1sCvu8R6iztX4+ti8i64XrFv9JB90+M6kl/MCpSDv 9icazlq9kpu1Uy06SScXRGuv4RC5fxcCCSK81a1THCKiwXLTeEVaYihXz1xNTtYxxIM02 0gyUQiKSVVFVVL9/AwkXnCwOEXWbZAeKL2R7+bePf/I5m1cofIwW3v7BUgFwLBD+YPw== 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== 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 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 ; Sat, 5 Dec 2026 19:20:56 +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=JjZVwysk Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93F9A1F00A11; Sat, 5 Dec 2026 19:20:55 +0000 (UTC) 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== Subject: Re: [PATCH net-next v3 05/13] ipv6: tell route dumps about exception inserts with a table sequence 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:55 +0000 Message-ID: <179649845514.3148.1069693018519451695@kernel.org> In-Reply-To: <20261201174021.7211-6-dsahern@kernel.org> References: <20261201174021.7211-6-dsahern@kernel.org> 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 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