Skip to content

Commit 3f09728

Browse files
bastien-curutchetAlexei Starovoitov
authored andcommitted
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 <[email protected]> Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent f12f1b5 commit 3f09728

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/testing/selftests/bpf/test_xsk.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ static int receive_pkts(struct test_spec *test)
10961096

10971097
ret = gettimeofday(&tv_now, NULL);
10981098
if (ret)
1099-
exit_with_error(errno);
1099+
return TEST_FAILURE;
11001100

11011101
timeradd(&tv_now, &tv_timeout, &tv_end);
11021102

@@ -1112,7 +1112,7 @@ static int receive_pkts(struct test_spec *test)
11121112

11131113
ret = gettimeofday(&tv_now, NULL);
11141114
if (ret)
1115-
exit_with_error(errno);
1115+
return TEST_FAILURE;
11161116

11171117
if (timercmp(&tv_now, &tv_end, >)) {
11181118
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)
12551255

12561256
ret = gettimeofday(&tv_now, NULL);
12571257
if (ret)
1258-
exit_with_error(errno);
1258+
return TEST_FAILURE;
12591259
timeradd(&tv_now, &tv_timeout, &tv_end);
12601260

12611261
while (xsk->outstanding_tx) {
12621262
ret = gettimeofday(&tv_now, NULL);
12631263
if (ret)
1264-
exit_with_error(errno);
1264+
return TEST_FAILURE;
12651265
if (timercmp(&tv_now, &tv_end, >)) {
12661266
ksft_print_msg("ERROR: [%s] Transmission loop timed out\n", __func__);
12671267
return TEST_FAILURE;

0 commit comments

Comments
 (0)