From: netdev-bot+sashiko@kernel.org
To: emmaonana18@gmail.com
Cc: tianyi@cloudflare.com, hangbin.liu@linux.dev, kuba@kernel.org,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
davem@davemloft.net, edumazet@kernel.org, pabeni@redhat.com,
horms@kernel.org, shuah@kernel.org, ast@kernel.org,
daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com,
sdf@fomichev.me, skhan@linuxfoundation.org,
kernel-team@cloudflare.com, tianyi.gao@linux.dev
Subject: Re: [PATCH net-next v6] selftests: net: veth: derive invalid-tx test value from kernel max
Date: Thu, 26 Nov 2026 09:19:21 +0000 [thread overview]
Message-ID: <179568476191.3135.16062946746480831699@kernel.org> (raw)
In-Reply-To: <20261124211645.5751-2-emmaonana18@gmail.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] chk_channels() in tools/testing/selftests/net/veth.sh (lines
175-196) prints " fail ..." on a mismatch but never sets `ret=1`.
- [Low] The commit message says that once "failure propagation" is fixed,
the false failure "fails the whole script".
--
selftests: net: veth: derive invalid-tx test value from kernel max
The "setting invalid channels nr" check in veth.sh used to try nproc+1
TX channels. It now reads the TX maximum the kernel reports through
ethtool -l and tries max+1. The old value can be valid on hosts where
nproc is less than num_possible_cpus().
> selftests: net: veth: derive invalid-tx test value from kernel max
>
> The "setting invalid channels nr" check treats CPUS+1 (CPUS=nproc)
> as an invalid tx count, but the kernel allows up to max_tx, for veth
[ ... ]
> the ethtool -L call succeeds and chk_channels() reports a false
> failure. With failure propagation fixed, this fails the whole script.
[Severity: Low]
Which patch provides the failure propagation fix mentioned here? In this
tree, chk_channels() only echoes on a mismatch and never sets ret=1:
tools/testing/selftests/net/veth.sh:chk_channels() {
...
if [ "$cur_rx" = "$rx" -a "$cur_tx" = "$tx" -a "$cur_combined" = "n/a" ]; then
echo " ok "
else
echo " fail rx:$rx:$cur_rx tx:$tx:$cur_tx combined:n/a:$cur_combined"
fi
}
So before this patch, the CPUS+1 false positive printed a misleading
"fail" line, but veth.sh still exited with 0.
Suppose the failure propagation change is applied or backported to
stable without this patch. Then veth.sh would fail on hosts where nproc
is less than num_possible_cpus(). veth_get_channels() reports max_tx as
dev->num_tx_queues, and ethnl_set_channels() only rejects
tx_count > max_tx.
Could the two changes go in the same series, or could this one name the
dependency? Could it also carry a Fixes tag for the commit that added
the CPUS + 1 value?
Fixes: 1ec2230fc721 ("selftests: net: veth: add tests for set_channel")
> diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
> index 9496b599d722c..bd0d19c49b7cd 100755
> --- a/tools/testing/selftests/net/veth.sh
> +++ b/tools/testing/selftests/net/veth.sh
> @@ -569,7 +569,9 @@ fi
> ip netns exec $NS_DST ethtool -L veth$DST combined 2 2>/dev/null
> chk_channels "bad setting: combined channels" $DST $CUR_RX $CUR_TX
>
> -ip netns exec $NS_DST ethtool -L veth$DST tx $((CPUS + 1)) 2>/dev/null
> +MAX_TX=`ip netns exec $NS_DST ethtool -l veth$DST |\
> + grep TX: | head -n 1 | awk '{print $2}'`
> +ip netns exec $NS_DST ethtool -L veth$DST tx $((MAX_TX + 1)) 2>/dev/null
> chk_channels "setting invalid channels nr" $DST $CUR_RX $CUR_TX
[Severity: Medium]
Can this check ever change the test result? The other checkers in
veth.sh set ret=1 on failure, for example chk_napi_ids(), and
chk_channels_carrier is called with "|| ret=1". chk_channels() does
not set ret at all.
The script ends with exit $ret. Suppose the tx_count > max_tx check in
ethnl_set_channels() or ethtool_set_channels() regressed, and
ethtool -L tx $((MAX_TX + 1)) were accepted. veth.sh would print "fail"
and still report success to kselftest.
The same applies to the other chk_channels() checks: "setting tx
channels", "setting both rx and tx channels" and "bad setting: combined
channels".
The commit message relies on failure propagation being fixed. Should
that change be part of this submission, so the updated check actually
affects the exit status?
>
> if [ $CPUS -gt 1 ]; then
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124211645.5751-2-emmaonana18%40gmail.com
next prev parent reply other threads:[~2026-11-26 9:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 21:16 [PATCH net-next v6 0/2] selftests: net: veth: propagate check failures to exit status Omokefe Emmanuel Onanaroghene
2026-11-24 21:16 ` [PATCH net-next v6] selftests: net: veth: derive invalid-tx test value from kernel max Omokefe Emmanuel Onanaroghene
2026-11-26 9:19 ` netdev-bot+sashiko [this message]
2026-11-24 21:16 ` [PATCH net-next v6 2/2] selftests: net: veth: propagate check failures to exit status Omokefe Emmanuel Onanaroghene
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=179568476191.3135.16062946746480831699@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=emmaonana18@gmail.com \
--cc=hangbin.liu@linux.dev \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@cloudflare.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=tianyi.gao@linux.dev \
--cc=tianyi@cloudflare.com \
/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®