From: netdev-bot+sashiko@kernel.org
To: sdf.kernel@gmail.com
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, andrew+netdev@lunn.ch,
edumazet@kernel.org, shuah@kernel.org, sdf@fomichev.me,
bjorn@kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v2 3/4] selftests: drv-net: add a kperf stream test
Date: Tue, 01 Dec 2026 18:10:30 +0000 [thread overview]
Message-ID: <179614863027.3146.1700516544609872670@kernel.org> (raw)
In-Reply-To: <20261130174609.314114-4-sdf.kernel@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] The "zerocopy" variant of tcp() in stream.py adds "--msg-
zerocopy" and "--zerocopy-rx".
- [Low] The commit message for stream.py says it measures one TCP
connection "with the same settings as devmem.py otherwise".
--
selftests: drv-net: add a kperf stream test
This adds stream.py, a drv-net perf selftest that uses kperf to measure
the throughput of a single TCP connection. It has two variants: plain
copy, and MSG_ZEROCOPY on the sender with TCP_ZEROCOPY_RECEIVE on the
receiver.
> Add stream.py, which measures the throughput of one TCP connection with
> kperf, with the same settings as devmem.py otherwise: once over copying
> sockets, and once with MSG_ZEROCOPY on the sender and
> TCP_ZEROCOPY_RECEIVE on the receiver.
[Severity: Low]
Is "with the same settings as devmem.py otherwise" accurate?
The two tests share the kperf client options: --time 15, the 64 MiB read
and write sizes, --pin-off 4 and --validate no.
devmem.py's kperf() also sets up the device before it measures:
tools/testing/selftests/drivers/net/perf/devmem.py:kperf() {
...
_enable_hw_gro(cfg)
...
"tcp-data-split": "enabled",
...
config["hds-thresh"] = 0
defer(ethnl.rings_set, restore)
ethnl.rings_set(config)
...
"--num-rx-queues", "4",
...
}
stream.py's tcp() does none of this, so it runs with the driver's
default GRO, HDS and RSS settings. The message only mentions the change
from 4 connections to 1.
Could the message say that the device-level setup also differs? Then the
stream.py and devmem.py numbers wouldn't be read as directly comparable.
> diff --git a/tools/testing/selftests/drivers/net/perf/stream.py b/tools/testing/selftests/drivers/net/perf/stream.py
> new file mode 100755
> index 0000000000000..4ed9d64dfa320
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/perf/stream.py
> @@ -0,0 +1,40 @@
[ ... ]
> +@ksft_variants([
> + KsftNamedVariant("copy", []),
> + KsftNamedVariant("zerocopy", ["--msg-zerocopy", "--zerocopy-rx"]),
> +])
> +def tcp(cfg, mode_args) -> None:
> + """Measure the throughput of one TCP connection."""
> + stream_args = [
[ ... ]
> + with KperfRunner(cfg) as runner:
> + result = runner.run(stream_args)
> +
> + ksft_metric("throughput", result.target_throughput, goal="higher")
[Severity: Medium]
Does the zerocopy variant actually exercise TCP_ZEROCOPY_RECEIVE on a
device with default settings?
The variant only adds kperf flags. On the kernel side, can_map_frag()
only maps full-page frags at offset 0:
net/ipv4/tcp.c:can_map_frag() {
...
if (skb_frag_size(frag) != PAGE_SIZE || skb_frag_off(frag))
return false;
...
}
NICs normally produce frags like that only with header-data split and an
MTU large enough for page-sized payloads. stream.py sets neither.
devmem.py at least enables tcp-data-split.
With no HDS and a 1500 MTU, every payload frag fails can_map_frag().
tcp_zerocopy_receive() then maps nothing, and the receiver copies the
data instead.
Nothing here checks whether zerocopy happened. KperfRunner.parse() in
drivers/net/lib/py/kperf.py only extracts throughput, rate and latency:
return KperfResult(sum(throughput["Source"]),
sum(throughput["Target"]), **rr)
tcp() then reports only the throughput metric.
Can the "zerocopy" result come from the copy receive path and still be
labelled zerocopy? If so, a loss of TCP_ZEROCOPY_RECEIVE, or a
regression in it, would not show up in this sub-case.
If kperf fails instead of falling back when nothing can be mapped,
wouldn't this variant fail on most default setups?
Would it make sense to enable HDS (and possibly raise the MTU) for this
variant? Another option is to check that pages were actually mapped, or
that SO_EE_CODE_ZEROCOPY_COPIED was not reported.
[ ... ]
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261130174609.314114-1-sdf.kernel%40gmail.com
next prev parent reply other threads:[~2026-12-01 18:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 17:46 [PATCH net-next v2 0/4] selftests: replace iperf with kperf and add RR Stanislav Fomichev
2026-11-30 17:46 ` [PATCH net-next v2 1/4] selftests: drv-net: kperf: support request-response tests Stanislav Fomichev
2026-12-01 18:10 ` netdev-bot+sashiko
2026-11-30 17:46 ` [PATCH net-next v2 2/4] selftests: drv-net: add a closed-loop request-response test Stanislav Fomichev
2026-12-01 18:10 ` netdev-bot+sashiko
2026-11-30 17:46 ` [PATCH net-next v2 3/4] selftests: drv-net: add a kperf stream test Stanislav Fomichev
2026-12-01 18:10 ` netdev-bot+sashiko [this message]
2026-11-30 17:46 ` [PATCH net-next v2 4/4] selftests: drv-net: remove the iperf performance test Stanislav Fomichev
2026-12-01 8:07 ` [PATCH net-next v2 0/4] selftests: replace iperf with kperf and add RR Björn Töpel
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=179614863027.3146.1700516544609872670@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bjorn@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=edumazet@kernel.org \
--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.kernel@gmail.com \
--cc=sdf@fomichev.me \
--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