Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <maciej.fijalkowski@intel.com>
Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@bootlin.com>
Link: https://lore.kernel.org/r/20251031-xsk-v7-14-39fe486593a3@bootlin.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Bastien Curutchet (eBPF Foundation) and committed by
Alexei Starovoitov
75fc6308 7a96615f

+32 -17
+21 -13
tools/testing/selftests/bpf/test_xsk.h
··· 254 254 {.name = "POLL_TX", .test_func = testapp_poll_tx}, 255 255 {.name = "POLL_RXQ_FULL", .test_func = testapp_poll_rxq_tmout}, 256 256 {.name = "POLL_TXQ_FULL", .test_func = testapp_poll_txq_tmout}, 257 - {.name = "SEND_RECEIVE_UNALIGNED", .test_func = testapp_send_receive_unaligned}, 258 257 {.name = "ALIGNED_INV_DESC", .test_func = testapp_aligned_inv_desc}, 259 258 {.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}, 263 259 {.name = "UMEM_HEADROOM", .test_func = testapp_headroom}, 264 - {.name = "TEARDOWN", .test_func = testapp_teardown}, 265 260 {.name = "BIDIRECTIONAL", .test_func = testapp_bidirectional}, 266 261 {.name = "STAT_RX_DROPPED", .test_func = testapp_stats_rx_dropped}, 267 262 {.name = "STAT_TX_INVALID", .test_func = testapp_stats_tx_invalid_descs}, ··· 267 272 {.name = "XDP_SHARED_UMEM", .test_func = testapp_xdp_shared_umem}, 268 273 {.name = "XDP_METADATA_COPY", .test_func = testapp_xdp_metadata}, 269 274 {.name = "XDP_METADATA_COPY_MULTI_BUFF", .test_func = testapp_xdp_metadata_mb}, 270 - {.name = "SEND_RECEIVE_9K_PACKETS", .test_func = testapp_send_receive_mb}, 271 - {.name = "SEND_RECEIVE_UNALIGNED_9K_PACKETS", 272 - .test_func = testapp_send_receive_unaligned_mb}, 273 275 {.name = "ALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_aligned_inv_desc_mb}, 274 - {.name = "UNALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_unaligned_inv_desc_mb}, 275 276 {.name = "TOO_MANY_FRAGS", .test_func = testapp_too_many_frags}, 276 - {.name = "HW_SW_MIN_RING_SIZE", .test_func = testapp_hw_sw_min_ring_size}, 277 - {.name = "HW_SW_MAX_RING_SIZE", .test_func = testapp_hw_sw_max_ring_size}, 278 277 {.name = "XDP_ADJUST_TAIL_SHRINK", .test_func = testapp_adjust_tail_shrink}, 278 + {.name = "TX_QUEUE_CONSUMER", .test_func = testapp_tx_queue_consumer}, 279 + }; 280 + 281 + static const struct test_spec ci_skip_tests[] = { 282 + /* Flaky tests */ 279 283 {.name = "XDP_ADJUST_TAIL_SHRINK_MULTI_BUFF", .test_func = testapp_adjust_tail_shrink_mb}, 280 284 {.name = "XDP_ADJUST_TAIL_GROW", .test_func = testapp_adjust_tail_grow}, 281 285 {.name = "XDP_ADJUST_TAIL_GROW_MULTI_BUFF", .test_func = testapp_adjust_tail_grow_mb}, 282 - {.name = "TX_QUEUE_CONSUMER", .test_func = testapp_tx_queue_consumer}, 283 - }; 286 + {.name = "SEND_RECEIVE_9K_PACKETS", .test_func = testapp_send_receive_mb}, 287 + /* Tests with huge page dependency */ 288 + {.name = "SEND_RECEIVE_UNALIGNED", .test_func = testapp_send_receive_unaligned}, 289 + {.name = "UNALIGNED_INV_DESC", .test_func = testapp_unaligned_inv_desc}, 290 + {.name = "UNALIGNED_INV_DESC_4001_FRAME_SIZE", 291 + .test_func = testapp_unaligned_inv_desc_4001_frame}, 292 + {.name = "SEND_RECEIVE_UNALIGNED_9K_PACKETS", 293 + .test_func = testapp_send_receive_unaligned_mb}, 294 + {.name = "UNALIGNED_INV_DESC_MULTI_BUFF", .test_func = testapp_unaligned_inv_desc_mb}, 295 + /* Test with HW ring size dependency */ 296 + {.name = "HW_SW_MIN_RING_SIZE", .test_func = testapp_hw_sw_min_ring_size}, 297 + {.name = "HW_SW_MAX_RING_SIZE", .test_func = testapp_hw_sw_max_ring_size}, 298 + /* Too long test */ 299 + {.name = "TEARDOWN", .test_func = testapp_teardown}, 300 + }; 301 + 284 302 285 303 #endif /* TEST_XSK_H_ */
+11 -4
tools/testing/selftests/bpf/xskxceiver.c
··· 326 326 printf("Tests:\n"); 327 327 for (i = 0; i < ARRAY_SIZE(tests); i++) 328 328 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); 329 331 } 330 332 331 333 int main(int argc, char **argv) 332 334 { 335 + const size_t total_tests = ARRAY_SIZE(tests) + ARRAY_SIZE(ci_skip_tests); 333 336 struct pkt_stream *rx_pkt_stream_default; 334 337 struct pkt_stream *tx_pkt_stream_default; 335 338 struct ifobject *ifobj_tx, *ifobj_rx; ··· 360 357 print_tests(); 361 358 ksft_exit_xpass(); 362 359 } 363 - if (opt_run_test != RUN_ALL_TESTS && opt_run_test >= ARRAY_SIZE(tests)) { 360 + if (opt_run_test != RUN_ALL_TESTS && opt_run_test >= total_tests) { 364 361 ksft_print_msg("Error: test %u does not exist.\n", opt_run_test); 365 362 ksft_exit_xfail(); 366 363 } ··· 400 397 test.rx_pkt_stream_default = rx_pkt_stream_default; 401 398 402 399 if (opt_run_test == RUN_ALL_TESTS) 403 - nb_tests = ARRAY_SIZE(tests); 400 + nb_tests = total_tests; 404 401 else 405 402 nb_tests = 1; 406 403 if (opt_mode == TEST_MODE_ALL) { ··· 422 419 if (opt_mode != TEST_MODE_ALL && i != opt_mode) 423 420 continue; 424 421 425 - for (j = 0; j < ARRAY_SIZE(tests); j++) { 422 + for (j = 0; j < total_tests; j++) { 426 423 if (opt_run_test != RUN_ALL_TESTS && j != opt_run_test) 427 424 continue; 428 425 429 - test_init(&test, ifobj_tx, ifobj_rx, i, &tests[j]); 426 + if (j < ARRAY_SIZE(tests)) 427 + test_init(&test, ifobj_tx, ifobj_rx, i, &tests[j]); 428 + else 429 + test_init(&test, ifobj_tx, ifobj_rx, i, 430 + &ci_skip_tests[j - ARRAY_SIZE(tests)]); 430 431 run_pkt_test(&test); 431 432 usleep(USLEEP_MAX); 432 433