Netdev List
 help / color / mirror / Atom feed
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 2/4] selftests: drv-net: add a closed-loop request-response test
Date: Tue, 01 Dec 2026 18:10:28 +0000	[thread overview]
Message-ID: <179614862869.3146.5984884972810463913@kernel.org> (raw)
In-Reply-To: <20261130174609.314114-3-sdf.kernel@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] `closed_loop()` and `_report()` in
  tools/testing/selftests/drivers/net/perf/rr.py pass the request-…

--

selftests: drv-net: add a closed-loop request-response test

This adds rr.py. It uses kperf to run back-to-back 1 KiB request-response
transactions over a single connection. It then reports the transaction
rate, the latency percentiles and the maximum latency as ksft metrics.

> diff --git a/tools/testing/selftests/drivers/net/perf/rr.py b/tools/testing/selftests/drivers/net/perf/rr.py
> new file mode 100755
> index 0000000000000..1dff0c4763909
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/perf/rr.py

[ ... ]

> +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")
> +
> +
> +def closed_loop(cfg) -> None:
> +    """Measure back-to-back transactions."""
> +    with KperfRunner(cfg) as runner:
> +        _report(runner.run(RR_ARGS))

[Severity: Medium]
If kperf produces no request-response data, can closed_loop() still
report PASS?

In tools/testing/selftests/drivers/net/lib/py/kperf.py, every
request-response field of KperfResult defaults to None:

    rate: float | None = None
    p25: float | None = None
    ...
    lat_max: float | None = None

KperfRunner.parse() fills these fields only when _RPS_RE or _LAT_RE
matches a line in the Source section. Its only completeness check covers
throughput:

    rr.setdefault("rate", float(match.group(1)))
    ...
    rr.setdefault(key, float(value))
    ...
    if not all(throughput.values()):
        raise ValueError("incomplete kperf result")

ksft_metric() does not validate value either. json.dumps() turns None
into null, and metrics do not affect the test result.

So the test would pass if kperf printed no RPS line or no latency lines
in the Source section. That could happen if a kperf build ignores
--time-stats 2, uses a different output format or unit, or prints the
stats under Target. The output would then be eight ktap-metric-json
records with "value":null.

Would it make sense to check these fields in closed_loop() or _report()?
lib.py already exports ksft_not_none(), or rr.py could raise
KsftFailEx when a field is missing.

Nothing later in the series changes rr.py, kperf.py or ksft.py.

[ ... ]

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

  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 [this message]
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
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=179614862869.3146.5984884972810463913@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