summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorDragos Tatulea <dtatulea@nvidia.com>2026-06-11 19:03:41 +0300
committerJakub Kicinski <kuba@kernel.org>2026-06-13 03:28:07 +0300
commitec782be97d2d364fec730512259e6da259594109 (patch)
treea0ae0ca398a8b5ed2af7c16f224e6e7f7b089043 /tools/testing
parent315a0c33999a21a87b4326a1f326c1cd86f0ea97 (diff)
downloadlinux-ec782be97d2d364fec730512259e6da259594109.tar.xz
selftests: iou-zcrx: defer listen() until after zcrx setup
The server binds the queues for zero-copy after listen(). If the client does a connect() during this time it can fail with EHOSTUNREACH on a cold system. This was encountered with the mlx5 driver where binding the .ndo_queue_start() is a slow operation during which no packets can be exchanged. This change moves listen() after queue binding, when the test server is fully operational. Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com> Link: https://patch.msgid.link/20260611160341.3697227-2-dtatulea@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/drivers/net/hw/iou-zcrx.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
index 240d13dbc54e..f6a8fc5fac24 100644
--- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
+++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
@@ -351,9 +351,6 @@ static void run_server(void)
if (ret < 0)
error(1, 0, "bind()");
- if (listen(fd, 1024) < 0)
- error(1, 0, "listen()");
-
flags |= IORING_SETUP_COOP_TASKRUN;
flags |= IORING_SETUP_SINGLE_ISSUER;
flags |= IORING_SETUP_DEFER_TASKRUN;
@@ -366,6 +363,9 @@ static void run_server(void)
if (cfg_dry_run)
return;
+ if (listen(fd, 1024) < 0)
+ error(1, 0, "listen()");
+
add_accept(&ring, fd);
tstop = gettimeofday_ms() + 5000;