All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ralf Lici <ralf@mandelbit.com>
To: Ido Schimmel <idosch@nvidia.com>
Cc: David Ahern <dsahern@kernel.org>,
	netdev@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, ja@ssi.bg
Subject: Re: [PATCH net-next v3 00/13] ipv6: validate cached dsts against the netns route generation
Date: Thu,  3 Dec 2026 17:55:28 +0100	[thread overview]
Message-ID: <20261203165528.848776-1-ralf@mandelbit.com> (raw)
In-Reply-To: <20261203153447.GA3201592@shredder>

On Thu, 03 Dec 2026 17:34:47 +0200, Ido Schimmel <idosch@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/20260901122501.482920-1-ralf@mandelbit.com/

Thanks!

-- 
Ralf Lici
Mandelbit Srl

  reply	other threads:[~2026-12-03 16:55 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
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 [this message]
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=20261203165528.848776-1-ralf@mandelbit.com \
    --to=ralf@mandelbit.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=pabeni@redhat.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.