🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17974

Re: [PATCH net v4 2/2] selftests: net: add a test for vxlan snooping moving a MAC

#17974
From: netdev-bot+sashiko
Date: Tue, 17 Nov 2026 16:14
102 lines
11180 bytes
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
Technical Details
Message-ID: <179493204551.3136.7774320767698888409@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365426-linux-kernel-netdev=dewy.ru
References: <20261113155133.75090-3-ilskdw@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365426-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <179493204551.3136.7774320767698888409@kernel.org>
References: <20261113155133.75090-3-ilskdw@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2373288"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:rdiQ+ashJ+VDVNbf1GZGJNPqDjY= sha256:SsomQMimqN54+EVgnHT+iPANt1/a7HpkZuWEz1pYIkI=
	sha1:SLqXSjf4SJUnXWGfBLfZFP19FQY= sha256:P35FqtS4iXoJVO3TtpKkWW6a3wCpq+46a1GQNmi/dOs=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B0336114FE1; Tue, 17 Nov 2026 19:14:45 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id BjdCfd7wQHYY;
	Tue, 17 Nov 2026 19:14:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365426-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id A3A02114FBA; Tue, 17 Nov 2026 19:14:33 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 3382541921; Tue, 17 Nov 2026 16:14:08 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794932047;
	b=fhJquULrPjEyYljrGcmjUNhH64jhg6hwEdVVxYNJUgBU84OztkhzgK/OKUATBLFCOSOA
	 vOgWf2+GSsU4ZK73UNn2nQzrltTAhrc47zSZK+eVdA0ieveIOXfO48IyHvEaiqO7zJ2DM
	 MOKxea2ShyTq6VtcoE+00p3kYWlVawr25YscXAXQGwjcqw+uOdK39ZTRVrQE5/h1Czwpn
	 ZkPUQ+oYiTusZLrWzt08XvhAzuexgrfb7OLdY84QLW7d/yLHGyUzb1lLXu8WoEmvmJIIo
	 Mv32Sow3FPwIknuiJG6cg1SRfC7SGaFiIxq68BmD5TrogM7WwQ30ETxmgCuauZRW15A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794932047;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=HW3M2QrRHc3n1GK3RJRKy1yrUsd6CMKhaLE5Z9UJqrM=;
	b=10M/Bvnfmu1qiHOpmgND1U82YdqVfVTQzbp6rNrzdYuVWMk4XT/WD/OKtKLOZSJxVP8v
	 QLPjCRj3Ms5+YMCCj4J/8Ka7/9mfbfHDNVxtl506JmFbzU28Ltoh/v3U0pfgDJ1QzZh1Q
	 a1A784AK9r96xPlMhW8RJq4Uzh/MbzXfSUuy/71cb6BXWS4L3qqxbMC+CC7UW4ONrDMKZ
	 7F+So2cScMAF5GBW30pvHN/jKc+PVQwwIOes8Hk5Ih+FmLsotsDub8I8ftdq5Yb/MPqMT
	 MsMrqjwtUuDq5PE82AvoR6e4tnJdhVXraY1c5ciobdqAMaeY/BpPMdkDfA4+mhltR0A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PSXkWR7g;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FE90606A33D;
	Tue, 17 Nov 2026 16:14:07 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PSXkWR7g
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794932046;
	b=kgF4Q9UDvm0WE0eukQBUb6adsBmMmqJnIzvHQHlT9OPtcYfVpkIaB1eYYBYvSqxfYv6s
	 Jv7yCNokWNkEXL1bM7lUPyYsj50WX11/tIEh2wftoxY4NVnOdc7PCOSu6nLZyS5o4TQs/
	 St9aFd26RzPll7Oz18Or8OohlF113J6z3wyHKq0R3XM5UUeG/q0+uXntJWS5dvkgwgB7J
	 5+TIien60kII5nVrFXOi+gGA6LTldI0SIsJbsws5S3ZMGndGS43+WElG8MMxIUh5xZO3H
	 dvZYr+7wF/VhMctKIG0ZOzOuBHDPKk/+Jwq3EtfS97W7aCRsUar5qkSb0BAFN8U+QWg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794932046;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=HW3M2QrRHc3n1GK3RJRKy1yrUsd6CMKhaLE5Z9UJqrM=;
	b=uqtRhM6tQmh/u/+7fy5S2WiUv5rSz/n1x/CiNGzTiSrq3xT8qUj6FgdNy7NKTnGn5LnN
	 +r9eSxyRUomaVu9dwgdR9iuJJmI6ZwVUtzRkHf2WUraULPO8uaGrP7Cz4Nz/Q3WUk6doy
	 3c6wnIrzK8iQT6CUyxrFDriPoWity25nzsSX2qlvXMR/d9iNdtJoDvZE6O0VOCnVD6IKA
	 WrW8rsTqDVSmNw3vanT6cem5lTPS2N/QyFkwCM4GPCpgF411d0pLAvMrH53M7h1NzASDH
	 Qh/J5izzshRZG7njb+bkCQCdfHaJSp4M7bpZqL2vxEADlu7guwNatG1t0vIWZKdQQjw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PSXkWR7g;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0EE2606A331;
	Tue, 17 Nov 2026 16:14:06 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA5E81F000C7;
	Tue, 17 Nov 2026 16:14:05 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794932046;
	bh=HW3M2QrRHc3n1GK3RJRKy1yrUsd6CMKhaLE5Z9UJqrM=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=PSXkWR7gP0357vG+MFlvzIduH/v2h5b+qJldoYlm3qzHqcXrhiAeUBg5bb6MOOdsD
	 GAU54BRJSdYCG5xGT+2K+vCCx07QAFanR2n3+/iyHc/HH1XUybLx4bHpy8cYAPfhAy
	 kNQ3//c8d6fzi1Sl1dFQMKV3qsOZPep8FNXzuzxX+n5HFqWyTpWajEzuA9nLsBBLLU
	 ISD0Cy4KsdE8YpWYHDLMObxrddxvVYE6McZs06tRAOCzavGOjdk2d0J2t1QjcPRlHi
	 Ycm1SeXY35W5CljWrpGHZXDIqvNyTxPvoNINEm9P5rHHcAZYy8kF2xAby7/LubtToH
	 aA52F8L5KuC5g==
X-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
X-In-Reply-To: <20261113155133.75090-3-ilskdw@gmail.com>
X-sashiko-severity: Low
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list