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

From
netdev-bot+sashiko@kernel.org
Date
2026-11-18 06:05:09
Also in
linux-doc, linux-kselftest, lkml
Reply to
Daniel Zahka, 2026-11-16
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.
quoted hunk ↗ jump to hunk
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
[ ... ]
quoted hunk ↗ jump to hunk
@@ -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
Thread (11 messages) 11 messages, 2 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help