Netdev List
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: dsahern@kernel.org
Cc: netdev@vger.kernel.org, idosch@nvidia.com, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org, ralf@mandelbit.com, ja@ssi.bg,
	dahern@nvidia.com, noreply@anthropic.com
Subject: Re: [PATCH net-next v3 13/13] selftests: net: ipvs: check a PMTU learned after the DR route was cached
Date: Sat, 05 Dec 2026 19:21:02 +0000	[thread overview]
Message-ID: <179649846281.3148.13079176381668961620@kernel.org> (raw)
In-Reply-To: <20261201174021.7211-14-dsahern@kernel.org>

Thank you for your contribution! Sashiko AI review found 5 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 4

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] test_dr_v6_pmtu() in
  tools/testing/selftests/net/netfilter/ipvs.sh can pass on a kernel…
- [Low] The new top-level `checktool "python3 -c pass" "run test without
  python3"` in tools/testing/selftests/net/netfilter/ipvs.sh runs before…
- [Low] The commit message carries the trailer 'Co-Authored-By: Claude
  Sonnet 5.5 <noreply@anthropic.com>'.
- [Low] The header comment of udp_send_v6() in
  tools/testing/selftests/net/netfilter/ipvs.sh says it sends 'one UDP…
- [Low] test_dr_v6_pmtu() in
  tools/testing/selftests/net/netfilter/ipvs.sh never checks the exit…

--

selftests: net: ipvs: check a PMTU learned after the DR route was cached

This adds an IPv6 DR mode test to ipvs.sh. The test caches the director's
route to the real server, forges a packet too big message so the director
learns a PMTU for the real server, and then checks that an oversized
datagram gets a packet too big message back to the client. It also adds
CONFIG_IP_VS_IPV6 and CONFIG_IP_VS_PROTO_UDP to the netfilter selftest
config.

> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

[Severity: Low]
This isn't a bug, but Co-Authored-By is not in $signature_tags in
scripts/checkpatch.pl. Running checkpatch on this patch will warn
"Non-standard signature: Co-Authored-By:".

Documentation/process/coding-assistants.rst in this tree does not define an
AI attribution trailer. It also forbids an AI Signed-off-by, so
Co-developed-by can't be used either.

Could the attribution follow a convention the maintainers accept, or move
below the --- line?

> diff --git a/tools/testing/selftests/net/netfilter/ipvs.sh b/tools/testing/selftests/net/netfilter/ipvs.sh
> index 9c9d5b38ab712..556ce071035ec 100755
> --- a/tools/testing/selftests/net/netfilter/ipvs.sh
> +++ b/tools/testing/selftests/net/netfilter/ipvs.sh

[ ... ]

> @@ -54,6 +60,7 @@ fi
>  
>  checktool "ipvsadm -v" "run test without ipvsadm"
>  checktool "socat -h" "run test without socat"
> +checktool "python3 -c pass" "run test without python3"

[Severity: Low]
On a system without python3, does this skip the existing IPv4 DR, NAT and
tunnel tests as well? checktool() in netfilter/lib.sh exits the whole
script:

checktool (){
	if ! $1 > /dev/null 2>&1; then
		echo "SKIP: Could not $2"
		exit $ksft_skip
	fi
}

The IPv4 tests only need socat, and before this patch they ran without
python3. Only test_dr_v6_pmtu() uses python3, through udp_send_v6() and
send_ptb_v6().

Could the python3 check move into test_dr_v6_pmtu() so that only that test
is skipped?

[ ... ]

> @@ -169,6 +176,74 @@ test_tun() {
>  	test_service
>  }
>  
> +# Send one UDP datagram of ${2} bytes from the client to the IPv6 service and
> +# keep the socket open for a moment, so that a packet too big message for it
> +# is accepted.
> +udp_send_v6() {
> +	ip netns exec "${ns0}" python3 -c '
> +import socket, sys, time
> +s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
> +s.bind((sys.argv[1], 0))
> +s.sendto(b"x" * int(sys.argv[3]), (sys.argv[2], int(sys.argv[4])))
> +time.sleep(0.5)
> +' "${cip_v6}" "${vip_v6}" "${1}" "${port}"
> +}

[Severity: Low]
This isn't a bug, but the comment says the datagram is ${2} bytes. The size
actually comes from ${1}, which is passed as sys.argv[3]. Should the comment
say ${1}?

[ ... ]

> +test_dr_v6_pmtu() {

[ ... ]

> +	ip netns exec "${ns1}" ip addr add "${vip_v6}/128" dev lo nodad
> +	ip netns exec "${ns1}" ipvsadm -A -u "[${vip_v6}]:${port}" -s rr
> +	ip netns exec "${ns1}" ipvsadm -a -u "[${vip_v6}]:${port}" \
> +		-r "[${rip_v6}]:${port}" -g

[Severity: Low]
What happens here if ip_vs was built without CONFIG_IP_VS_IPV6? Neither
ipvsadm call has its exit status checked, so the test carries on with no
service.

The datagrams to vip_v6 would then be delivered locally in ns1. Nothing
listens on the port there, and they are never forwarded to the real server.

The first check still passes. ns1 learns the PMTU from the forged packet
too big through icmpv6_err()->ip6_update_pmtu(), without IPVS being
involved.

The second check then reports "FAIL: director kept using a route that
bypasses the learned PMTU", which points at route caching instead of the
missing IPVS feature. The config fragment in this patch covers CI builds,
but other configs would hit this.

Should a failed ipvsadm call make the test skip, or fail with a message
that names the real cause?

> +
> +	ip netns exec "${ns2}" ip addr add "${rip_v6}/64" dev veth21 nodad
> +	ip netns exec "${ns2}" ip addr add "${vip_v6}/128" dev lo nodad
> +
> +	# Let the director cache its route to the real server
> +	udp_send_v6 100
> +
> +	send_ptb_v6 1280
> +	sleep 0.2
> +	if ! ip netns exec "${ns1}" ip -6 route get "${rip_v6}" | grep -q "mtu 1280"; then
> +		echo "FAIL: director did not learn the PMTU of the real server"
> +		return 1
> +	fi
> +
> +	# A datagram that exceeds the PMTU must be answered with a packet too
> +	# big message, which gives the client a PMTU for the service
> +	udp_send_v6 1400
> +	if ! ip netns exec "${ns0}" ip -6 route get "${vip_v6}" | grep -q "mtu 1280"; then
> +		echo "FAIL: director kept using a route that bypasses the learned PMTU"
> +		return 1
> +	fi
> +}

[Severity: Medium]
Can this test pass on a kernel that lacks the ip6_dst_check() behaviour it
is meant to cover?

setup() brings up veth10 and veth12 in ns1 and then waits only one second:

	ip netns exec "${ns1}" ip link set veth10 up
	...
	ip netns exec "${ns1}" ip link set veth12 up
	...
	sleep 1

setup_ns() does not disable accept_dad, so the link-local addresses on
veth10 and veth12 are still tentative at that point.

addrconf_dad_kick() waits a random delay of up to rtr_solicit_delay (1s)
before the first NS. DAD succeeds RETRANS_TIME (1s) after that, so each
interface finishes DAD somewhere between 1s and 2s after link up.

When DAD completes, addrconf_dad_completed() calls rt_genid_bump_ipv6().
__ipv6_ifa_notify() then inserts the host route with ip6_ins_rt(), and
fib6_add() bumps the generation again.

ip6_dst_check() checks the generation before it gets to the exception
check:

net/ipv6/route.c:ip6_dst_check() {
	...
	if (!rt6_is_valid(rt))
		return NULL;
	...
			     rt6_uncached_clone_superseded(rt, from)))
	...
}

Suppose an ns1 link-local address finishes DAD after "udp_send_v6 100" and
before "udp_send_v6 1400". The cached dst then fails the check for an
unrelated reason.

__ip_vs_get_out_rt_v6() looks the route up again through
ip6_route_output() and picks up the 1280 MTU exception. The client gets a
packet too big message whether or not rt6_uncached_clone_superseded()
works.

The window between the two sends runs from roughly 1.1-1.6s to roughly
2.0-2.6s after link up. That covers most of the DAD completion range for
both ns1 interfaces, so a false pass seems likely on most runs.

Would setting accept_dad=0 in ns1 before the links come up make this
deterministic? Another option is to wait until
"ip -n $ns1 -6 addr show tentative" is empty before the first
udp_send_v6.

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201174021.7211-1-dsahern%40kernel.org

  reply	other threads:[~2026-12-05 19:21 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 [this message]
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
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=179649846281.3148.13079176381668961620@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=dahern@nvidia.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=noreply@anthropic.com \
    --cc=pabeni@redhat.com \
    --cc=ralf@mandelbit.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