selftests: replace iperf with kperf and add RR
Subsystems (3)
cover selftests: replace iperf with kperf and add RR
Recently added iperf throughput runs (918696-924166) have not been stable:
ktap-metric-json: {"goal":"higher","name":"throughput","value":99.60508305201279}
ktap-metric-json: {"goal":"higher","name":"throughput","value":90.65816851430006}
ktap-metric-json: {"goal":"higher","name":"throughput","value":92.02795621872379}
ktap-metric-json: {"goal":"higher","name":"throughput","value":98.78863365714747}
ktap-metric-json: {"goal":"higher","name":"throughput","value":103.38157195808748}
ktap-metric-json: {"goal":"higher","name":"throughput","value":93.64137239021106}
ktap-metric-json: {"goal":"higher","name":"throughput","value":101.73578035463773}
ktap-metric-json: {"goal":"higher","name":"throughput","value":78.15304223077422}
ktap-metric-json: {"goal":"higher","name":"throughput","value":103.79536587818043}
ktap-metric-json: {"goal":"higher","name":"throughput","value":91.48843017237692}
ktap-metric-json: {"goal":"higher","name":"throughput","value":75.27885187718259}
ktap-metric-json: {"goal":"higher","name":"throughput","value":103.5323033205535}
ktap-metric-json: {"goal":"higher","name":"throughput","value":92.04284599832805}
Compared to kperf devmem:
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.588}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.63}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.606}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.594}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.54}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.594}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.552}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.561}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.616}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.63}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.532}
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.62}
This is most likely due to --pin-off we are doing with kperf. So replace iperf with kperf (add regular and zerocopy variants).
At the same time, add closed loop RR stats to estimate the amount PPS we can take (so I can follow up with open loop RR).
Stanislav Fomichev (4):
selftests: drv-net: kperf: support request-response tests
selftests: drv-net: add a closed-loop request-response test
selftests: drv-net: add a kperf stream test
selftests: drv-net: remove the iperf performance test
.../selftests/drivers/net/lib/py/kperf.py | 31 +++++++++++- .../selftests/drivers/net/perf/Makefile | 3 +- .../selftests/drivers/net/perf/iperf.py | 23 --------- .../testing/selftests/drivers/net/perf/rr.py | 47 +++++++++++++++++++ .../selftests/drivers/net/perf/stream.py | 40 ++++++++++++++++ 5 files changed, 118 insertions(+), 26 deletions(-) delete mode 100755 tools/testing/selftests/drivers/net/perf/iperf.py create mode 100755 tools/testing/selftests/drivers/net/perf/rr.py create mode 100755 tools/testing/selftests/drivers/net/perf/stream.py
Signature · 1 line
2.53.1-Meta
PATCH 1/4 selftests: drv-net: kperf: support request-response tests
Let KperfResult tell the rate of the transactions of request-response tests and, when the client is asked for them with --time-stats 2, their latency percentiles and maximum, as seen by the source, which sends the requests. Request-response tests run a single flow; of more, the first one is kept.
--- .../selftests/drivers/net/lib/py/kperf.py | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
tools/testing/selftests/drivers/net/lib/py/kperf.py +29 -2
@@ -7,20 +7,35 @@ import shlex import subprocess import uuid from dataclasses import dataclass +from typing import Optional from lib.py import cmd, ksft_pr, rand_port, wait_port_listen _SECTION_RE = re.compile(r"==\s+(Source|Target)\b") _RATE_RE = re.compile(r"\b(Tx|Rx)\s*([0-9]+(?:\.[0-9]+)?)\s+Gbps\b") +_RPS_RE = re.compile(r"\b([0-9]+(?:\.[0-9]+)?) RPS\b") +_LAT_RE = re.compile( + r"\b(p25|p50|p90|p99|p999|p9999|max):([0-9]+(?:\.[0-9]+)?)us\b") @dataclass class KperfResult: - """Aggregate throughput (Gbps) of both endpoints.""" + """Aggregate throughput (Gbps) of both endpoints. Request-response tests + also tell the rate (per second) of the source, which sends the requests, + and with --time-stats 2 its latencies (usec). + """ source_throughput: float target_throughput: float + rate: Optional[float] = None + p25: Optional[float] = None + p50: Optional[float] = None + p90: Optional[float] = None + p99: Optional[float] = None + p999: Optional[float] = None + p9999: Optional[float] = None + lat_max: Optional[float] = None class KperfRunner:
@@ -133,6 +148,7 @@ _RATE_RE = re.compile(r"\b(Tx|Rx)\s*([0-9]+(?:\.[0-9]+)?)\s+Gbps\b") def parse(output): """Parse human-readable kperf client output.""" throughput = {"Source": [], "Target": []} + rr = {} section = None for line in output.splitlines():
@@ -149,9 +165,20 @@ _RATE_RE = re.compile(r"\b(Tx|Rx)\s*([0-9]+(?:\.[0-9]+)?)\s+Gbps\b") if (section, direction) in (("Source", "Tx"), ("Target", "Rx")): throughput[section].append(float(value)) + if section != "Source": + continue + + # Request-response tests run a single flow, take the first one + # and ignore the rest + match = _RPS_RE.search(line) + if match: + rr.setdefault("rate", float(match.group(1))) + for name, value in _LAT_RE.findall(line): + key = "lat_max" if name == "max" else name + rr.setdefault(key, float(value)) if not all(throughput.values()): raise ValueError("incomplete kperf result") return KperfResult(sum(throughput["Source"]), - sum(throughput["Target"])) + sum(throughput["Target"]), **rr)
Signature · 1 line
2.53.1-Meta
[email protected]
AI reviewRe: [PATCH net-next 1/4] selftests: drv-net: kperf: support request-response tests
Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you…
Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The author and sign-off addresses do not match.
- [Low] In KperfRunner.parse() (tools/testing/selftests/drivers/net/lib/py/kperf.py), the commit…
--
selftests: drv-net: kperf: support request-response tests
This commit adds an optional transaction rate and latency percentiles to KperfResult for request-response tests. KperfRunner.parse() takes these values from the Source section of the kperf client output.
Quoted 3 lines
Author: Stanislav Fomichev <[email protected]>
[ ... ]Signed-off-by Stanislav Fomichev <[email protected]>
[Severity: Low]
This isn't a bug, but the author address and the Signed-off-by address are different. The author is [email protected] and the only sign-off uses [email protected].
checkpatch.pl reports this as FROM_SIGN_OFF_MISMATCH.
The other patches in the series have the same mismatch:
selftests: drv-net: add a closed-loop request-response test
selftests: drv-net: add a kperf stream test
selftests: drv-net: remove the iperf performance test
Could the author be changed to [email protected], or a Signed-off-by be added with the gmail address?
Quoted 4 lines
tools/testing/selftests/drivers/net/lib/py/kperf.py +0
-0
[ ... ]
Quoted 5 lines
tools/testing/selftests/drivers/net/lib/py/kperf.py +1
-0@@ -149,9 +165,20 @@ class KperfRunner: if (section, direction) in (("Source", "Tx"), ("Target", "Rx")): throughput[section].append(float(value)) + if section != "Source":
tools/testing/selftests/drivers/net/lib/py/kperf.py class KperfRunner: · line 178
Quoted 10 lines
tools/testing/selftests/drivers/net/lib/py/kperf.py +10
-0+ continue + + # Request-response tests run a single flow, take the first one + # and ignore the rest + match = _RPS_RE.search(line) + if match: + rr.setdefault("rate", float(match.group(1))) + for name, value in _LAT_RE.findall(line): + key = "lat_max" if name == "max" else name + rr.setdefault(key, float(value))
[Severity: Low]
Does this really keep the first flow? The comment above says so, and so does the commit message:
Request-response tests run a single flow; of more, the first one is kept.
KperfRunner.parse() doesn't track where one flow ends and the next begins. It scans every line in the Source section. Each RPS and latency match is stored with rr.setdefault(key, ...), so what you get is the first occurrence of each metric. That is not the same as the metrics of the first flow.
Suppose the first flow's lines don't include every key (RPS, p25 through p9999, max). Or suppose kperf prints a summary RPS or latency line before the per-flow lines. Could one KperfResult then mix values from different flows, or from a summary line?
The KperfResult docstring also calls these values the source's rate and latencies. It doesn't mention that each one is taken per key.
rr.py is the only in-tree caller, and it passes "--num-connections 1", so the series as submitted doesn't hit this. Would it be worth stopping explicitly at the end of the first flow? The other option is to describe the per-key behaviour in the comment and in the KperfResult docstring.
Quoted 7 lines
tools/testing/selftests/drivers/net/lib/py/kperf.py +1
-1if not all(throughput.values()): raise ValueError("incomplete kperf result") return KperfResult(sum(throughput["Source"]), - sum(throughput["Target"])) + sum(throughput["Target"]), **rr)
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123174120.505808-1-sdf%40fomichev.me
Re: [PATCH net-next 1/4] selftests: drv-net: kperf: support request-response tests
Quoted 79 lines · On 11/24, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The author and sign-off addresses do not match.
- [Low] InKperfRunner.parse()(tools/testing/selftests/drivers/net/lib/py/kperf.py), the commit…--
selftests: drv-net: kperf: support request-response tests
This commit adds an optional transaction rate and latency percentiles to KperfResult for request-response tests.
KperfRunner.parse()takes these values from the Source section of the kperf client output.Quoted 3 lines
Author: Stanislav Fomichev <[email protected]>
[ ... ]Signed-off-by Stanislav Fomichev <[email protected]>[Severity: Low]
This isn't a bug, but the author address and the Signed-off-by address are different. The author is [email protected] and the only sign-off uses [email protected].checkpatch.pl reports this as
FROM_SIGN_OFF_MISMATCH.The other patches in the series have the same mismatch:
selftests: drv-net: add a closed-loop request-response test
selftests: drv-net: add a kperf stream test
selftests: drv-net: remove the iperf performance testCould the author be changed to [email protected], or a Signed-off-by be added with the gmail address?
Quoted 4 lines
tools/testing/selftests/drivers/net/lib/py/kperf.py +0
-0[ ... ]
Quoted 5 lines
tools/testing/selftests/drivers/net/lib/py/kperf.py +1
-0@@ -149,9 +165,20 @@ class KperfRunner: if (section, direction) in (("Source", "Tx"), ("Target", "Rx")): throughput[section].append(float(value)) + if section != "Source":tools/testing/selftests/drivers/net/lib/py/kperf.py class KperfRunner: · line 178
Quoted 10 lines
tools/testing/selftests/drivers/net/lib/py/kperf.py +10
-0+ continue + + # Request-response tests run a single flow, take the first one + # and ignore the rest + match = _RPS_RE.search(line) + if match: + rr.setdefault("rate", float(match.group(1))) + for name, value in _LAT_RE.findall(line): + key = "lat_max" if name == "max" else name + rr.setdefault(key, float(value))[Severity: Low]
Does this really keep the first flow? The comment above says so, and so does the commit message:Request-response tests run a single flow; of more, the first one is kept.
KperfRunner.parse()doesn't track where one flow ends and the next begins. It scans every line in the Source section. Each RPS and latency match is stored withrr.setdefault(key, ...), so what you get is the first occurrence of each metric. That is not the same as the metrics of the first flow.Suppose the first flow's lines don't include every key (RPS, p25 through p9999, max). Or suppose kperf prints a summary RPS or latency line before the per-flow lines. Could one KperfResult then mix values from different flows, or from a summary line?
Quoted 7 lines
The KperfResult docstring also calls these values the source's rate and latencies. It doesn't mention that each one is taken per key.
rr.pyis the only in-tree caller, and it passes "--num-connections 1", so the series as submitted doesn't hit this. Would it be worth stopping explicitly at the end of the first flow? The other option is to describe the per-key behaviour in the comment and in the KperfResult docstring.
"First reported by kperf", and we want callers to pass --num-connections 1, yes.
PATCH 2/4 selftests: drv-net: add a closed-loop request-response test
In reply to Stanislav FomichevAdd rr.py, which measures back-to-back transactions of a kilobyte each way, which fits in a 1500 byte MTU, over one connection with kperf, and reports their rate and the latency percentiles and maximum which kperf reports.
--- .../selftests/drivers/net/perf/Makefile | 1 + .../testing/selftests/drivers/net/perf/rr.py | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100755 tools/testing/selftests/drivers/net/perf/rr.py
tools/testing/selftests/drivers/net/perf/Makefile +1 -0
@@ -3,6 +3,7 @@ TEST_PROGS := \ devmem.py \ iperf.py \ + rr.py \ # end of TEST_PROGS TEST_INCLUDES := \
tools/testing/selftests/drivers/net/perf/rr.py new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.53.1-Meta
[email protected]
AI reviewRe: [PATCH net-next 2/4] selftests: drv-net: add a closed-loop request-response test
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.
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] rr.py's closed_loop()/_report() pass the request-response fields of KperfResult (rate, p25, p50, p90, p99, p999, p9999, lat_max)…
- [Low] The commit author is 'Stanislav Fomichev <[email protected]>', but the only Signed-off-by is 'Stanislav Fomichev <[email protected]>'.
--
selftests: drv-net: add a closed-loop request-response test
This adds rr.py to the drv-net perf selftests. It runs kperf over one connection with 1 KiB requests and responses, then reports the transaction rate and kperf's latency percentiles and maximum as ksft metrics.
Quoted 1 line
Signed-off-by Stanislav Fomichev <[email protected]>
[Severity: Low]
This isn't a bug, but the author address and the sign-off address do not match:
Author: Stanislav Fomichev <[email protected]>
The body has no in-body From: line either, so checkpatch will report FROM_SIGN_OFF_MISMATCH. The other patches in the series have the same mismatch, including "selftests: drv-net: kperf: support request-response tests", "selftests: drv-net: add a kperf stream test" and "selftests: drv-net: remove the iperf performance test".
Could the author and the Signed-off-by use the same address?
Quoted 5 lines
tools/testing/selftests/drivers/net/perf/rr.py new file +0
-0
[ ... ]
Quoted 5 lines
tools/testing/selftests/drivers/net/perf/rr.py new file +5
-0+def _report(result) -> None: + ksft_metric("rate", result.rate, goal="higher") + ksft_metric("latency_p25", result.p25, goal="lower") + ksft_metric("latency_p50", result.p50, goal="lower") + ksft_metric("latency_p90", result.p90, goal="lower")
tools/testing/selftests/drivers/net/perf/rr.py line 36
Quoted 10 lines
tools/testing/selftests/drivers/net/perf/rr.py new file +10
-0+ ksft_metric("latency_p99", result.p99, goal="lower") + ksft_metric("latency_p999", result.p999, goal="lower") + ksft_metric("latency_p9999", result.p9999, goal="lower") + ksft_metric("latency_max", result.lat_max, goal="lower") + + +def closed_loop(cfg) -> None: + """Measure back-to-back transactions.""" + with KperfRunner(cfg) as runner: + _report(runner.run(RR_ARGS))
[Severity: Medium]
Can closed_loop() pass even though it never measured a rate or any latency?
In KperfResult in drivers/net/lib/py/kperf.py, the request-response fields default to None:
rate: Optional[float] = None
p25: Optional[float] = None
...
lat_max: Optional[float] = None
KperfRunner.parse() only fills them through rr.setdefault() when _RPS_RE or _LAT_RE matches a line in the Source section. Its only completeness check covers throughput:
if not all(throughput.values()):
raise ValueError("incomplete kperf result")
return KperfResult(sum(throughput["Source"]),
sum(throughput["Target"]), **rr)
Suppose kperf-client prints the Source Tx and Target Rx Gbps lines but no "N RPS" line and no pXX:Nus or max:Nus tokens. That could happen with a kperf build whose output does not match the regexes, or one that ignores --time-stats 2. Each field passed to ksft_metric() is then None.
ksft_metric() uses json.dumps(..., allow_nan=False), which rejects only NaN and Inf. None is written as "value":null without an error. Metrics also do not affect the test result, so closed_loop() is reported as ok.
Consumers of the metric output then see null, while the ksft_metric() docstring ("value - the measured number") and README.rst promise a number. The later patches in the series do not change rr.py or KperfRunner.parse(), so this is still the case at the end of the series.
Would it make sense to check each field with ksft_not_none(), or to raise KsftFailEx or KsftSkipEx when a field is None, before reporting it?
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123174120.505808-1-sdf%40fomichev.me
Re: [PATCH net-next 2/4] selftests: drv-net: add a closed-loop request-response test
Quoted 61 lines · On 11/24, [email protected] wrote:
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] rr.py's closed_loop()/_report() pass the request-response fields of KperfResult (rate, p25, p50, p90, p99, p999, p9999, lat_max)…
- [Low] The commit author is 'Stanislav Fomichev <[email protected]>', but the only Signed-off-by is 'Stanislav Fomichev <[email protected]>'.--
selftests: drv-net: add a closed-loop request-response test
This adds
rr.pyto the drv-net perf selftests. It runs kperf over one connection with 1 KiB requests and responses, then reports the transaction rate and kperf's latency percentiles and maximum as ksft metrics.Quoted 1 line
Signed-off-by Stanislav Fomichev <[email protected]>[Severity: Low]
This isn't a bug, but the author address and the sign-off address do not match:Author: Stanislav Fomichev <[email protected]>
Signed-off-by Stanislav Fomichev <[email protected]>The body has no in-body From: line either, so checkpatch will report
FROM_SIGN_OFF_MISMATCH. The other patches in the series have the same mismatch, including "selftests: drv-net: kperf: support request-response tests", "selftests: drv-net: add a kperf stream test" and "selftests: drv-net: remove the iperf performance test".Could the author and the Signed-off-by use the same address?
Quoted 5 lines
tools/testing/selftests/drivers/net/perf/rr.py new file +0
-0[ ... ]
Quoted 11 lines
tools/testing/selftests/drivers/net/perf/rr.py new file +11
-0+def _report(result) -> None: + ksft_metric("rate", result.rate, goal="higher") + ksft_metric("latency_p25", result.p25, goal="lower") + ksft_metric("latency_p50", result.p50, goal="lower") + ksft_metric("latency_p90", result.p90, goal="lower") + ksft_metric("latency_p99", result.p99, goal="lower") + ksft_metric("latency_p999", result.p999, goal="lower") + ksft_metric("latency_p9999", result.p9999, goal="lower") + ksft_metric("latency_max", result.lat_max, goal="lower") + +
Quoted 8 lines
tools/testing/selftests/drivers/net/perf/rr.py line 36
Quoted 4 lines
tools/testing/selftests/drivers/net/perf/rr.py new file +4
-0+def closed_loop(cfg) -> None: + """Measure back-to-back transactions.""" + with KperfRunner(cfg) as runner: + _report(runner.run(RR_ARGS))[Severity: Medium]
Canclosed_loop()pass even though it never measured a rate or any latency?
Yes, it can pass. The (future) regression tracking will handle "no metrics reported" situation.
PATCH 3/4 selftests: drv-net: add a kperf stream test
In reply to Stanislav FomichevAdd 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. kperf pins the application a few CPUs away from the interrupts of the flow, so that the CPUs of a run do not depend on the scheduler. One connection is bound by the CPU rather than the line rate, so that the throughput follows changes to the cost of the stack and the driver.
--- .../selftests/drivers/net/perf/Makefile | 1 + .../selftests/drivers/net/perf/stream.py | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100755 tools/testing/selftests/drivers/net/perf/stream.py
tools/testing/selftests/drivers/net/perf/Makefile +1 -0
@@ -4,6 +4,7 @@ TEST_PROGS := \ devmem.py \ iperf.py \ rr.py \ + stream.py \ # end of TEST_PROGS TEST_INCLUDES := \
tools/testing/selftests/drivers/net/perf/stream.py new file +40 -0
@@ -0,0 +1,40 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0 + +"""Measure TCP stream throughput with kperf.""" + +from lib.py import KperfRunner, KsftNamedVariant, NetDrvEpEnv, ksft_exit +from lib.py import ksft_metric, ksft_run, ksft_variants + + +@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 = [ + "--time", "15", + "--num-connections", "1", + "--read-size", str(64 << 20), + "--write-size", str(64 << 20), + "--pin-off", "4", + "--validate", "no", + *mode_args, + ] + + with KperfRunner(cfg) as runner: + result = runner.run(stream_args) + + ksft_metric("throughput", result.target_throughput, goal="higher") + + +def main() -> None: + """Run the stream performance test.""" + with NetDrvEpEnv(__file__, nsim_test=False) as cfg: + ksft_run([tcp], args=(cfg,)) + ksft_exit() + + +if __name__ == "__main__": + main()
Signature · 1 line
2.53.1-Meta
[email protected]
AI reviewRe: [PATCH net-next 3/4] selftests: drv-net: add a kperf stream test
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider.
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 tools/testing/selftests/drivers/net/perf/stream.py, the "zerocopy" variant of tcp() passes ["--msg-zerocopy", "--zerocopy-rx"]…
- [Low] The commit author address (Stanislav Fomichev <[email protected]>) does not match the only Signed-off-by…
--
selftests: drv-net: add a kperf stream test
This adds stream.py, which uses kperf to measure the throughput of one TCP connection. It runs a copy variant and a zerocopy variant (MSG_ZEROCOPY on the sender, TCP_ZEROCOPY_RECEIVE on the receiver), and reports the result through ksft_metric().
Quoted 1 line
Signed-off-by Stanislav Fomichev <[email protected]>
[Severity: Low]
This isn't a bug, but the Author: address ([email protected]) does not match the Signed-off-by: address ([email protected]). checkpatch reports this as FROM_SIGN_OFF_MISMATCH. The other patches in the series have the same mismatch.
Quoted 6 lines
tools/testing/selftests/drivers/net/perf/stream.py new file +0
-0@@ -0,0 +1,40 @@
[ ... ]
tools/testing/selftests/drivers/net/perf/stream.py line 12
Quoted 3 lines
+@ksft_variants([
tools/testing/selftests/drivers/net/perf/stream.py new file +2
-0+ KsftNamedVariant("copy", []), + KsftNamedVariant("zerocopy", ["--msg-zerocopy", "--zerocopy-rx"]),
[Severity: Medium]
Does the zerocopy variant exercise TCP_ZEROCOPY_RECEIVE page mapping on a default NIC configuration?
tcp_zerocopy_receive() only maps frags that pass can_map_frag() in net/ipv4/tcp.c:
if (skb_frag_size(frag) != PAGE_SIZE || skb_frag_off(frag)) return false;
Without header-data split and HW GRO, payloads usually sit in sub-page frags at non-zero offsets. In that case nothing gets mapped and the data is copied, or kperf fails, depending on how it handles this.
The commit message says the test runs "with the same settings as devmem.py otherwise". However, devmem.py's kperf() turns on rx-gro-hw through _enable_hw_gro() and configures the rings with:
"tcp-data-split": "enabled",
It also sets hds-thresh to 0 where the driver supports it. stream.py does none of this.
The only output of tcp() is ksft_metric(), and metrics do not affect the result. So nothing shows whether zerocopy receive actually took place, and the zerocopy number depends on the driver's default HDS setting.
Could the same HDS and HW GRO setup from devmem.py be applied for this variant, with a skip when it can't be enabled?
Quoted 2 lines
+])
+deftcp(cfg, mode_args)-> None:
[ ... ]
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123174120.505808-1-sdf%40fomichev.me
Re: [PATCH net-next 3/4] selftests: drv-net: add a kperf stream test
Quoted 42 lines · On 11/24, [email protected] wrote:
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
tools/testing/selftests/drivers/net/perf/stream.py, the "zerocopy" variant oftcp()passes ["--msg-zerocopy", "--zerocopy-rx"]…
- [Low] The commit author address (Stanislav Fomichev <[email protected]>) does not match the only Signed-off-by…--
selftests: drv-net: add a kperf stream test
This adds
stream.py, which uses kperf to measure the throughput of one TCP connection. It runs a copy variant and a zerocopy variant (MSG_ZEROCOPYon the sender,TCP_ZEROCOPY_RECEIVEon the receiver), and reports the result throughksft_metric().Quoted 1 line
Signed-off-by Stanislav Fomichev <[email protected]>[Severity: Low]
This isn't a bug, but the Author: address ([email protected]) does not match the Signed-off-by: address ([email protected]). checkpatch reports this asFROM_SIGN_OFF_MISMATCH. The other patches in the series have the same mismatch.Quoted 6 lines
tools/testing/selftests/drivers/net/perf/stream.py new file +0
-0@@ -0,0 +1,40 @@[ ... ]
Quoted 7 lines
tools/testing/selftests/drivers/net/perf/stream.py line 12
Quoted 3 lines
+@ksft_variants([
tools/testing/selftests/drivers/net/perf/stream.py new file +2
-0+ KsftNamedVariant("copy", []), + KsftNamedVariant("zerocopy", ["--msg-zerocopy", "--zerocopy-rx"]),[Severity: Medium]
Does the zerocopy variant exerciseTCP_ZEROCOPY_RECEIVEpage mapping on a default NIC configuration?
NIPA HW runners enable the pre-requisites IIRC. If not, I'll add it there.
PATCH 4/4 selftests: drv-net: remove the iperf performance test
In reply to Stanislav FomichevThe throughput of one iperf3 stream changes by about 10% between back-to-back runs on the same hosts, e.g. from 90.7 to 99.6 Gbps over four runs, as much as a regression would. stream.py measures one TCP connection with kperf instead, remove iperf.py.
--- .../selftests/drivers/net/perf/Makefile | 1 - .../selftests/drivers/net/perf/iperf.py | 23 ------------------- 2 files changed, 24 deletions(-) delete mode 100755 tools/testing/selftests/drivers/net/perf/iperf.py
tools/testing/selftests/drivers/net/perf/Makefile +0 -1
@@ -2,7 +2,6 @@ TEST_PROGS := \ devmem.py \ - iperf.py \ rr.py \ stream.py \ # end of TEST_PROGS
tools/testing/selftests/drivers/net/perf/iperf.py deleted +0 -23
@@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: GPL-2.0 - -"""Measure TCP throughput with iperf3.""" - -from lib.py import Iperf3Runner, NetDrvEpEnv, ksft_exit, ksft_metric, ksft_run - - -def tcp(cfg): - """Measure TCP throughput.""" - result = Iperf3Runner(cfg).measure() - ksft_metric("throughput", result.throughput, goal="higher") - - -def main(): - """Run the iperf performance test.""" - with NetDrvEpEnv(__file__, nsim_test=False) as cfg: - ksft_run([tcp], args=(cfg,)) - ksft_exit() - - -if __name__ == "__main__": - main()
Signature · 1 line
2.53.1-Meta
[email protected]
AI reviewRe: [PATCH net-next 4/4] selftests: drv-net: remove the iperf performance test
Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you…
Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The author and the sign-off use different email addresses.
--
selftests: drv-net: remove the iperf performance test
This commit removes the iperf.py throughput test from the drv-net perf selftests and drops it from TEST_PROGS in the Makefile. The commit message says single-stream iperf3 results vary by about 10% between back-to-back runs, and that stream.py with kperf covers the same case.
Quoted 1 line
Author: Stanislav Fomichev <[email protected]>
[ ... ]
Quoted 1 line
Signed-off-by Stanislav Fomichev <[email protected]>
[Severity: Low]
This isn't a bug, but the author address and the Signed-off-by address don't match. The author is [email protected], and the only sign-off uses [email protected]. There is no in-body From: line either.
The names are the same and the addresses differ, so the FROM_SIGN_OFF_MISMATCH check in scripts/checkpatch.pl sets $authorsignoff = 4:
scripts/checkpatch.pl:
} elsif ($email_name eq $author_name) {
$author_sob = $ctx;
$authorsignoff = 4;That leads to this warning:
"From:/Signed-off-by: email address mismatch"
Nothing in the tree links the two addresses. .mailmap maps only [email protected] and [email protected] to [email protected]:
Stanislav Fomichev <[email protected]> <[email protected]> Stanislav Fomichev <[email protected]> <[email protected]>
The earlier commit c1d2b8e89a29 ("selftests: drv-net: add an iperf performance test") has the same mismatch and was merged anyway.
Could the author be changed to [email protected], or a matching Signed-off-by be added for [email protected]? A .mailmap entry would also link the two addresses.
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261123174120.505808-1-sdf%40fomichev.me
Quoted 62 lines · Stanislav Fomichev
Recently added iperf throughput runs (918696-924166) have not been stable:
ktap-metric-json:
{"goal":"higher","name":"throughput","value":99.60508305201279}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":90.65816851430006}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":92.02795621872379}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":98.78863365714747}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":103.38157195808748}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":93.64137239021106}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":101.73578035463773}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":78.15304223077422}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":103.79536587818043}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":91.48843017237692}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":75.27885187718259}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":103.5323033205535}
ktap-metric-json:
{"goal":"higher","name":"throughput","value":92.04284599832805}Compared to kperf devmem:
ktap-metric-json: {"goal":"higher","name":"throughput","value":185.588} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.63} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.606} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.594} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.54} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.594} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.552} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.561} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.616} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.63} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.532} ktap-metric-json: {"goal":"higher","name":"throughput","value":185.62}This is most likely due to --pin-off we are doing with kperf. So replace iperf with kperf (add regular and zerocopy variants).
At the same time, add closed loop RR stats to estimate the amount PPS we can take (so I can follow up with open loop RR).
Stanislav Fomichev (4):
selftests: drv-net: kperf: support request-response tests
selftests: drv-net: add a closed-loop request-response test
selftests: drv-net: add a kperf stream test
selftests: drv-net: remove the iperf performance test.../selftests/drivers/net/lib/py/kperf.py | 31 +++++++++++- .../selftests/drivers/net/perf/Makefile | 3 +- .../selftests/drivers/net/perf/iperf.py | 23 --------- .../testing/selftests/drivers/net/perf/rr.py | 47 +++++++++++++++++++ .../selftests/drivers/net/perf/stream.py | 40 ++++++++++++++++ 5 files changed, 118 insertions(+), 26 deletions(-)
Quoted 3 lines
delete mode 100755
tools/testing/selftests/drivers/net/perf/iperf.pycreate mode 100755tools/testing/selftests/drivers/net/perf/rr.pycreate mode 100755tools/testing/selftests/drivers/net/perf/stream.py
Please fix the 8 new ruff UP045 type-annotation errors in tools/testing/selftests/drivers/net/lib/py/kperf.py and align the From and Signed-off-by email addresses before respinning.
--
pw-bot: cr