🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #16957

Re: [PATCH net-next v5 8/8] selftests: net: test the vxlan vnifilter request limit and dump replay

#16957
From: netdev-bot+sashiko
Date: Mon, 16 Nov 2026 05:32
121 lines
13067 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] vxlan_vnifilter_refused_fdb_update()
  (tools/testing/selftests/net/test_vxlan_vnifiltering.sh:590) waits for…
- [Low] The FDB regex probes in vxlan_vnifilter_refused_fdb_update()
  (lines 582 and 592) are passed through run_cmd(), which runs…

--

selftests: net: test the vxlan vnifilter request limit and dump replay

This extends test_vxlan_vnifiltering.sh with cases for the vnifilter
request-size cap and the 24-bit VNI bounds. It also adds a dump/replay
round trip, rollback of failed VNI adds and a refused FDB update. New
helpers vni_listed(), vni_ranges() and fdb_listed() report a failed
"bridge ... show" separately from "absent".

> diff --git a/tools/testing/selftests/net/test_vxlan_vnifiltering.sh b/tools/testing/selftests/net/test_vxlan_vnifiltering.sh
> index 6fb5af013dacf..fb8401399b099 100755
> --- a/tools/testing/selftests/net/test_vxlan_vnifiltering.sh
> +++ b/tools/testing/selftests/net/test_vxlan_vnifiltering.sh

[ ... ]

> +# Succeed if "bridge fdb show" lists, on device $1, an entry whose line
> +# matches the extended regex $2. A failed show returns 2, so a probe
> +# expecting the entry to be absent cannot pass on it.
> +fdb_listed()
> +{
> +	local out
> +
> +	out=$(bridge -netns $testns fdb show dev $1) || return 2
> +	grep -qE "$2" <<< "$out"
> +}

[ ... ]

> +vxlan_vnifilter_refused_fdb_update()
> +{
> +	local opts="external vnifilter local 172.16.0.1 dev veth-testns"
> +	local zero="^00:00:00:00:00:00 dst 172.16.0.2 .*src_vni 100 .*self"
> +	local mac=02:00:00:00:00:01
> +
> +	cleanup_vnifilter_api &>/dev/null
> +	setup_vnifilter_api
> +
> +	run_cmd "ip -netns $testns link add vxlan-age type vxlan $opts \
> +		 dstport 4789 ageing 1"
> +	log_test $? 0 "refused update: create a device with ageing 1"
> +	run_cmd "ip -netns $testns link set dev vxlan-age up"
> +	run_cmd "bridge -netns $testns vni add dev vxlan-age vni 100 \
> +		 remote 172.16.0.2"
> +	log_test $? 0 "refused update: add a VNI with a remote"
> +	run_cmd "fdb_listed vxlan-age '$zero permanent'"

[Severity: Low]
Will the single quotes around the regex survive run_cmd()? In this script
run_cmd() does:

	out=$(eval $cmd $stderr)

$cmd is not quoted there, so it is word-split and globbed before eval
re-parses it. At that point the single quotes are just literal characters
inside the words, and they don't protect anything.

That means words like .*src_vni and .*self get pathname expansion. Nothing
in the script or lib.sh sets noglob, nullglob or failglob.

If the working directory holds a dotfile whose name ends in "src_vni" or
"self", bash would replace that piece of the regex with the filename.
grep -E then gets a different pattern. In the usual case nothing matches
and the words pass through unchanged.

Could these two probes (here and the "still permanent" check below) call
fdb_listed directly instead of going through run_cmd's unquoted eval?

> +	log_test $? 0 "refused update: the VNI's default entry is permanent"
> +	run_cmd "bridge -netns $testns fdb replace 00:00:00:00:00:00 \
> +		 dev vxlan-age dst 172.16.0.3 src_vni 100 self dynamic"
> +	log_test $? 255 "refused update: cannot replace the default entry"
> +	run_cmd "bridge -netns $testns fdb add $mac dev vxlan-age \
> +		 dst 172.16.0.4 src_vni 100 self dynamic"
> +	log_test $? 0 "refused update: add a dynamic entry"
> +	slowwait 25 eval "! fdb_listed vxlan-age '^$mac '"

[Severity: Low]
Can a failed "bridge fdb show" make this wait end early? fdb_listed()
returns 2 when the show fails. Its comment says that is so an absence
probe cannot pass on it. The ! here turns any non-zero status into 0,
including 2, so slowwait would return success right away.

If that happens, "the dynamic entry is aged out" reports PASS. The final
"still permanent" check then runs before vxlan_cleanup() has done any
ageing pass, since FDB_AGE_INTERVAL is 10 seconds. The "survives ageing"
part of the case would not be exercised.

This is the only absence probe that uses fdb_listed(), so it is the one
place where the helper's guarantee doesn't hold.

An unfixed kernel should still be caught. Without "vxlan: leave FDB state
and flags unchanged when an update fails", the refused replace leaves
fdb->state as NUD_REACHABLE. vxlan_fdb_info() reports
ndm->ndm_state = fdb->state, so the final check fails anyway. The effect
is a spurious PASS line and a skipped ageing check, not a missed
regression.

Would it work to test for status 1 explicitly, for example
"fdb_listed ...; [ $? -eq 1 ]", instead of negating the result?

> +	log_test $? 0 "refused update: the dynamic entry is aged out"
> +	run_cmd "fdb_listed vxlan-age '$zero permanent'"
> +	log_test $? 0 "refused update: the default entry is still permanent"
>  }

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261114221412.255825-1-alishmery18%40gmail.com
Technical Details
Message-ID: <179480717303.3136.3539186076980782462@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364070-linux-kernel-netdev=dewy.ru
References: <20261114221412.255825-9-alishmery18@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364070-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v5 8/8] selftests: net: test the vxlan vnifilter
 request limit and dump replay
Date: Mon, 16 Nov 2026 05:32:53 +0000
Organization: Usenet Network
Message-ID: <179480717303.3136.3539186076980782462@kernel.org>
References: <20261114221412.255825-9-alishmery18@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1987690"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/wbdra9f3Pk2ZbuZja9nfhgupOg= sha256:SR/d62gST/gxrx3VZkgXub+rI0O7wMoqPtVpG1Or6z4=
	sha1:YFy0VKsnzGkzkml6Wiq5vAv4E+I= sha256:5Lw9wY7oj4ZInwzrY4ACoUdhmWLxLniXfuaLmgWmKXc=
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 077D7114B28; Mon, 16 Nov 2026 08:33:20 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[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 gVwkaOMCSlsc;
	Mon, 16 Nov 2026 08:33:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-364070-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 749D2114B2D; Mon, 16 Nov 2026 08:33:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 6ED27601DE7; Mon, 16 Nov 2026 05:33:01 +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=1794807180;
	b=bFXULlIj4D9y6jvvlOoqANkXjea0a5RKCsM0VhjwxJCsnow59MGDZcT6UmHayH6rnXmb
	 9peY/dcepd3lXPYZmM803Mv9isYcvUn/5efvxvDFzMSMrmuYfNeFME8qZ8NhFBpRX83mz
	 nkoayHUk4NbtZZZnOVdZ+Nd86IVbqHty95xf6FuYTclnpdb+xtkYerUGZyhjvqIzfWcEh
	 Ff01ZsV6VKbuAoKpVGTKODkEV/BBqQJHgHuOCkv2MSUp4I/Je5Y3opLHDb8leM+aH2SA0
	 8QwaEhgED0KrsjfGYX/fwhdx/QAg4ergdJTao6O5sOeywl0kmGstyLREXIGljvyIKDg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794807180;
	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=235IhKMChFexMr22e8JQ4l9QP0XQgT/y/XG+KObBuiI=;
	b=drf1+Phl7TPZrzeJ6A5cbW6YacYy8+OjKvnO5VzvgMtSk3sdk08hx/4MO89IIjQlYkcz
	 nwqKEaDFaA0znsWxuFsJ5ro/TPZ5bSA4O3daxz6T3PsBiZ5+aIcRZ5rFN0Ok+YeGEhtHy
	 Bop9KQvkb7/tcR6LrZg9WMwOkjixeQvy6IwoJWY+1CaRojUOL5zI95gb777bkXWnesyqQ
	 1WvumgdIkBLujR/zjHbooES//mRHK7cZRY60r28ERA97nrYzksBiaI7ON9CRWLaXTMv08
	 oXEGbU4yn6DYlBIEMl1wnITYFXMWPPPE5Eu1idfRNX5TPH9HVSOkl8Yae/HwsUfCfcA==
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="kVhYU/Q4";
	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 7BA9F606A334;
	Mon, 16 Nov 2026 05:33:00 +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=kVhYU/Q4
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=1794807174;
	b=28IkxmyqkL3LUHpySGwAAEi4w6mNpD54pIiHISI78LVjHen/kDWMMOvx3ODMSQYEDALz
	 xiAENZUQuo3X+GCtTqALxCEofX/1ziF8z65KpaXev5TfnaYCBGyuUn/v2VWf3AaoIz74k
	 JpdO0MSo8VFdlZhpW6F3orRUMJi4DvTtrDlDQdmOJkqC8NsskyMFgoFZnLBDGfo4z8sSv
	 KmEpobdEXHsm/khLDY50rSqOBEe1SU32UXZFQRzUHgd0aL0b0pb7huNuNFR/cr8BKcASu
	 1k9EXKaw9rzSTLD/A8gaGAOgUxEEAMzy6helKmMC0jxrcH3yAjANx4QW1TagUILgxvg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794807174;
	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=235IhKMChFexMr22e8JQ4l9QP0XQgT/y/XG+KObBuiI=;
	b=lAWGhjFOFEBzAEmj3pmfZ8kTib8dneljDDE08UZoGtJfY3kqKCPjGYAH5SmRBZHiqHmm
	 WVaumZ/imzl/axHBEgMdcdnbaE7a0BlKutR49cp7fCyXMAgmxLwRYxP6JDpl9OPnN/l4R
	 0H0EECn7NzD8jWI4CxLkcdbqlB1XU8aeDCNvaBJ0xHkvfopt+x4ziLuxurB5pLvFB4etR
	 hBjfDwttszjMCXr4EeuakmE8U8GOrP7rBqBJOIyxjgn1DmzJKwPw7ef27JDAhgxxQIzH7
	 1p1YlnwVlTJLDU8VT4e3MVIaR1NQgGameCMvYDWBxrG/KZNzYjgFipCllHRsJxfp6dA==
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="kVhYU/Q4";
	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 9AA64606A337;
	Mon, 16 Nov 2026 05:32:54 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E3021F000C4;
	Mon, 16 Nov 2026 05:32:53 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794807174;
	bh=235IhKMChFexMr22e8JQ4l9QP0XQgT/y/XG+KObBuiI=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=kVhYU/Q4IvyrjNAdXcQ8S0i5vceWWAa1QsAr6YoVk8LYWDG3Py+YM6tOt9d8FBuPQ
	 /UzTilpaa4bDEnkbrzNeOxSk6MWSYMzwB4J5HvCSYUH6ANuvTd1FIrvkGuwGy77jo9
	 7sUjgtMEwiCYnmoA1D4n7tX0T3bRrADdPFHrrwyj/l9+ZpDeXTdCFV8cEvKfTRc9t8
	 jesz/BjmmfR9AOF9mKAe2gcgeeMNCEM5YKsSqVABDxAArfDIBW/xjk7CWgnZ53GnDD
	 15n9Tcp5BwoCpKIe+mB//EXb8NpbOXS11fPLEduOyPb16ex1+kGj5eNv2cCmU/AXAp
	 nqfDqQTs7ZbyA==
X-Cc: netdev@vger.kernel.org, idosch@nvidia.com, kuba@kernel.org,
 pabeni@redhat.com, davem@davemloft.net, edumazet@kernel.org,
 andrew+netdev@lunn.ch, horms@kernel.org, razor@blackwall.org,
 roopa@nvidia.com, kuniyu@google.com, petrm@nvidia.com, aroulin@nvidia.com,
 shuah@kernel.org, linux-kselftest@vger.kernel.org,
 linux-kernel@vger.kernel.org
X-In-Reply-To: <20261114221412.255825-9-alishmery18@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