Skip to content

Commit 75fc630

Browse files
bastien-curutchetAlexei Starovoitov
authored andcommitted
selftests/bpf: test_xsk: Isolate non-CI tests
Following tests won't fit in the CI: - XDP_ADJUST_TAIL_* and SEND_RECEIVE_9K_PACKETS because of their flakyness - UNALIGNED_* because they depend on huge page allocations - *_RING_SIZE because they depend on HW rings - TEARDOWN because it's too long Remove these tests from the nominal tests table so they won't be run by the CI in upcoming patch. Create a skip_ci_tests table to hold them. Use this skip_ci table in xskxceiver.c to keep all the tests available from the test_xsk.sh script. 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 7a96615 commit 75fc630

File tree

2 files changed

+32
-17
lines changed

2 files changed

+32
-17
lines changed

tools/testing/selftests/bpf/test_xsk.h

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,9 @@ static const struct test_spec tests[] = {
254254
{.name = "POLL_TX", .test_func = testapp_poll_tx},
255255
{.name = "POLL_RXQ_FULL", .test_func = testapp_poll_rxq_tmout},
256256
{.name = "POLL_TXQ_FULL", .test_func = testapp_poll_txq_tmout},
257-
{.name = "SEND_RECEIVE_UNALIGNED", .test_func = testapp_send_receive_unaligned},
258257
{.name = "ALIGNED_INV_DESC", .test_func = testapp_aligned_inv_desc},
259258
{.name = "ALIGNED_INV_DESC_2K_FRAME_SIZE", .test_func = testapp_aligned_inv_desc_2k_frame},
260-
{.name = "UNALIGNED_INV_DESC", .test_func = testapp_unaligned_inv_desc},
261-
{.name = "UNALIGNED_INV_DESC_4001_FRAME_SIZE",
262-
.test_func = testapp_unaligned_inv_desc_4001_frame},
263259
{.name = "UMEM_HEADROOM", .test_func = testapp_headroom},
264-
{.name = "TEARDOWN", .test_func = testapp_teardown},
265260
{.name = "BIDIRECTIONAL", .test_func = testapp_bidirectional},
266261
{.name = "STAT_RX_DROPPED", .test_func = testapp_stats_rx_dropped},
267262
{.name = "STAT_TX_INVALID", .test_func = testapp_stats_tx_invalid_descs},
@@ -272,19 +267,32 @@ static const struct test_spec tests[] = {
272267
{.name = "XDP_SHARED_UMEM", .test_func = testapp_xdp_shared_umem},
273268
{.name = "XDP_METADATA_COPY", .test_func = testapp_xdp_metadata},
274269
{.name = "XDP_METADATA_COPY_MULTI_BUFF", .test_func = testapp_xdp_metadata_mb},
275-
{.name = "SEND_RECEIVE_9K_PACKETS", .test_func = testapp_send_receive_mb},
276-
{.name = "SEND_RECEIVE_UNALIGNED_9K_PACKETS",
277-
.test_func = testapp_send_receive_unaligned_mb},
278270
{.name = "ALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_aligned_inv_desc_mb},
279-
{.name = "UNALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_unaligned_inv_desc_mb},
280271
{.name = "TOO_MANY_FRAGS", .test_func = testapp_too_many_frags},
281-
{.name = "HW_SW_MIN_RING_SIZE", .test_func = testapp_hw_sw_min_ring_size},
282-
{.name = "HW_SW_MAX_RING_SIZE", .test_func = testapp_hw_sw_max_ring_size},
283272
{.name = "XDP_ADJUST_TAIL_SHRINK", .test_func = testapp_adjust_tail_shrink},
273+
{.name = "TX_QUEUE_CONSUMER", .test_func = testapp_tx_queue_consumer},
274+
};
275+
276+
static const struct test_spec ci_skip_tests[] = {
277+
/* Flaky tests */
284278
{.name = "XDP_ADJUST_TAIL_SHRINK_MULTI_BUFF", .test_func = testapp_adjust_tail_shrink_mb},
285279
{.name = "XDP_ADJUST_TAIL_GROW", .test_func = testapp_adjust_tail_grow},
286280
{.name = "XDP_ADJUST_TAIL_GROW_MULTI_BUFF", .test_func = testapp_adjust_tail_grow_mb},
287-
{.name = "TX_QUEUE_CONSUMER", .test_func = testapp_tx_queue_consumer},
288-
};
281+
{.name = "SEND_RECEIVE_9K_PACKETS", .test_func = testapp_send_receive_mb},
282+
/* Tests with huge page dependency */
283+
{.name = "SEND_RECEIVE_UNALIGNED", .test_func = testapp_send_receive_unaligned},
284+
{.name = "UNALIGNED_INV_DESC", .test_func = testapp_unaligned_inv_desc},
285+
{.name = "UNALIGNED_INV_DESC_4001_FRAME_SIZE",
286+
.test_func = testapp_unaligned_inv_desc_4001_frame},
287+
{.name = "SEND_RECEIVE_UNALIGNED_9K_PACKETS",
288+
.test_func = testapp_send_receive_unaligned_mb},
289+
{.name = "UNALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_unaligned_inv_desc_mb},
290+
/* Test with HW ring size dependency */
291+
{.name = "HW_SW_MIN_RING_SIZE", .test_func = testapp_hw_sw_min_ring_size},
292+
{.name = "HW_SW_MAX_RING_SIZE", .test_func = testapp_hw_sw_max_ring_size},
293+
/* Too long test */
294+
{.name = "TEARDOWN", .test_func = testapp_teardown},
295+
};
296+
289297

290298
#endif /* TEST_XSK_H_ */

tools/testing/selftests/bpf/xskxceiver.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,13 @@ static void print_tests(void)
326326
printf("Tests:\n");
327327
for (i = 0; i < ARRAY_SIZE(tests); i++)
328328
printf("%u: %s\n", i, tests[i].name);
329+
for (i = ARRAY_SIZE(tests); i < ARRAY_SIZE(tests) + ARRAY_SIZE(ci_skip_tests); i++)
330+
printf("%u: %s\n", i, ci_skip_tests[i - ARRAY_SIZE(tests)].name);
329331
}
330332

331333
int main(int argc, char **argv)
332334
{
335+
const size_t total_tests = ARRAY_SIZE(tests) + ARRAY_SIZE(ci_skip_tests);
333336
struct pkt_stream *rx_pkt_stream_default;
334337
struct pkt_stream *tx_pkt_stream_default;
335338
struct ifobject *ifobj_tx, *ifobj_rx;
@@ -357,7 +360,7 @@ int main(int argc, char **argv)
357360
print_tests();
358361
ksft_exit_xpass();
359362
}
360-
if (opt_run_test != RUN_ALL_TESTS && opt_run_test >= ARRAY_SIZE(tests)) {
363+
if (opt_run_test != RUN_ALL_TESTS && opt_run_test >= total_tests) {
361364
ksft_print_msg("Error: test %u does not exist.\n", opt_run_test);
362365
ksft_exit_xfail();
363366
}
@@ -397,7 +400,7 @@ int main(int argc, char **argv)
397400
test.rx_pkt_stream_default = rx_pkt_stream_default;
398401

399402
if (opt_run_test == RUN_ALL_TESTS)
400-
nb_tests = ARRAY_SIZE(tests);
403+
nb_tests = total_tests;
401404
else
402405
nb_tests = 1;
403406
if (opt_mode == TEST_MODE_ALL) {
@@ -419,11 +422,15 @@ int main(int argc, char **argv)
419422
if (opt_mode != TEST_MODE_ALL && i != opt_mode)
420423
continue;
421424

422-
for (j = 0; j < ARRAY_SIZE(tests); j++) {
425+
for (j = 0; j < total_tests; j++) {
423426
if (opt_run_test != RUN_ALL_TESTS && j != opt_run_test)
424427
continue;
425428

426-
test_init(&test, ifobj_tx, ifobj_rx, i, &tests[j]);
429+
if (j < ARRAY_SIZE(tests))
430+
test_init(&test, ifobj_tx, ifobj_rx, i, &tests[j]);
431+
else
432+
test_init(&test, ifobj_tx, ifobj_rx, i,
433+
&ci_skip_tests[j - ARRAY_SIZE(tests)]);
427434
run_pkt_test(&test);
428435
usleep(USLEEP_MAX);
429436

0 commit comments

Comments
 (0)