Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: emmaonana18@gmail.com
Cc: tianyi@cloudflare.com, hangbin.liu@linux.dev,
	netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
	kuba@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
Subject: Re: [PATCH net v3 1/2] selftests: net: veth: propagate channel-check failures to exit status
Date: Thu, 19 Nov 2026 00:40:36 +0000	[thread overview]
Message-ID: <179504883686.3136.13611151498828489972@kernel.org> (raw)
In-Reply-To: <20261116084107.6675-2-emmaonana18@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 0

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] The patch adds `ret=1` to the mismatch branch of
  chk_channels() in tools/testing/selftests/net/veth.sh (line 133).

--

selftests: net: veth: propagate channel-check failures to exit status

This commit makes chk_channels() in veth.sh set ret=1 when the observed
channel counts do not match the expected ones. With it, any channel
mismatch makes the script exit with a non-zero status.

> diff --git a/tools/testing/selftests/net/veth.sh b/tools/testing/selftests/net/veth.sh
> index 64c2a5a59821d..5c1dbe1516bb4 100755
> --- a/tools/testing/selftests/net/veth.sh
> +++ b/tools/testing/selftests/net/veth.sh
> @@ -130,6 +130,7 @@ chk_channels() {
>  		echo " ok "
>  	else
>  		echo " fail rx:$rx:$cur_rx tx:$tx:$cur_tx combined:n/a:$cur_combined"
> +		ret=1
>  	fi
>  }
>  

[Severity: Medium]
With this change, can a check whose result depends on the test environment
now fail the whole veth.sh run?

The "setting invalid channels nr" check expects a request for CPUS + 1 TX
queues to be rejected. CPUS comes from nproc:

    readonly CPUS=`nproc`
    ...
    ip netns exec $NS_DST ethtool -L veth$DST tx $((CPUS + 1)) 2>/dev/null
    chk_channels "setting invalid channels nr" $DST $CUR_RX $CUR_TX

The veth queue limit is num_possible_cpus(), capped at 4096. It is not the
number of CPUs the process can use:

drivers/net/veth.c:veth_get_num_queues() {
	/* enforce the same queue limit as rtnl_create_link */
	int queues = num_possible_cpus();
    ...
}

veth_get_channels() reports dev->num_tx_queues as max_tx. The ethtool core
in net/ethtool/channels.c only rejects tx_count > max_tx.

nproc returns the number of CPUs the process can use. That can be smaller
than the number of possible CPUs on machines with hot-pluggable CPU slots,
or when the test runs under taskset or a restricted cpuset.

In those cases the request is valid. No XDP program is attached at that
point, so veth_set_channels() accepts it and real_num_tx_queues becomes
CPUS + 1. chk_channels() then sees cur_tx != $CUR_TX, and with this patch
veth.sh exits 1.

Before this patch, the mismatch only printed a fail line. The later patch
in the series ("selftests: net: veth: propagate bad-settings check
failures to exit status") does not change this check.

Could the out-of-range value come from the device's advertised maximum
instead of nproc? For example, the "Pre-set maximums" TX value from
ethtool -l, plus one.

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

  reply	other threads:[~2026-11-19  0:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15 21:47 [PATCH net v2] selftests: net: veth: propagate channel-check failures to exit status Omokefe Emmanuel Onanaroghene
2026-11-16  0:45 ` Tianyi Gao
2026-11-16  0:56   ` Hangbin Liu
2026-11-16  8:41   ` [PATCH net v3 0/2] selftests: net: veth: propagate check " Omokefe Emmanuel Onanaroghene
2026-11-16  8:41     ` [PATCH net v3 1/2] selftests: net: veth: propagate channel-check " Omokefe Emmanuel Onanaroghene
2026-11-19  0:40       ` netdev-bot+sashiko [this message]
2026-11-16  8:41     ` [PATCH net v3 2/2] selftests: net: veth: propagate bad-settings check " Omokefe Emmanuel Onanaroghene
2026-11-16 14:04       ` Tianyi Gao
2026-11-19  0:29         ` [PATCH net v4 0/3] selftests: net: veth: propagate " Omokefe Emmanuel Onanaroghene
2026-11-19  0:30           ` [PATCH net v4 1/3] selftests: net: veth: propagate channel-check " Omokefe Emmanuel Onanaroghene
2026-11-19  0:30           ` [PATCH net v4 2/3] selftests: net: veth: propagate bad-settings check " Omokefe Emmanuel Onanaroghene
2026-11-19  0:30           ` [PATCH] selftests: net: veth: derive invalid-tx test value from kernel max Omokefe Emmanuel Onanaroghene
2026-11-19  1:29           ` [PATCH net v4 0/3] selftests: net: veth: propagate check failures to exit status Tianyi Gao
2026-11-19 21:12             ` Jakub Kicinski
2026-11-16 13:08     ` [PATCH net v3 0/2] " Tianyi Gao
2026-11-16 21:50 ` [PATCH net v2] selftests: net: veth: propagate channel-check " netdev-bot+sashiko
2026-11-19  0:40   ` 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=179504883686.3136.13611151498828489972@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=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@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