Skip to content

Commit c0f7441

Browse files
bastien-curutchetKernel Patches Daemon
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(). Signed-off-by: Bastien Curutchet (eBPF Foundation) <[email protected]>
1 parent 924b584 commit c0f7441

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
@@ -1106,7 +1106,7 @@ static int receive_pkts(struct test_spec *test)
11061106

11071107
ret = gettimeofday(&tv_now, NULL);
11081108
if (ret)
1109-
exit_with_error(errno);
1109+
return TEST_FAILURE;
11101110

11111111
timeradd(&tv_now, &tv_timeout, &tv_end);
11121112

@@ -1122,7 +1122,7 @@ static int receive_pkts(struct test_spec *test)
11221122

11231123
ret = gettimeofday(&tv_now, NULL);
11241124
if (ret)
1125-
exit_with_error(errno);
1125+
return TEST_FAILURE;
11261126

11271127
if (timercmp(&tv_now, &tv_end, >)) {
11281128
ksft_print_msg("ERROR: [%s] Receive loop timed out\n", __func__);
@@ -1265,13 +1265,13 @@ static int wait_for_tx_completion(struct xsk_socket_info *xsk)
12651265

12661266
ret = gettimeofday(&tv_now, NULL);
12671267
if (ret)
1268-
exit_with_error(errno);
1268+
return TEST_FAILURE;
12691269
timeradd(&tv_now, &tv_timeout, &tv_end);
12701270

12711271
while (xsk->outstanding_tx) {
12721272
ret = gettimeofday(&tv_now, NULL);
12731273
if (ret)
1274-
exit_with_error(errno);
1274+
return TEST_FAILURE;
12751275
if (timercmp(&tv_now, &tv_end, >)) {
12761276
ksft_print_msg("ERROR: [%s] Transmission loop timed out\n", __func__);
12771277
return TEST_FAILURE;

0 commit comments

Comments
 (0)