On Thu, 03 Dec 2026 17:34:47 +0200, Ido Schimmel <idos…@nvidia.com> wrote:
> So, I think Ralf's v5 [1] is a better approach and also easier to
> review: Keep the per-node validation for inline nexthops and per-netns
> validation for nexthop objects.
>
Thanks Ido for the review, and thanks David. I'll respin my series with
your comments addressed.
> A few comments on his series:
>
> 1. "ipv6: stamp the default route node with a fresh serial on link
> failure" is not strictly related to the other patches and should be
> submitted separately and without a Fixes: tag given this is not a
> regression.
Will do, ahead of the series, since the ordered comparison below relies
on node serials never going backwards. I'll also drop 2/4, which was
merged in net in the meantime.
>
> 2. Invalidating live per-CPU dst entries by calling dst_dev_put()
> introduces the same problem that was fixed in IPv4 by commit
> 5018c59607a5 ("ipv4: fix race condition between route lookup and
> invalidation") and commit ae89f2724db1 ("ipv4: route: don't blackhole
> in-use routes when retiring fnhe routes").
>
> Better to move these dst entries to the uncached list, which requires
> handling [2] first.
>
Agreed. I tried putting replaced pcpu dsts on the uncached list before
posting v5 and dropped it because of the ownership problem you describe
in [2]. I'll start the series with the change you suggest there, basing
the ownership on RT6_LOOKUP_F_DST_NOREF.
> 3. In patch 3, stamping a dst entry with 0 due to a mismatch in the
> per-netns counter is too coarse. Any FIB change in the netns (e.g., a
> route inserted into a different table) causes the lookup to replace a
> valid per-CPU dst entry whose route did not change.
>
> We can sample the per-netns counter before the lookup and use it to
> stamp new dst entries. A dst entry is then valid as long as its serial
> number is equal or newer than the node's serial number, and the per-CPU
> dst entry is only replaced when it is no longer valid. This also avoids
> the second read of the counter.
>
Agreed. I considered stamping with the generation sampled before the
lookup in the RFC [3], but validated by equality to avoid a wrap-aware
comparison. The ordered comparison is simpler.
[3] https://lore.kernel.org/netdev/2026…@mandelbit.com/
Thanks!
--
Ralf Lici
Mandelbit Srl