]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests: net: py: support ksft ready without wait
authorJakub Kicinski <kuba@kernel.org>
Thu, 20 Nov 2025 02:10:18 +0000 (18:10 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 21 Nov 2025 02:19:29 +0000 (18:19 -0800)
commite02b52ecef5ba468f55ed0dc38de6016424d9703
tree31fdf8645df9656a02ccbde091eaf27c05b5e956
parent89268f7dbca1842cd38d3a4578ba7e3b6789c5ad
selftests: net: py: support ksft ready without wait

There's a common synchronization problem when a script (Python test)
uses a C program to set up some state (usually start a receiving
process for traffic). The script needs to know when the process
has fully initialized. The inverse of the problem exists for shutting
the process down - we need a reliable way to tell the process to exit.

We added helpers to do this safely in
commit 71477137994f ("selftests: drv-net: add a way to wait for a local process")
unfortunately the two operations (wait for init, and shutdown) are
controlled by a single parameter (ksft_wait). Add support for using
ksft_ready without using the second fd for exit.

This is useful for programs which wait for a specific number of packets
to rx so exit_wait is a good match, but we still need to wait for init.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20251120021024.2944527-7-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/lib/py/utils.py