From: netdev-bot+sashiko@kernel.org
To: jiayuan.chen@linux.dev
Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, john.fastabend@gmail.com, sd@queasysnail.net,
shuah@kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v3 2/2] selftests: drv-net: run tls_hw_offload on netdevsim
Date: Fri, 20 Nov 2026 06:51:23 +0000 [thread overview]
Message-ID: <179515748385.3136.10275675955381531740@kernel.org> (raw)
In-Reply-To: <20261119064902.242502-3-jiayuan.chen@linux.dev>
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] In read_nic_stats()
(tools/testing/selftests/drivers/net/hw/tls_hw_offload.py:128-131),…
- [Low] Several comments still describe a real-hardware-only setup, but
after this patch the default run (no NETIF) uses a netdevsim pair that…
--
selftests: drv-net: run tls_hw_offload on netdevsim
This drops nsim_test=False from tls_hw_offload.py, so the test runs on the
default netdevsim pair when NETIF is not set. It also makes
read_nic_stats() skip the ethtool -S snapshot when a local netdevsim
device was created by the environment.
> diff --git a/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py b/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py
> index e720ce6547610..1197f17caa13c 100755
> --- a/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py
> +++ b/tools/testing/selftests/drivers/net/hw/tls_hw_offload.py
> @@ -125,6 +125,9 @@ def read_nic_stats(cfg):
> # before/after-delta caveat as read_tls_stats(): these are device-wide,
> # so concurrent kTLS traffic on this NIC would perturb the deltas.
> stats = defaultdict(int)
> + # netdevsim has no ethtool -S, and the NIC counters below are optional
> + if cfg.get_local_nsim_dev():
> + return stats
> output = cmd(f"ethtool -S {cfg.ifname}").stdout
[Severity: Medium]
Does this guard check the right thing? The comment is about the driver,
but get_local_nsim_dev() only returns self._ns. That is set only by
create_local() when NETIF is not in the environment:
tools/testing/selftests/drivers/net/lib/py/env.py:NetDrvEpEnv.__init__() {
...
self._ns = None
...
if "NETIF" in self.env:
if nsim_test is True:
raise KsftXfailEx("Test only works on netdevsim")
self._check_env()
...
}
If NETIF names a netdevsim port, self._ns stays None. The test then falls
through to cmd("ethtool -S ...") with the default fail=True. netdevsim
has no get_sset_count, get_strings or get_ethtool_stats, so ethtool exits
non-zero and cmd() raises CmdExitFailure. run_tls_test() does not catch
it, so all 8 variants fail at the first snapshot. Any other TLS-offload
netdev without ethtool stats would fail the same way.
The test header already says these counters are optional:
# counters. Each counter is checked only when present.
...
# Missing NIC crypto counters remain optional.
The get_local_nsim_dev() docstring also discourages this kind of use:
Using this method is discouraged, as it makes tests nsim-specific.
Standard interfaces available on all HW should ideally be used.
Would a driver-agnostic check be simpler? For example, run ethtool -S
with fail=False and return the empty stats dict on a non-zero exit. That
would cover the default nsim pair, NETIF=netdevsim and any stats-less
driver, with about the same amount of code. The commit message mentions
the NETIF case but doesn't say why the environment check was chosen
over a capability check.
[ ... ]
> @@ -307,7 +310,7 @@ def test_tls_offload_record_type(cfg, record_type):
>
> def main() -> None:
> """Set up the DUT/peer environment and run the offload test suites."""
> - with NetDrvEpEnv(__file__, nsim_test=False) as cfg:
> + with NetDrvEpEnv(__file__) as cfg:
[Severity: Low]
This isn't a bug, but with netdevsim now the default environment, a few
comments still describe a real-hardware-only setup. Should they be
updated?
The comment in read_tls_stats() says:
# sock_net(sk)). The test runs on a real NIC in the host namespace, so
The header of tls_hw_offload.c says:
* Tests kTLS hardware offload between two physical nodes using
The run_tls_test() docstring says the remote:
source/sink and may run any kernel without HW offload. Both sides run
On netdevsim this isn't true. drivers/net/netdevsim/tls.c says:
/* Emulated kTLS offload. No crypto is performed: TX puts the record on the
* wire as plaintext, so the RX side has to be offloaded on netdevsim as
* well, otherwise the core runs the software AEAD over plaintext and fails
* the connection with -EBADMSG.
So on the default nsim path, the peer has to receive with HW offload.
If its RX offload were turned off, the test would fail, even though the
docstring says that setup is allowed.
> cfg.bin_local = cfg.test_dir / "tls_hw_offload"
> cfg.bin_remote = None
> cfg.tls_skip_reason = None
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119064902.242502-1-jiayuan.chen%40linux.dev
prev parent reply other threads:[~2026-11-20 6:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 6:48 [PATCH net-next v3 0/2] netdevsim: add TLS device offload emulation and test Jiayuan Chen
2026-11-19 6:48 ` [PATCH net-next v3 1/2] netdevsim: add TLS device offload emulation Jiayuan Chen
2026-11-20 6:51 ` netdev-bot+sashiko
2026-11-19 6:48 ` [PATCH net-next v3 2/2] selftests: drv-net: run tls_hw_offload on netdevsim Jiayuan Chen
2026-11-20 6:51 ` 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=179515748385.3136.10275675955381531740@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=jiayuan.chen@linux.dev \
--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=sd@queasysnail.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.