From: netdev-bot+sashiko@kernel.org
To: ilskdw@gmail.com
Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org, kuniyu@google.com,
mschiffer@universe-factory.net, nicolas.dichtel@6wind.com,
shuah@kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net v5 2/2] selftests: net: add a test for vxlan snooping moving a MAC
Date: Mon, 16 Nov 2026 04:55:55 +0000 [thread overview]
Message-ID: <179480495572.3136.4564700549616411928@kernel.org> (raw)
In-Reply-To: <20261115040609.61134-3-ilskdw@gmail.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] ping_from_cpu0() in
tools/testing/selftests/net/test_vxlan_snoop_move.sh always pins to…
- [Low] test_move_to_link_local() pins its pings to CPU 0.
- [Low] test_move_behind_router (line 48), test_move_to_link_local (line
105) and test_same_remote_keeps_via (line 159) ignore the return value…
--
selftests: net: add a test for vxlan snooping moving a MAC
This adds test_vxlan_snoop_move.sh, with three cases for a learning VXLAN
device that snoops a known MAC. The first moves the MAC from an IPv4 remote
to one behind a router. The second moves it from a global IPv6 remote to a
link-local one. The third checks that a dynamic entry keeps its "via"
device. The first two cases pin their pings to CPU 0 because the route
cache is per CPU.
> diff --git a/tools/testing/selftests/net/test_vxlan_snoop_move.sh b/tools/testing/selftests/net/test_vxlan_snoop_move.sh
> new file mode 100755
> index 0000000000000..5b78310439d3a
> --- /dev/null
> +++ b/tools/testing/selftests/net/test_vxlan_snoop_move.sh
> @@ -0,0 +1,199 @@
[ ... ]
> +ping_from_cpu0()
> +{
> + local ns=$1; shift
> +
> + taskset -c 0 ip netns exec "$ns" ping -c 3 -W 1 -i 0.2 "$@" &> /dev/null
> +}
[Severity: Low]
What happens here when CPU 0 is not in the allowed CPU set? That can
happen under a cpuset cgroup that excludes CPU 0, or when CPU 0 is
offline.
In that case sched_setaffinity() fails with EINVAL, taskset exits non-zero
and ping never runs. That status goes straight to check_err in
test_move_behind_router() and test_move_to_link_local(). Both cases then
report "ping before the move failed" on a working kernel instead of
skipping.
The require_command taskset near the end of the script only checks that
the binary is installed. It doesn't check that CPU 0 is usable.
The pinning only needs one CPU to fill the per-CPU dst_cache and then hit
it. Could this pick any CPU from the current affinity mask, or skip when
CPU 0 can't be used? srv6_iptunnel_cache.sh hard-codes taskset -c 0 the
same way.
[ ... ]
> +test_move_behind_router()
> +{
> + RET=0
> +
> + setup_ns sw ex a r b
> + defer cleanup_ns "$sw" "$ex" "$a" "$r" "$b"
[Severity: Low]
Should the return value of setup_ns be checked here?
In lib.sh, setup_ns() returns $ksft_skip when ip netns add fails. This
test keeps going anyway, so every later ip -n and bridge -n command fails.
The case then reports "ping before the move failed" instead of SKIP.
The setup_ns calls in test_move_to_link_local() and
test_same_remote_keeps_via() have the same problem. The second one reports
"ping from the remote failed".
Most net selftests don't check setup_ns either, though bareudp.sh,
fou_gre_gro.sh and nsh_gso.sh do. So this matches common practice, but the
result is still reported wrongly.
[ ... ]
> +test_move_to_link_local()
> +{
[ ... ]
> + ip -n "$ex" addr add 2001:db8:1::1/64 dev e0 nodad
> + ip -n "$ex" addr add fe80::1/64 dev e0 nodad
> + ip -n "$a" addr add 2001:db8:1::2/64 dev a0 nodad
> + ip -n "$b" addr add fe80::b/64 dev b0 nodad
> +
> + ip -n "$ex" link add vx0 type vxlan id 42 dstport 4789 \
> + local 2001:db8:1::1 learning
> + bridge -n "$ex" fdb append 00:00:00:00:00:00 dev vx0 dst 2001:db8:1::2
> + bridge -n "$ex" fdb append 00:00:00:00:00:00 dev vx0 dst fe80::b via e0
[ ... ]
> + ping_from_cpu0 "$ex" 192.168.0.10
> + check_err $? "ping before the move failed"
> +
> + ip -n "$a" link set vx0 down
> + ip -n "$b" link set vx0 up
> + ip netns exec "$b" ping -c 1 -W 1 192.168.0.1 &> /dev/null
> +
> + bridge -n "$ex" fdb show dev vx0 | grep -q "$MAC dst fe80::b via e0 "
> + check_err $? "fdb entry did not move to the new remote and interface"
> +
> + ping_from_cpu0 "$ex" 192.168.0.10
> + check_err $? "ping after the move failed"
[Severity: Low]
Can this post-move ping tell a stale IPv6 dst_cache from a reset one?
The commit message says:
The first two cases ping from CPU 0. The route cache is per CPU, and
only the CPU that filled it hits the stale entry.
In this topology the old remote (2001:db8:1::2) and the new remote
(fe80::b) are both on-link through e0 in $ex. The pre-move ping fills
CPU 0's rdst->dst_cache with a non-gateway on-link route on e0. Nothing
changes the routes in $ex between the two pings.
udp_tunnel6_dst_lookup() returns the cached dst without checking oif or
daddr:
net/ipv6/ip6_udp_tunnel.c:udp_tunnel6_dst_lookup() {
...
dst = dst_cache_get_ip6(dst_cache, saddr);
if (dst)
return dst;
...
}
On an on-link route the next hop is the packet's own daddr. So the stale
dst would deliver to fe80::b just as a fresh lookup would.
Suppose the dst_cache_reset(&rdst->dst_cache) call in vxlan_snoop() were
removed but the remote_ifindex update were kept. Wouldn't this case still
pass? It looks like only the "via e0" grep tests anything here, and the
CPU 0 pinning has no effect.
The IPv4 case still covers dst_cache_reset() itself. Would giving the old
and new IPv6 remotes different egress paths cover the IPv6 cache path? One
option is to put one of them behind a router, as in the first case.
Otherwise, could the commit message be reworded so it doesn't suggest the
second case covers stale routes?
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261115040609.61134-1-ilskdw%40gmail.com
prev parent reply other threads:[~2026-11-16 4:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 4:06 [PATCH net v5 0/2] vxlan: reset the remote's dst cache when snooping moves a MAC Zhefu Peng
2026-11-15 4:06 ` [PATCH net v5 1/2] " Zhefu Peng
2026-11-16 4:55 ` netdev-bot+sashiko
2026-11-15 4:06 ` [PATCH net v5 2/2] selftests: net: add a test for vxlan snooping moving " Zhefu Peng
2026-11-16 4:55 ` 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=179480495572.3136.4564700549616411928@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=ilskdw@gmail.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kselftest@vger.kernel.org \
--cc=mschiffer@universe-factory.net \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/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