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

selfetest/bpf: Make some tests serial

Change tests that often fails in parallel execution mode to serial.

Signed-off-by: Yucong Sun <sunyucong@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211006185619.364369-15-fallentree@fb.com

authored by

Yucong Sun and committed by
Andrii Nakryiko
d3f7b166 5db02dd7

+48 -38
+1 -1
tools/testing/selftests/bpf/prog_tests/bpf_iter_setsockopt.c
··· 179 179 free_fds(est_fds, nr_est); 180 180 } 181 181 182 - void test_bpf_iter_setsockopt(void) 182 + void serial_test_bpf_iter_setsockopt(void) 183 183 { 184 184 struct bpf_iter_setsockopt *iter_skel = NULL; 185 185 struct bpf_cubic *cubic_skel = NULL;
+1 -1
tools/testing/selftests/bpf/prog_tests/bpf_obj_id.c
··· 3 3 4 4 #define nr_iters 2 5 5 6 - void test_bpf_obj_id(void) 6 + void serial_test_bpf_obj_id(void) 7 7 { 8 8 const __u64 array_magic_value = 0xfaceb00c; 9 9 const __u32 array_key = 0;
+1 -1
tools/testing/selftests/bpf/prog_tests/cg_storage_multi.c
··· 363 363 cg_storage_multi_shared__destroy(obj); 364 364 } 365 365 366 - void test_cg_storage_multi(void) 366 + void serial_test_cg_storage_multi(void) 367 367 { 368 368 int parent_cgroup_fd = -1, child_cgroup_fd = -1; 369 369
+1 -1
tools/testing/selftests/bpf/prog_tests/cgroup_attach_autodetach.c
··· 21 21 bpf_log_buf, BPF_LOG_BUF_SIZE); 22 22 } 23 23 24 - void test_cgroup_attach_autodetach(void) 24 + void serial_test_cgroup_attach_autodetach(void) 25 25 { 26 26 __u32 duration = 0, prog_cnt = 4, attach_flags; 27 27 int allow_prog[2] = {-1};
+1 -1
tools/testing/selftests/bpf/prog_tests/cgroup_attach_multi.c
··· 74 74 return ret; 75 75 } 76 76 77 - void test_cgroup_attach_multi(void) 77 + void serial_test_cgroup_attach_multi(void) 78 78 { 79 79 __u32 prog_ids[4], prog_cnt = 0, attach_flags, saved_prog_id; 80 80 int cg1 = 0, cg2 = 0, cg3 = 0, cg4 = 0, cg5 = 0, key = 0;
+1 -1
tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c
··· 23 23 bpf_log_buf, BPF_LOG_BUF_SIZE); 24 24 } 25 25 26 - void test_cgroup_attach_override(void) 26 + void serial_test_cgroup_attach_override(void) 27 27 { 28 28 int drop_prog = -1, allow_prog = -1, foo = -1, bar = -1; 29 29 __u32 duration = 0;
+1 -1
tools/testing/selftests/bpf/prog_tests/cgroup_link.c
··· 24 24 return 0; 25 25 } 26 26 27 - void test_cgroup_link(void) 27 + void serial_test_cgroup_link(void) 28 28 { 29 29 struct { 30 30 const char *path;
+1 -1
tools/testing/selftests/bpf/prog_tests/check_mtu.c
··· 195 195 test_check_mtu__destroy(skel); 196 196 } 197 197 198 - void test_check_mtu(void) 198 + void serial_test_check_mtu(void) 199 199 { 200 200 __u32 mtu_lo; 201 201
+2 -1
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c
··· 380 380 "./test_attach_probe.o"); 381 381 } 382 382 383 - void test_fexit_bpf2bpf(void) 383 + /* NOTE: affect other tests, must run in serial mode */ 384 + void serial_test_fexit_bpf2bpf(void) 384 385 { 385 386 if (test__start_subtest("target_no_callees")) 386 387 test_target_no_callees();
+1 -1
tools/testing/selftests/bpf/prog_tests/flow_dissector_load_bytes.c
··· 2 2 #include <test_progs.h> 3 3 #include <network_helpers.h> 4 4 5 - void test_flow_dissector_load_bytes(void) 5 + void serial_test_flow_dissector_load_bytes(void) 6 6 { 7 7 struct bpf_flow_keys flow_keys; 8 8 __u32 duration = 0, retval, size;
+1 -1
tools/testing/selftests/bpf/prog_tests/flow_dissector_reattach.c
··· 628 628 } 629 629 } 630 630 631 - void test_flow_dissector_reattach(void) 631 + void serial_test_flow_dissector_reattach(void) 632 632 { 633 633 int err, new_net, saved_net; 634 634
+1 -1
tools/testing/selftests/bpf/prog_tests/get_branch_snapshot.c
··· 73 73 free(pfd_array); 74 74 } 75 75 76 - void test_get_branch_snapshot(void) 76 + void serial_test_get_branch_snapshot(void) 77 77 { 78 78 struct get_branch_snapshot *skel = NULL; 79 79 int err;
+2 -1
tools/testing/selftests/bpf/prog_tests/kfree_skb.c
··· 48 48 *(bool *)ctx = true; 49 49 } 50 50 51 - void test_kfree_skb(void) 51 + /* TODO: fix kernel panic caused by this test in parallel mode */ 52 + void serial_test_kfree_skb(void) 52 53 { 53 54 struct __sk_buff skb = {}; 54 55 struct bpf_prog_test_run_attr tattr = {
+1 -1
tools/testing/selftests/bpf/prog_tests/migrate_reuseport.c
··· 541 541 } 542 542 } 543 543 544 - void test_migrate_reuseport(void) 544 + void serial_test_migrate_reuseport(void) 545 545 { 546 546 struct test_migrate_reuseport *skel; 547 547 int i;
+2 -1
tools/testing/selftests/bpf/prog_tests/modify_return.c
··· 53 53 modify_return__destroy(skel); 54 54 } 55 55 56 - void test_modify_return(void) 56 + /* TODO: conflict with get_func_ip_test */ 57 + void serial_test_modify_return(void) 57 58 { 58 59 run_test(0 /* input_retval */, 59 60 1 /* want_side_effect */,
+2 -1
tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c
··· 78 78 return; 79 79 } 80 80 81 - void test_ns_current_pid_tgid(void) 81 + /* TODO: use a different tracepoint */ 82 + void serial_test_ns_current_pid_tgid(void) 82 83 { 83 84 if (test__start_subtest("ns_current_pid_tgid_root_ns")) 84 85 test_current_pid_tgid(NULL);
+1 -1
tools/testing/selftests/bpf/prog_tests/perf_buffer.c
··· 43 43 return 0; 44 44 } 45 45 46 - void test_perf_buffer(void) 46 + void serial_test_perf_buffer(void) 47 47 { 48 48 int err, on_len, nr_on_cpus = 0, nr_cpus, i; 49 49 struct perf_buffer_opts pb_opts = {};
+2 -1
tools/testing/selftests/bpf/prog_tests/perf_link.c
··· 23 23 ++j; 24 24 } 25 25 26 - void test_perf_link(void) 26 + /* TODO: often fails in concurrent mode */ 27 + void serial_test_perf_link(void) 27 28 { 28 29 struct test_perf_link *skel = NULL; 29 30 struct perf_event_attr attr;
+2 -1
tools/testing/selftests/bpf/prog_tests/probe_user.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <test_progs.h> 3 3 4 - void test_probe_user(void) 4 + /* TODO: corrupts other tests uses connect() */ 5 + void serial_test_probe_user(void) 5 6 { 6 7 const char *prog_name = "handle_sys_connect"; 7 8 const char *obj_file = "./test_probe_user.o";
+2 -1
tools/testing/selftests/bpf/prog_tests/raw_tp_writable_test_run.c
··· 3 3 #include <test_progs.h> 4 4 #include <linux/nbd.h> 5 5 6 - void test_raw_tp_writable_test_run(void) 6 + /* NOTE: conflict with other tests. */ 7 + void serial_test_raw_tp_writable_test_run(void) 7 8 { 8 9 __u32 duration = 0; 9 10 char error[4096];
+1 -1
tools/testing/selftests/bpf/prog_tests/select_reuseport.c
··· 858 858 cleanup(); 859 859 } 860 860 861 - void test_select_reuseport(void) 861 + void serial_test_select_reuseport(void) 862 862 { 863 863 saved_tcp_fo = read_int_sysctl(TCP_FO_SYSCTL); 864 864 if (saved_tcp_fo < 0)
+2 -1
tools/testing/selftests/bpf/prog_tests/send_signal_sched_switch.c
··· 25 25 return NULL; 26 26 } 27 27 28 - void test_send_signal_sched_switch(void) 28 + /* NOTE: cause events loss */ 29 + void serial_test_send_signal_sched_switch(void) 29 30 { 30 31 struct test_send_signal_kern *skel; 31 32 pthread_t threads[THREAD_COUNT];
+1 -1
tools/testing/selftests/bpf/prog_tests/sk_storage_tracing.c
··· 105 105 close(listen_fd); 106 106 } 107 107 108 - void test_sk_storage_tracing(void) 108 + void serial_test_sk_storage_tracing(void) 109 109 { 110 110 struct test_sk_storage_trace_itself *skel_itself; 111 111 int err;
+1 -1
tools/testing/selftests/bpf/prog_tests/snprintf_btf.c
··· 6 6 /* Demonstrate that bpf_snprintf_btf succeeds and that various data types 7 7 * are formatted correctly. 8 8 */ 9 - void test_snprintf_btf(void) 9 + void serial_test_snprintf_btf(void) 10 10 { 11 11 struct netif_receive_skb *skel; 12 12 struct netif_receive_skb__bss *bss;
+1 -1
tools/testing/selftests/bpf/prog_tests/sock_fields.c
··· 329 329 close(listen_fd); 330 330 } 331 331 332 - void test_sock_fields(void) 332 + void serial_test_sock_fields(void) 333 333 { 334 334 struct bpf_link *egress_link = NULL, *ingress_link = NULL; 335 335 int parent_cg_fd = -1, child_cg_fd = -1;
+1 -1
tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
··· 2037 2037 test_udp_unix_redir(skel, map, family); 2038 2038 } 2039 2039 2040 - void test_sockmap_listen(void) 2040 + void serial_test_sockmap_listen(void) 2041 2041 { 2042 2042 struct test_sockmap_listen *skel; 2043 2043
+2 -1
tools/testing/selftests/bpf/prog_tests/timer.c
··· 39 39 return 0; 40 40 } 41 41 42 - void test_timer(void) 42 + /* TODO: use pid filtering */ 43 + void serial_test_timer(void) 43 44 { 44 45 struct timer *timer_skel = NULL; 45 46 int err;
+1 -1
tools/testing/selftests/bpf/prog_tests/timer_mim.c
··· 52 52 return 0; 53 53 } 54 54 55 - void test_timer_mim(void) 55 + void serial_test_timer_mim(void) 56 56 { 57 57 struct timer_mim_reject *timer_reject_skel = NULL; 58 58 libbpf_print_fn_t old_print_fn = NULL;
+1 -1
tools/testing/selftests/bpf/prog_tests/tp_attach_query.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <test_progs.h> 3 3 4 - void test_tp_attach_query(void) 4 + void serial_test_tp_attach_query(void) 5 5 { 6 6 const int num_progs = 3; 7 7 int i, j, bytes, efd, err, prog_fd[num_progs], pmu_fd[num_progs];
+1 -1
tools/testing/selftests/bpf/prog_tests/trace_printk.c
··· 8 8 #define TRACEBUF "/sys/kernel/debug/tracing/trace_pipe" 9 9 #define SEARCHMSG "testing,testing" 10 10 11 - void test_trace_printk(void) 11 + void serial_test_trace_printk(void) 12 12 { 13 13 int err = 0, iter = 0, found = 0; 14 14 struct trace_printk__bss *bss;
+1 -1
tools/testing/selftests/bpf/prog_tests/trace_vprintk.c
··· 8 8 #define TRACEBUF "/sys/kernel/debug/tracing/trace_pipe" 9 9 #define SEARCHMSG "1,2,3,4,5,6,7,8,9,10" 10 10 11 - void test_trace_vprintk(void) 11 + void serial_test_trace_vprintk(void) 12 12 { 13 13 int err = 0, iter = 0, found = 0; 14 14 struct trace_vprintk__bss *bss;
+2 -1
tools/testing/selftests/bpf/prog_tests/trampoline_count.c
··· 41 41 return bpf_program__attach_trace(prog); 42 42 } 43 43 44 - void test_trampoline_count(void) 44 + /* TODO: use different target function to run in concurrent mode */ 45 + void serial_test_trampoline_count(void) 45 46 { 46 47 const char *fentry_name = "fentry/__set_task_comm"; 47 48 const char *fexit_name = "fexit/__set_task_comm";
+1 -1
tools/testing/selftests/bpf/prog_tests/xdp_attach.c
··· 4 4 #define IFINDEX_LO 1 5 5 #define XDP_FLAGS_REPLACE (1U << 4) 6 6 7 - void test_xdp_attach(void) 7 + void serial_test_xdp_attach(void) 8 8 { 9 9 __u32 duration = 0, id1, id2, id0 = 0, len; 10 10 struct bpf_object *obj1, *obj2, *obj3;
+1 -1
tools/testing/selftests/bpf/prog_tests/xdp_bonding.c
··· 519 519 { "xdp_bonding_xor_layer34", BOND_MODE_XOR, BOND_XMIT_POLICY_LAYER34, }, 520 520 }; 521 521 522 - void test_xdp_bonding(void) 522 + void serial_test_xdp_bonding(void) 523 523 { 524 524 libbpf_print_fn_t old_print_fn; 525 525 struct skeletons skeletons = {};
+1 -1
tools/testing/selftests/bpf/prog_tests/xdp_cpumap_attach.c
··· 7 7 8 8 #define IFINDEX_LO 1 9 9 10 - void test_xdp_cpumap_attach(void) 10 + void serial_test_xdp_cpumap_attach(void) 11 11 { 12 12 struct test_xdp_with_cpumap_helpers *skel; 13 13 struct bpf_prog_info info = {};
+1 -1
tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c
··· 72 72 } 73 73 74 74 75 - void test_xdp_devmap_attach(void) 75 + void serial_test_xdp_devmap_attach(void) 76 76 { 77 77 if (test__start_subtest("DEVMAP with programs in entries")) 78 78 test_xdp_with_devmap_helpers();
+1 -1
tools/testing/selftests/bpf/prog_tests/xdp_info.c
··· 4 4 5 5 #define IFINDEX_LO 1 6 6 7 - void test_xdp_info(void) 7 + void serial_test_xdp_info(void) 8 8 { 9 9 __u32 len = sizeof(struct bpf_prog_info), duration = 0, prog_id; 10 10 const char *file = "./xdp_dummy.o";
+1 -1
tools/testing/selftests/bpf/prog_tests/xdp_link.c
··· 6 6 7 7 #define IFINDEX_LO 1 8 8 9 - void test_xdp_link(void) 9 + void serial_test_xdp_link(void) 10 10 { 11 11 __u32 duration = 0, id1, id2, id0 = 0, prog_fd1, prog_fd2, err; 12 12 DECLARE_LIBBPF_OPTS(bpf_xdp_set_link_opts, opts, .old_fd = -1);