From: Konstantin Khorenko <khorenko@virtuozzo.com>
To: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
Cc: devel@openvz.org
Subject: Re: [Devel] [PATCH vz10 3/3] selftests: drv-net: read the channel count over netlink
Date: Thu, 24 Sep 2026 13:53:20 +0200 [thread overview]
Message-ID: <179025080051.3192281.14851162512684346903.b4-review@b4> (raw)
In-Reply-To: <20260831234411.1649762-3-eva.kurchatova@virtuozzo.com>
> napi_threaded needs the number of combined channels of the device and
> asks ethtool to print it as JSON. Not every ethtool prints that one:
> ethtool 6.11 does it for -k, -a, -c, -g and -x, but not for -l, and
> the test ends in the first case:
>
> CmdExitFailure: Command failed: ethtool --json -l eth4
> STDERR: b'ethtool: bad command line argument(s)
> JSON output not available for this subcommand
>
> not ok 1 napi_threaded.napi_init
>
> Ask the kernel for the count over netlink, which is where ethtool reads
> it too, so the test no longer depends on the ethtool version installed.
> Changing the count stays with ethtool -L, which needs no JSON. No other
> test in the group asks ethtool for something it cannot print, so this is
> the only one that needs it.
>
> https://virtuozzo.atlassian.net/browse/VSTOR-139651
> Feature: fix selftests
> Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
>
> diff --git a/tools/testing/selftests/drivers/net/napi_threaded.py b/tools/testing/selftests/drivers/net/napi_threaded.py
> index ed66efa481b0f..73c81a319b49f 100755
> --- a/tools/testing/selftests/drivers/net/napi_threaded.py
> +++ b/tools/testing/selftests/drivers/net/napi_threaded.py
> @@ -7,7 +7,7 @@ Test napi threaded states.
>
> from lib.py import ksft_run, ksft_exit
> from lib.py import ksft_eq, ksft_ne, ksft_ge
> -from lib.py import NetDrvEnv, NetdevFamily
> +from lib.py import EthtoolFamily, NetDrvEnv, NetdevFamily
> from lib.py import cmd, defer, ethtool
>
>
> @@ -28,7 +28,13 @@ from lib.py import cmd, defer, ethtool
>
>
> def _setup_deferred_cleanup(cfg) -> None:
> - combined = ethtool(f"-l {cfg.ifname}", json=True)[0].get("combined", 0)
> + # Not every ethtool prints the channel counts as JSON, the one on
> + # the test machine here does not:
> + # ethtool: bad command line argument(s)
> + # JSON output not available for this subcommand
> + # Ask the kernel for them instead, it is the same number.
The long description with error messages examples should be in the commit
message, not in the code comment. A short comment like
"not every ethtool prints -l as JSON, ask the kernel"
should be enough.
--
Konstantin Khorenko <khorenko@virtuozzo.com>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-09-24 11:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-31 23:43 [Devel] [PATCH vz10 1/3] selftests: drv-net: let NetDrvEnv take nsim_test Eva Kurchatova
2026-08-31 23:43 ` [Devel] [PATCH vz10 2/3] selftests: drv-net: run ping in its own netns Eva Kurchatova
2026-09-24 11:53 ` Konstantin Khorenko
2026-08-31 23:43 ` [Devel] [PATCH vz10 3/3] selftests: drv-net: read the channel count over netlink Eva Kurchatova
2026-09-24 11:53 ` Konstantin Khorenko [this message]
2026-09-24 11:53 ` [Devel] [PATCH vz10 1/3] selftests: drv-net: let NetDrvEnv take nsim_test Konstantin Khorenko
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=179025080051.3192281.14851162512684346903.b4-review@b4 \
--to=khorenko@virtuozzo.com \
--cc=devel@openvz.org \
--cc=eva.kurchatova@virtuozzo.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