summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>2025-10-31 11:04:46 +0300
committerAlexei Starovoitov <ast@kernel.org>2025-10-31 19:24:38 +0300
commit3f09728f908048ecff108e32d566aaf5d6ca315d (patch)
tree1edf148f3836c3d436bfd83bc79c148ab80a5b1b /tools
parentf12f1b5d14b0a433a4fa4e1a710ea68d7d15d56b (diff)
downloadlinux-3f09728f908048ecff108e32d566aaf5d6ca315d.tar.xz
selftests/bpf: test_xsk: Don't exit immediately when gettimeofday fails
exit_with_error() is called when gettimeofday() fails. This exits the program immediately. It prevents the following tests from being run and isn't compliant with the CI. Return TEST_FAILURE instead of calling exit_on_error(). Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com> Link: https://lore.kernel.org/r/20251031-xsk-v7-10-39fe486593a3@bootlin.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/test_xsk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/test_xsk.c b/tools/testing/selftests/bpf/test_xsk.c
index 0adb6c0b948f..2c955e109943 100644
--- a/tools/testing/selftests/bpf/test_xsk.c
+++ b/tools/testing/selftests/bpf/test_xsk.c
@@ -1096,7 +1096,7 @@ static int receive_pkts(struct test_spec *test)
ret = gettimeofday(&tv_now, NULL);
if (ret)
- exit_with_error(errno);
+ return TEST_FAILURE;
timeradd(&tv_now, &tv_timeout, &tv_end);
@@ -1112,7 +1112,7 @@ static int receive_pkts(struct test_spec *test)
ret = gettimeofday(&tv_now, NULL);
if (ret)
- exit_with_error(errno);
+ return TEST_FAILURE;
if (timercmp(&tv_now, &tv_end, >)) {
ksft_print_msg("ERROR: [%s] Receive loop timed out\n", __func__);
@@ -1255,13 +1255,13 @@ static int wait_for_tx_completion(struct xsk_socket_info *xsk)
ret = gettimeofday(&tv_now, NULL);
if (ret)
- exit_with_error(errno);
+ return TEST_FAILURE;
timeradd(&tv_now, &tv_timeout, &tv_end);
while (xsk->outstanding_tx) {
ret = gettimeofday(&tv_now, NULL);
if (ret)
- exit_with_error(errno);
+ return TEST_FAILURE;
if (timercmp(&tv_now, &tv_end, >)) {
ksft_print_msg("ERROR: [%s] Transmission loop timed out\n", __func__);
return TEST_FAILURE;