PSP self test improvements
Subsystems (3)
v2 cover PSP self test improvements
Changes since v1:
- Used ifindex in psp_responder to select the PSP device
- Merged the two patches since they started overlapping too much.
Cosmin Ratiu (1):
selftests: drv-net: psp: Better control the used PSP dev
.../selftests/drivers/net/lib/py/env.py | 1 + tools/testing/selftests/drivers/net/psp.py | 4 +- .../selftests/drivers/net/psp_responder.c | 50 +++++++++---------- 3 files changed, 26 insertions(+), 29 deletions(-)
Signature · 1 line
2.45.0
PATCH v2 1/1 selftests: drv-net: psp: Better control the used PSP dev
The PSP responder fails when zero or multiple PSP devices are detected. There's an option to select the device id to use (-d) but it's currently not used from the PSP self test. It's also hard to use because the PSP test doesn't dump the PSP devices so can't choose one. When zero devices are detected, psp_responder fails which will cause the parent test to fail as well instead of skipping PSP tests.
Fix both of these problems. Change psp_responder to:
- not fail when no PSP devs are detected.
- get an optional -i ifindex argument instead of -d.
- select the correct PSP dev from the dump corresponding to ifindex or
- select the first PSP dev when -i is not given.
- fail when multiple devs are found and -i is not given.
- warn and continue when the requested ifindex is not found.
Also plumb the ifindex from the Python test.
With these, when there are no PSP devs found or the wrong one is chosen, psp_responder opens the server socket, listens for control connections normally, and leaves the skipping of the various test cases which require a PSP device (~most, but not all of them) to the parent test. This results in output like:
ok 1 psp.test_case # SKIP No PSP devices found [...]
ok 12 psp.dev_get_device # SKIP No PSP devices found ok 13 psp.dev_get_device_bad
ok 14 psp.dev_rotate # SKIP No PSP devices found [...]
--- .../selftests/drivers/net/lib/py/env.py | 1 + tools/testing/selftests/drivers/net/psp.py | 4 +- .../selftests/drivers/net/psp_responder.c | 50 +++++++++---------- 3 files changed, 26 insertions(+), 29 deletions(-)
tools/testing/selftests/drivers/net/lib/py/env.py +1 -0
@@ -170,6 +170,7 @@ class NetDrvEpEnv(NetDrvEnvBase): self.remote_ifname = self.resolve_remote_ifc() self.remote_dev = ip("-d link show dev " + self.remote_ifname, host=self.remote, json=True)[0] + self.remote_ifindex = self.remote_dev['ifindex'] self._required_cmd = {}
tools/testing/selftests/drivers/net/psp.py +2 -2
@@ -599,8 +599,8 @@ def main() -> None: cfg.comm_port = rand_port() srv = None try: - with bkg(responder + f" -p {cfg.comm_port}", host=cfg.remote, - exit_wait=True) as srv: + with bkg(responder + f" -p {cfg.comm_port} -i {cfg.remote_ifindex}", + host=cfg.remote, exit_wait=True) as srv: wait_port_listen(cfg.comm_port, host=cfg.remote) cfg.comm_sock = socket.create_connection((cfg.remote_addr,
tools/testing/selftests/drivers/net/psp_responder.c +23 -27
107 lines not on this page · raw message
Signature · 1 line
2.45.0
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Fri, 9 Jan 2026 13:08:50 +0200 you wrote:
Changes since v1:
- Used ifindex inpsp_responderto select the PSP device
- Merged the two patches since they started overlapping too much.Cosmin Ratiu (1):
selftests: drv-net: psp: Better control the used PSP dev[...]
Here is the summary with links:
- [net-next,v2,1/1] selftests: drv-net: psp: Better control the used PSP dev
https://git.kernel.org/netdev/net-next/c/9086984ff52e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html