Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: deliran@verdict.gg
Cc: dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	willemb@google.com, horms@kernel.org, shuah@kernel.org,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v5 2/2] selftests: net: pmtu: Add IPv6 multipath tests
Date: Thu, 03 Dec 2026 19:01:42 +0000	[thread overview]
Message-ID: <179632450234.3146.6973852608752869161@kernel.org> (raw)
In-Reply-To: <20261202182545.19656-3-deliran@verdict.gg>

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] ipv6: early return in __ip6_rt_update_pmtu() skips multipath
  nexthops
- [Low] In tools/testing/selftests/net/pmtu.sh, setup_multipath() now
  writes `net.ipv4.ping_group_range="0 2147483647"` in ns_a for every…

--

selftests: net: pmtu: Add IPv6 multipath tests

This commit extends the IPv4 multipath PMTU selftests in pmtu.sh to IPv6.
It adds pmtu_ipv6_mp_exceptions and pmtu_ipv6_mp_asym_exceptions, and the
asymmetric test uses IPv6 flow labels to send one ping through each
router. It also enables ICMP datagram sockets for ping in ns_a, so that
rawv6_err() does not process the same Packet Too Big twice.

> diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
> index a5d602a453c9b..9403e87ee608f 100755
> --- a/tools/testing/selftests/net/pmtu.sh
> +++ b/tools/testing/selftests/net/pmtu.sh

[ ... ]

> @@ -1003,49 +1014,119 @@ setup_ovs_bridge() {

[ ... ]

>  setup_multipath() {
> +	family="$1"
> +

[ ... ]

>  	# Set up routers with routes to dummies
> -	run_cmd ${ns_r1} ip route add ${host4_a_addr} via ${prefix4}.${a_r1}.1
> -	run_cmd ${ns_r2} ip route add ${host4_a_addr} via ${prefix4}.${a_r2}.1
> -	run_cmd ${ns_r1} ip route add ${host4_b_addr} via ${prefix4}.${b_r1}.1
> -	run_cmd ${ns_r2} ip route add ${host4_b_addr} via ${prefix4}.${b_r2}.1
> +	run_cmd ${ns_r1} ip route add ${host_a_addr} via ${nh_r1_a}
> +	run_cmd ${ns_r2} ip route add ${host_a_addr} via ${nh_r2_a}
> +	run_cmd ${ns_r1} ip route add ${host_b_addr} via ${nh_r1_b}
> +	run_cmd ${ns_r2} ip route add ${host_b_addr} via ${nh_r2_b}
> +
> +	# Let ping use ICMPv6 datagram sockets to avoid handling a PTB twice.
> +	${ns_a} sysctl -q -w net.ipv4.ping_group_range="0 2147483647"
> +}
> +
> +setup_multipath4() {
> +	setup_multipath 4
> +}

[Severity: Low]
Is it intended that this sysctl runs for both families? The comment above
it only mentions ICMPv6.

net.ipv4.ping_group_range is the only range that net/ipv4/ping.c checks,
for both AF_INET and AF_INET6 ping sockets. setup_multipath4() also goes
through setup_multipath(). That means pmtu_ipv4_mp_exceptions and
pmtu_ipv4_mp_asym_exceptions now use ICMP datagram sockets as well.

Before this patch, the netns default range of "1 0" denied datagram
sockets, so ping fell back to SOCK_RAW. IPv4 Fragmentation Needed handling
now goes through ping_err() instead of raw_err(). Both call
ipv4_sk_update_pmtu(), so IPv4 coverage should stay about the same.

The commit message describes the change as IPv6 only:

  Use ICMP datagram sockets for ping. With a raw socket, rawv6_err() can
  process the same Packet Too Big a second time.

Could the sysctl be set only when family is 6? Alternatively, the comment
and commit message could say that the IPv4 multipath tests also move from
raw to datagram ping sockets.

[ ... ]

> @@ -2456,29 +2572,48 @@ test_pmtu_ipv4_mp_asym_exceptions() {
>  	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)" || {
> +	flow_r1="$(mp_flow_via ${family} ${dst} veth_A-R1)" || {
>  		err "  no flow through veth_A-R1 found"; return 1; }
> -	flow_r2="$(mp_flow_via ${host4_b_addr} veth_A-R2)" || {
> +	flow_r2="$(mp_flow_via ${family} ${dst} veth_A-R2)" || {
>  		err "  no flow through veth_A-R2 found"; return 1; }
> +	if [ ${family} -eq 4 ]; then
> +		ping_r1="${ping} -I ${flow_r1}"
> +		ping_r2="${ping} -I ${flow_r2}"
> +	else
> +		ping_r1="${ping} -I ${host6_a_addr} -F ${flow_r1}"
> +		ping_r2="${ping} -I ${host6_a_addr} -F ${flow_r2}"
> +	fi
>  
> -	# 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}"
> +	# The error 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_r1} -q -M want -i 0.1 -c 1 -s 1800 "${dst}"
>  
> -	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)"
> +	pmtu_a_R1="$(route_get_dst_pmtu_from_exception "${ns_a}" "${dst}" oif veth_A-R1)"
> +	pmtu_a_R2="$(route_get_dst_pmtu_from_exception "${ns_a}" "${dst}" 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}"
> +	run_cmd ${ns_a} ${ping_r2} -q -M want -i 0.1 -c 1 -s 1280 "${dst}"
>  
> -	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)"
> +	pmtu_a_R1="$(route_get_dst_pmtu_from_exception "${ns_a}" "${dst}" oif veth_A-R1)"
> +	pmtu_a_R2="$(route_get_dst_pmtu_from_exception "${ns_a}" "${dst}" 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
>  }
>  
> +test_pmtu_ipv4_mp_asym_exceptions() {
> +	test_pmtu_ipvX_mp_asym_exceptions 4
> +}
> +
> +test_pmtu_ipv6_mp_asym_exceptions() {
> +	test_pmtu_ipvX_mp_asym_exceptions 6
> +}
> +
> +test_pmtu_ipv6_mp_exceptions() {
> +	test_pmtu_ipvX_mp_exceptions 6
> +}
> +
>  usage() {
>  	echo
>  	echo "$0 [OPTIONS] [TEST]..."

[Severity: Medium]
This checks that the error from R1 lands on the path via R1. Does the
test ever reach the case where the PTB lookup picks the other nexthop?

For ICMPv6 datagram ping, icmpv6_err() calls ip6_update_pmtu() with oif
set to skb->dev->ifindex. R1 routes host6_a_addr back over the A-R1
link, so the Packet Too Big arrives on veth_A-R1 and ip6_route_output()
resolves to the R1 nexthop. The second ping works the same way for R2.

The preceding fix walks the nexthops with nexthop_for_each_fib6_nh() or
the fib6_siblings list. However, __ip6_rt_update_pmtu() still returns
early when mtu >= dst6_mtu(dst). That check uses only the single dst
chosen by the lookup, and it runs before any other nexthop is visited.

Suppose the lookup lands on the path via R2. Then dst6_mtu(dst) is 1350,
or 1300 once an exception exists there. A PTB of 1400 from R1 takes the
early return, and rt6_nh_update_pmtu() is never called for the R1
nexthop. The R1 path keeps its link MTU of 2000, so flows on it keep
sending packets that R1 drops.

The lookup can land on another nexthop when the PTB comes back on a
different interface than the one the packet left from. It can also land
there through ip6_sk_update_pmtu() on unbound sockets and through the
tunnel error handlers, which do the lookup with oif 0. The commit
message describes this for rawv6_err().

Should the early return in __ip6_rt_update_pmtu() be limited to routes
without siblings? Or should it only apply per nexthop, after the
multipath walk? Since these tests are meant to catch regressions of the
fix, could they also cover a PTB whose lookup selects the lower MTU
path?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202182545.19656-1-deliran%40verdict.gg

      reply	other threads:[~2026-12-03 19:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 18:25 [PATCH net-next v5 0/2] ipv6: Cache pmtu for all paths of a multipath route Vladimir Vdovin
2026-12-02 18:25 ` [PATCH net-next v5 1/2] " Vladimir Vdovin
2026-12-03 19:01   ` netdev-bot+sashiko
2026-12-02 18:25 ` [PATCH net-next v5 2/2] selftests: net: pmtu: Add IPv6 multipath tests Vladimir Vdovin
2026-12-03 19:01   ` netdev-bot+sashiko [this message]

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=179632450234.3146.6973852608752869161@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=deliran@verdict.gg \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=willemb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox