From: netdev-bot+sashiko@kernel.org
To: alishmery18@gmail.com
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
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 [thread overview]
Message-ID: <179480717303.3136.3539186076980782462@kernel.org> (raw)
In-Reply-To: <20261114221412.255825-9-alishmery18@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] 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
prev parent reply other threads:[~2026-11-16 5:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 22:14 [PATCH net-next v5 0/8] vxlan: vnifilter: bound a single request and account per-VNI memory Ali Firas
2026-11-14 22:14 ` [PATCH net-next v5 1/8] vxlan: vnifilter: reject VNIs outside the 24-bit space Ali Firas
2026-11-14 22:14 ` [PATCH net-next v5 2/8] vxlan: vnifilter: clamp the dumped VNI range to the request limit Ali Firas
2026-11-14 22:14 ` [PATCH net-next v5 3/8] vxlan: vnifilter: bound the number of VNIs one request may touch Ali Firas
2026-11-16 5:32 ` netdev-bot+sashiko
2026-11-14 22:14 ` [PATCH net-next v5 4/8] vxlan: vnifilter: account per-VNI memory to memcg Ali Firas
2026-11-14 22:14 ` [PATCH net-next v5 5/8] vxlan: leave FDB state and flags unchanged when an update fails Ali Firas
2026-11-16 5:32 ` netdev-bot+sashiko
2026-11-14 22:14 ` [PATCH net-next v5 6/8] vxlan: vnifilter: roll back a VNI add that fails Ali Firas
2026-11-14 22:14 ` [PATCH net-next v5 7/8] vxlan: vnifilter: account the default FDB entry to memcg Ali Firas
2026-11-14 22:14 ` [PATCH net-next v5 8/8] selftests: net: test the vxlan vnifilter request limit and dump replay Ali Firas
2026-11-16 5:32 ` 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=179480717303.3136.3539186076980782462@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=alishmery18@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=aroulin@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.com \
--cc=razor@blackwall.org \
--cc=roopa@nvidia.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
all inboxes | Powered by JetHome®