Netdev List
 help / color / mirror / Atom feed
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 v4 2/2] selftests: net: add a test for vxlan snooping moving a MAC
Date: Tue, 17 Nov 2026 16:14:05 +0000	[thread overview]
Message-ID: <179493204551.3136.7774320767698888409@kernel.org> (raw)
In-Reply-To: <20261113155133.75090-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] In tools/testing/selftests/net/test_vxlan_snoop_move.sh,
  ping_from_cpu0() (lines 23-28) runs every ping as `taskset -c 0 ip…
- [Low] test_move_behind_router() (line 45, `setup_ns sw ex a r b`) and
  test_move_to_link_local() (line 102, `setup_ns sw ex a b`) ignore the…

--

selftests: net: add a test for vxlan snooping moving a MAC

This adds a selftest for a learning VXLAN device that snoops a known MAC
moving to another VTEP. The first case moves the MAC from an on-link IPv4
remote to one behind a router. The second moves it from a global IPv6
remote to a link-local one. Both cases ping from 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..e8c91fbccf6a3
> --- /dev/null
> +++ b/tools/testing/selftests/net/test_vxlan_snoop_move.sh
> @@ -0,0 +1,161 @@

[ ... ]

> +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 in ping_from_cpu0() if CPU 0 is not in the allowed affinity
mask? That can happen under a cpuset that limits the run to CPUs 2-3, or
when CPU 0 is offline.

In that case sched_setaffinity() would fail with EINVAL. taskset would
then exit non-zero and ping would never run. Both tests do this:

	ping_from_cpu0 "$ex" 192.168.0.10
	check_err $? "ping before the move failed"

check_err() records ksft_fail, so log_test() reports FAIL instead of SKIP.

The only precondition check is at the end of the script:

	require_command taskset

That goes through check_command(), which only runs command -v taskset.

Could the script probe first with something like taskset -c 0 true and
skip if it fails? Another option is to pick a CPU from the current
affinity mask.

For what it's worth, srv6_iptunnel_cache.sh also hardcodes taskset -c 0.

> +
> +add_sw_port()

[ ... ]

> +test_move_behind_router()
> +{
> +	RET=0
> +
> +	setup_ns sw ex a r b
> +	defer cleanup_ns "$sw" "$ex" "$a" "$r" "$b"

[Severity: Low]
Should test_move_behind_router() check the return value of setup_ns
here?

If ip netns add fails, setup_ns() in lib.sh cleans up the namespaces it
has already created and returns $ksft_skip:

	if ! ip netns add "${!ns_name}"; then
		echo "Failed to create namespace $ns_name"
		cleanup_ns "${ns_list[@]}"
		return $ksft_skip
	fi

The test keeps going anyway, but $sw, $ex and the other variables now
name namespaces that no longer exist. Every later ip -n, bridge -n and
ip netns exec command fails. The ping and fdb checks then call
check_err(), and log_test() reports FAIL instead of SKIP.

test_move_to_link_local() has the same problem with setup_ns sw ex a b.

A few existing tests, including bareudp.sh, fou_gre_gro.sh and
nsh_gso.sh, check the setup_ns return value with ||.

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261113155133.75090-1-ilskdw%40gmail.com

      reply	other threads:[~2026-11-17 16:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 15:51 [PATCH net v4 0/2] vxlan: reset the remote's dst cache when snooping moves a MAC Zhefu Peng
2026-11-13 15:51 ` [PATCH net v4 1/2] " Zhefu Peng
2026-11-17 16:14   ` netdev-bot+sashiko
2026-11-13 15:51 ` [PATCH net v4 2/2] selftests: net: add a test for vxlan snooping moving " Zhefu Peng
2026-11-17 16:14   ` 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=179493204551.3136.7774320767698888409@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