Re: [PATCH net-next v4 5/5] selftests: drv-net: psp: add rekey tests

From: netdev-bot+sashiko

Date: Wed Nov 18 2026 - 01:05:22 EST


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 patch changes the existing shared helper _recv_careful() in
tools/testing/selftests/drivers/net/psp.py, and the commit message…

--

selftests: drv-net: psp: add rekey tests

This commit adds selftests for rekeying PSP connections. The tests cover
rx-assoc and tx-assoc rejections caused by a PSP version mismatch or by
the PSP state. It also adds rx-assoc, tx-assoc and key-rotate RPC
endpoints to psp_responder.

> diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py
> index ce0ab66666030..bd0283f9c9c02 100755
> --- a/tools/testing/selftests/drivers/net/psp.py
> +++ b/tools/testing/selftests/drivers/net/psp.py

[ ... ]

> @@ -126,7 +157,10 @@ def _recv_careful(s, target, timeout=2):
> end = time.monotonic() + timeout
> while time.monotonic() < end:
> try:
> - data += s.recv(target - len(data), socket.MSG_DONTWAIT)
> + chunk = s.recv(target - len(data), socket.MSG_DONTWAIT)
> + if not chunk:
> + raise KsftFailEx(f"peer closed after {len(data)} of {target} bytes")
> + data += chunk
> if len(data) == target:
> return data
> except BlockingIOError:

[Severity: Low]
This isn't a bug, but this hunk changes _recv_careful(), a helper that
existed before this patch. The commit message doesn't mention it.

Existing tests reach it through _req_echo(), for example
_data_basic_send(). So the change affects more than the new rekey tests:

_req_echo()
ksft_eq(_recv_careful(s, 5), b'echo\0')

Before this patch, when the peer closed the socket, recv() returned b''.
The loop then spun without sleeping until the 2 second timeout and
failed with "short read, got N of M bytes".

With this patch it fails at once with "peer closed after N of M bytes".

The only place this is described is the v3 note "fail fast in
_recv_careful() if the peer closes the connection". That note is below
the --- line, so it won't be kept in git history.

Could the commit message say that _recv_careful() now fails fast when
the peer closes the connection? Alternatively, this could go in a
separate patch.

--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-psp-v4-0-1a599df2aefa%40gmail.com