* [PATCH net-next 1/2] ipv4: Don't cache a pmtu above the device mtu of a path
2026-11-24 15:37 [PATCH net-next 0/2] ipv4: Don't cache a pmtu above the device mtu of a path Vladimir Vdovin
@ 2026-11-24 15:37 ` Vladimir Vdovin
2026-11-24 15:37 ` [PATCH net-next 2/2] selftests: net: pmtu: Add a multipath test with paths of different MTU Vladimir Vdovin
2026-11-24 15:44 ` [PATCH net-next 0/2] ipv4: Don't cache a pmtu above the device mtu of a path netdev-bot+sinfo
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Vdovin @ 2026-11-24 15:37 UTC (permalink / raw)
To: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, linux-kselftest, Vladimir Vdovin
The mtu of a Fragmentation Needed is cached on every path of a multipath
route, checked against the path the lookup picked only. A path whose
device mtu is below it gets a pmtu it can't carry: packets above the
device mtu pass the pmtu check and are dropped at the device, no ICMP
comes back, and the flows on that path blackhole until the exception
expires.
Skip such a path.
Suggested-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Vladimir Vdovin <deliran@verdict.gg>
---
net/ipv4/route.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index d0930ae4c5ae..0d992dc46c60 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1094,6 +1094,8 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
nhc = fib_info_nhc(res.fi, nhsel);
if (!nhc)
break;
+ if (mtu > READ_ONCE(nhc->nhc_dev->mtu))
+ continue;
update_or_create_fnhe(nhc, fl4->daddr, 0, mtu, lock,
jiffies + net->ipv4.ip_rt_mtu_expires);
}
--
2.56.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net-next 2/2] selftests: net: pmtu: Add a multipath test with paths of different MTU
2026-11-24 15:37 [PATCH net-next 0/2] ipv4: Don't cache a pmtu above the device mtu of a path Vladimir Vdovin
2026-11-24 15:37 ` [PATCH net-next 1/2] " Vladimir Vdovin
@ 2026-11-24 15:37 ` Vladimir Vdovin
2026-11-24 15:44 ` [PATCH net-next 0/2] ipv4: Don't cache a pmtu above the device mtu of a path netdev-bot+sinfo
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Vdovin @ 2026-11-24 15:37 UTC (permalink / raw)
To: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan
Cc: netdev, linux-kselftest, Vladimir Vdovin
Add pmtu_ipv4_mp_asym_exceptions: the topology of pmtu_ipv4_mp_exceptions
with an MTU of 1400 behind one router, and 1350 on the link to the other
router with 1300 behind it. Pick a flow through each router, a source
address as the IPv4 multipath hash covers addresses only by default, and
check that a Fragmentation Needed from the first router is cached on its
path only, as the second one can't carry 1400, then that a flow through
the second router lowers the PMTU of both paths.
Without the preceding patch the test fails with both legacy nexthops and
nexthop objects.
Signed-off-by: Vladimir Vdovin <deliran@verdict.gg>
---
tools/testing/selftests/net/pmtu.sh | 74 ++++++++++++++++++++++++++++-
1 file changed, 73 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
index c7cd271714ef..a5d602a453c9 100755
--- a/tools/testing/selftests/net/pmtu.sh
+++ b/tools/testing/selftests/net/pmtu.sh
@@ -203,6 +203,13 @@
# on host A and B on lo reachable via both routers. Host A and B
# addresses have multipath routes to each other, b_r1 mtu = 1500.
# Check that PMTU exceptions are created for both paths.
+#
+# - pmtu_ipv4_mp_asym_exceptions
+# Same topology as pmtu_ipv4_mp_exceptions, with b_r1 mtu = 1400,
+# a_r2 mtu = 1350 and b_r2 mtu = 1300. Pick a flow through each router
+# and check that a Fragmentation Needed from R1 creates a PMTU
+# exception on the path via R1 only, as the path via R2 can't carry
+# 1400, then that a flow through R2 lowers the PMTU of both paths
source lib.sh
@@ -272,7 +279,8 @@ tests="
list_flush_ipv6_exception ipv6: list and flush cached exceptions 1
pmtu_ipv4_route_change ipv4: PMTU exception w/route replace 1
pmtu_ipv6_route_change ipv6: PMTU exception w/route replace 1
- pmtu_ipv4_mp_exceptions ipv4: PMTU multipath nh exceptions 1"
+ pmtu_ipv4_mp_exceptions ipv4: PMTU multipath nh exceptions 1
+ pmtu_ipv4_mp_asym_exceptions ipv4: PMTU multipath exceptions, asym MTU 1"
# Addressing and routing for tests with routers: four network segments, with
# index SEGMENT between 1 and 4, a common prefix (PREFIX4 or PREFIX6) and an
@@ -350,6 +358,7 @@ tunnel6_b_addr="fd00:2::b"
tunnel6_mask="64"
host4_a_addr="192.168.99.99"
+host4_a_net="192.168.97"
host4_b_addr="192.168.88.88"
dummy6_0_prefix="fc00:1000::"
@@ -2407,6 +2416,69 @@ test_pmtu_ipv4_mp_exceptions() {
check_pmtu_value "1500" "${pmtu_a_R2}" "exceeding MTU (veth_A-R2)" || return 1
}
+# Pick a source address out of ${host4_a_net} for a flow from host A to
+# ${1} through ${2}: the IPv4 multipath hash covers addresses only by
+# default
+mp_flow_via() {
+ dst="${1}"
+ oif="${2}"
+
+ for i in $(seq 1 32); do
+ flow="${host4_a_net}.${i}"
+ ${ns_a} ip route get ${dst} from ${flow} |
+ grep -q " dev ${oif} " && echo "${flow}" && return
+ done
+
+ return 1
+}
+
+test_pmtu_ipv4_mp_asym_exceptions() {
+ setup namespaces routing multipath || return $ksft_skip
+
+ trace "${ns_a}" veth_A-R1 "${ns_r1}" veth_R1-A \
+ "${ns_r1}" veth_R1-B "${ns_b}" veth_B-R1 \
+ "${ns_a}" veth_A-R2 "${ns_r2}" veth_R2-A \
+ "${ns_r2}" veth_R2-B "${ns_b}" veth_B-R2
+
+ # Source addresses for mp_flow_via(), with routes back to them
+ run_cmd ${ns_a} ip route add local ${host4_a_net}.0/24 dev lo
+ run_cmd ${ns_r1} ip route add ${host4_a_net}.0/24 via ${prefix4}.${a_r1}.1
+ run_cmd ${ns_r2} ip route add ${host4_a_net}.0/24 via ${prefix4}.${a_r2}.1
+
+ # Set up initial MTU values: 1400 behind R1, 1350 to R2, 1300 behind R2
+ mtu "${ns_a}" veth_A-R1 2000
+ mtu "${ns_r1}" veth_R1-A 2000
+ mtu "${ns_r1}" veth_R1-B 1400
+ mtu "${ns_b}" veth_B-R1 1400
+
+ mtu "${ns_a}" veth_A-R2 1350
+ mtu "${ns_r2}" veth_R2-A 1350
+ mtu "${ns_r2}" veth_R2-B 1300
+ mtu "${ns_b}" veth_B-R2 1300
+
+ flow_r1="$(mp_flow_via ${host4_b_addr} veth_A-R1)" || {
+ err " no flow through veth_A-R1 found"; return 1; }
+ flow_r2="$(mp_flow_via ${host4_b_addr} veth_A-R2)" || {
+ err " no flow through veth_A-R2 found"; return 1; }
+
+ # A Fragmentation Needed from R1 is cached on the path via R1, not on
+ # the path via R2, whose link can't carry 1400
+ run_cmd ${ns_a} ping -I ${flow_r1} -q -M want -i 0.1 -c 1 -s 1800 "${host4_b_addr}"
+
+ pmtu_a_R1="$(route_get_dst_pmtu_from_exception "${ns_a}" "${host4_b_addr}" oif veth_A-R1)"
+ pmtu_a_R2="$(route_get_dst_pmtu_from_exception "${ns_a}" "${host4_b_addr}" oif veth_A-R2)"
+ check_pmtu_value "1400" "${pmtu_a_R1}" "exceeding MTU via R1 (veth_A-R1)" || return 1
+ check_pmtu_value "" "${pmtu_a_R2}" "exceeding MTU via R1 (veth_A-R2)" || return 1
+
+ # The lower MTU behind R2 lowers the PMTU of both paths
+ run_cmd ${ns_a} ping -I ${flow_r2} -q -M want -i 0.1 -c 1 -s 1280 "${host4_b_addr}"
+
+ pmtu_a_R1="$(route_get_dst_pmtu_from_exception "${ns_a}" "${host4_b_addr}" oif veth_A-R1)"
+ pmtu_a_R2="$(route_get_dst_pmtu_from_exception "${ns_a}" "${host4_b_addr}" oif veth_A-R2)"
+ check_pmtu_value "1300" "${pmtu_a_R1}" "exceeding MTU via R2 (veth_A-R1)" || return 1
+ check_pmtu_value "1300" "${pmtu_a_R2}" "exceeding MTU via R2 (veth_A-R2)" || return 1
+}
+
usage() {
echo
echo "$0 [OPTIONS] [TEST]..."
--
2.56.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net-next 0/2] ipv4: Don't cache a pmtu above the device mtu of a path
2026-11-24 15:37 [PATCH net-next 0/2] ipv4: Don't cache a pmtu above the device mtu of a path Vladimir Vdovin
2026-11-24 15:37 ` [PATCH net-next 1/2] " Vladimir Vdovin
2026-11-24 15:37 ` [PATCH net-next 2/2] selftests: net: pmtu: Add a multipath test with paths of different MTU Vladimir Vdovin
@ 2026-11-24 15:44 ` netdev-bot+sinfo
2 siblings, 0 replies; 4+ messages in thread
From: netdev-bot+sinfo @ 2026-11-24 15:44 UTC (permalink / raw)
To: Vladimir Vdovin
Cc: David Ahern, Ido Schimmel, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Shuah Khan, netdev,
linux-kselftest
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 4+ messages in thread