IPv6 counterpart of commit 7d3f3b4367f3 ("net: ipv4: Cache pmtu for
all packet paths if multipath enabled"), a production issue, flows
blackholing behind two ECMP uplinks; the IPv6 side was deferred back
then [1]. The IPv4 part of v4 went separately [2].
Patch 1 caches a Packet Too Big on every path of a multipath route,
patch 2 adds the IPv6 variant of the pmtu.sh multipath test and one
with paths of different MTU. Both fail without patch 1.
v5, after the review of v4 by Ido:
- the paths are walked for every caller, as for IPv4; v4 kept the walk
to ip6_update_pmtu() so that a tunnel's mtu, pushed on its own dst,
would not land on the other paths of the inner route, IPv4 lets it
- the looked-up dst is checked as before, a Packet Too Big at or above
its mtu ends the update
- a blackhole fib6_nh is skipped inside the walk, from the Sashiko
review of v4: a replace between nexthop_is_blackhole() and the walk
could land an exception on it
- the IPv4 patch and its test went separately [2]
v4: https://lore.kernel.org/netdev/2026…@verdict.gg/
v4, after the Sashiko review of v3:
- ipv4: each path checks the mtu for itself, the early returns on the
dst are skipped when it was looked up for the Fragmentation Needed;
a locked mtu goes no higher than what a path uses, a path with a
locked pmtu is left alone
- ipv6: walk the paths only from ip6_update_pmtu(), where dst comes
from a lookup; sockets and tunnels update their own dst as before,
a tunnel mtu no longer lands on the other paths of the inner route
- ipv6: skip a blackhole nexthop and siblings not in the tree
- tests: ping with ICMP sockets, a raw socket handles a Packet Too Big
a second time and could pass the IPv6 tests without the fix
- tests: the IPv6 addresses on lo are added with nodad, the pings
through R2 are 1280 bytes to stay below the 1350 link
v3: https://lore.kernel.org/netdev/2026…@verdict.gg/
v3, after the Sashiko review of v2:
- compare the mtu with what each path uses now, not once with the
looked-up dst, so no path gets a pmtu above what it can carry
- ipv6: keep updating a cached dst itself, the walk may not find it
- ipv4: Fixes: tag, Fragmentation Needed wording
- tests: MTU 1350 on the link to R2, so a Packet Too Big from R1 must
not be cached on the path via R2
- tests: return routes on R1 and R2, hex flow labels, skip when
"ip route get" has no flowlabel
v2: https://lore.kernel.org/netdev/2026…@verdict.gg/
v2, after the Sashiko review of v1:
- update an existing exception in place, on every Packet Too Big
- don't walk the siblings of a fib6_info no longer in the tree
- commit message: the lookup in ip6_update_pmtu() hashes without
protocol and ports
- new ipv4 patch, tests with paths of different MTU
v1: https://lore.kernel.org/netdev/2026…@verdict.gg/
[1] https://lore.kernel.org/netdev/ad29…@kernel.org/
[2] https://lore.kernel.org/netdev/2026…@verdict.gg/
Vladimir Vdovin (2):
ipv6: Cache pmtu for all paths of a multipath route
selftests: net: pmtu: Add IPv6 multipath tests
net/ipv6/route.c | 122 ++++++++++----
tools/testing/selftests/net/pmtu.sh | 253 +++++++++++++++++++++-------
2 files changed, 281 insertions(+), 94 deletions(-)
base-commit: 41055751bb7b27c1317c679a9252baeebc4aa638
--
2.56.0