/linux-6.6.21/tools/testing/selftests/bpf/prog_tests/ |
D | xdp_adjust_tail.c | 12 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_xdp_adjust_tail_shrink() 24 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_xdp_adjust_tail_shrink() 26 ASSERT_EQ(topts.retval, XDP_DROP, "ipv4 retval"); in test_xdp_adjust_tail_shrink() 29 topts.data_in = &pkt_v6; in test_xdp_adjust_tail_shrink() 30 topts.data_size_in = sizeof(pkt_v6); in test_xdp_adjust_tail_shrink() 31 topts.data_size_out = sizeof(buf); in test_xdp_adjust_tail_shrink() 32 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_xdp_adjust_tail_shrink() 34 ASSERT_EQ(topts.retval, XDP_TX, "ipv6 retval"); in test_xdp_adjust_tail_shrink() 35 ASSERT_EQ(topts.data_size_out, expect_sz, "ipv6 size"); in test_xdp_adjust_tail_shrink() 47 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_xdp_adjust_tail_grow() [all …]
|
D | xdp_adjust_frags.c | 14 LIBBPF_OPTS(bpf_test_run_opts, topts); in test_xdp_update_frags() 36 topts.data_in = buf; in test_xdp_update_frags() 37 topts.data_out = buf; in test_xdp_update_frags() 38 topts.data_size_in = 128; in test_xdp_update_frags() 39 topts.data_size_out = 128; in test_xdp_update_frags() 41 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_xdp_update_frags() 45 ASSERT_EQ(topts.retval, XDP_PASS, "xdp_update_frag retval"); in test_xdp_update_frags() 61 topts.data_in = buf; in test_xdp_update_frags() 62 topts.data_out = buf; in test_xdp_update_frags() 63 topts.data_size_in = 9000; in test_xdp_update_frags() [all …]
|
D | atomics.c | 10 LIBBPF_OPTS(bpf_test_run_opts, topts); in test_add() 14 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_add() 17 if (!ASSERT_OK(topts.retval, "test_run_opts retval")) in test_add() 35 LIBBPF_OPTS(bpf_test_run_opts, topts); in test_sub() 39 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_sub() 42 if (!ASSERT_OK(topts.retval, "test_run_opts retval")) in test_sub() 60 LIBBPF_OPTS(bpf_test_run_opts, topts); in test_and() 64 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_and() 67 if (!ASSERT_OK(topts.retval, "test_run_opts retval")) in test_and() 82 LIBBPF_OPTS(bpf_test_run_opts, topts); in test_or() [all …]
|
D | tailcalls.c | 17 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_tailcall_1() 61 err = bpf_prog_test_run_opts(main_fd, &topts); in test_tailcall_1() 63 ASSERT_EQ(topts.retval, i, "tailcall retval"); in test_tailcall_1() 70 err = bpf_prog_test_run_opts(main_fd, &topts); in test_tailcall_1() 72 ASSERT_EQ(topts.retval, 3, "tailcall retval"); in test_tailcall_1() 90 err = bpf_prog_test_run_opts(main_fd, &topts); in test_tailcall_1() 92 ASSERT_OK(topts.retval, "tailcall retval"); in test_tailcall_1() 114 err = bpf_prog_test_run_opts(main_fd, &topts); in test_tailcall_1() 116 ASSERT_EQ(topts.retval, j, "tailcall retval"); in test_tailcall_1() 123 err = bpf_prog_test_run_opts(main_fd, &topts); in test_tailcall_1() [all …]
|
D | kfunc_call.c | 91 LIBBPF_OPTS(bpf_test_run_opts, topts); in verify_success() 102 topts.ctx_in = &args; in verify_success() 103 topts.ctx_size_in = sizeof(args); in verify_success() 108 topts.data_in = &pkt_v4; in verify_success() 109 topts.data_size_in = sizeof(pkt_v4); in verify_success() 110 topts.repeat = 1; in verify_success() 124 err = bpf_prog_test_run_opts(prog_fd, &topts); in verify_success() 128 if (!ASSERT_EQ(topts.retval, param->retval, "retval")) in verify_success() 139 err = bpf_prog_test_run_opts(prog_fd, &topts); in verify_success() 143 ASSERT_EQ(topts.retval, param->retval, "retval"); in verify_success() [all …]
|
D | prog_run_opts.c | 30 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_prog_run_opts() 48 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_prog_run_opts() 51 ASSERT_OK(topts.retval, "test_run retval"); in test_prog_run_opts() 53 ASSERT_EQ(topts.data_size_out, sizeof(pkt_v4), "test_run data_size_out"); in test_prog_run_opts() 56 run_cnt += topts.repeat; in test_prog_run_opts() 59 topts.data_out = NULL; in test_prog_run_opts() 60 topts.data_size_out = 0; in test_prog_run_opts() 61 topts.repeat = 2; in test_prog_run_opts() 64 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_prog_run_opts() 67 ASSERT_OK(topts.retval, "run_no_output retval"); in test_prog_run_opts() [all …]
|
D | l4lb_all.c | 31 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_l4lb() 56 topts.data_in = &pkt_v4; in test_l4lb() 57 topts.data_size_in = sizeof(pkt_v4); in test_l4lb() 59 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_l4lb() 61 ASSERT_EQ(topts.retval, 7 /*TC_ACT_REDIRECT*/, "ipv4 test_run retval"); in test_l4lb() 62 ASSERT_EQ(topts.data_size_out, 54, "ipv4 test_run data_size_out"); in test_l4lb() 65 topts.data_in = &pkt_v6; in test_l4lb() 66 topts.data_size_in = sizeof(pkt_v6); in test_l4lb() 67 topts.data_size_out = sizeof(buf); /* reset out size */ in test_l4lb() 69 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_l4lb() [all …]
|
D | xdp_noinline.c | 32 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_xdp_noinline() 48 err = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.balancer_ingress_v4), &topts); in test_xdp_noinline() 50 ASSERT_EQ(topts.retval, 1, "ipv4 test_run retval"); in test_xdp_noinline() 51 ASSERT_EQ(topts.data_size_out, 54, "ipv4 test_run data_size_out"); in test_xdp_noinline() 54 topts.data_in = &pkt_v6; in test_xdp_noinline() 55 topts.data_size_in = sizeof(pkt_v6); in test_xdp_noinline() 56 topts.data_out = buf; in test_xdp_noinline() 57 topts.data_size_out = sizeof(buf); in test_xdp_noinline() 59 err = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.balancer_ingress_v6), &topts); in test_xdp_noinline() 61 ASSERT_EQ(topts.retval, 1, "ipv6 test_run retval"); in test_xdp_noinline() [all …]
|
D | pkt_access.c | 10 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_pkt_access() 20 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_pkt_access() 22 ASSERT_OK(topts.retval, "ipv4 test_run_opts retval"); in test_pkt_access() 24 topts.data_in = &pkt_v6; in test_pkt_access() 25 topts.data_size_in = sizeof(pkt_v6); in test_pkt_access() 26 topts.data_size_out = 0; /* reset from last call */ in test_pkt_access() 27 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_pkt_access() 29 ASSERT_OK(topts.retval, "ipv6 test_run_opts retval"); in test_pkt_access()
|
D | xdp.c | 17 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_xdp() 35 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_xdp() 38 ASSERT_EQ(topts.retval, XDP_TX, "ipv4 test_run retval"); in test_xdp() 39 ASSERT_EQ(topts.data_size_out, 74, "ipv4 test_run data_size_out"); in test_xdp() 42 topts.data_in = &pkt_v6; in test_xdp() 43 topts.data_size_in = sizeof(pkt_v6); in test_xdp() 44 topts.data_size_out = sizeof(buf); in test_xdp() 46 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_xdp() 49 ASSERT_EQ(topts.retval, XDP_TX, "ipv6 test_run retval"); in test_xdp() 50 ASSERT_EQ(topts.data_size_out, 114, "ipv6 test_run data_size_out"); in test_xdp()
|
D | queue_stack_map.c | 18 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_queue_stack_map_by_type() 68 topts.data_size_out = sizeof(buf); in test_queue_stack_map_by_type() 69 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_queue_stack_map_by_type() 70 if (err || topts.retval || in test_queue_stack_map_by_type() 71 topts.data_size_out != sizeof(pkt_v4)) in test_queue_stack_map_by_type() 79 ASSERT_OK(topts.retval, "bpf_map_pop_elem test retval"); in test_queue_stack_map_by_type() 80 ASSERT_EQ(topts.data_size_out, sizeof(pkt_v4), in test_queue_stack_map_by_type() 85 topts.data_size_out = sizeof(buf); in test_queue_stack_map_by_type() 86 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_queue_stack_map_by_type() 88 ASSERT_EQ(topts.retval, 2 /* TC_ACT_SHOT */, in test_queue_stack_map_by_type() [all …]
|
D | get_func_args_test.c | 9 LIBBPF_OPTS(bpf_test_run_opts, topts); in test_get_func_args_test() 23 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_get_func_args_test() 25 ASSERT_EQ(topts.retval, 0, "test_run"); in test_get_func_args_test() 31 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_get_func_args_test() 34 ASSERT_EQ(topts.retval >> 16, 1, "test_run"); in test_get_func_args_test() 35 ASSERT_EQ(topts.retval & 0xffff, 1234 + 29, "test_run"); in test_get_func_args_test()
|
D | for_each.c | 19 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_hash_map() 53 err = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.test_pkt_access), &topts); in test_hash_map() 54 duration = topts.duration; in test_hash_map() 55 if (CHECK(err || topts.retval, "ipv4", "err %d errno %d retval %d\n", in test_hash_map() 56 err, errno, topts.retval)) in test_hash_map() 85 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_array_map() 123 err = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.test_pkt_access), &topts); in test_array_map() 124 duration = topts.duration; in test_array_map() 125 if (CHECK(err || topts.retval, "ipv4", "err %d errno %d retval %d\n", in test_array_map() 126 err, errno, topts.retval)) in test_array_map()
|
D | ksyms_module.c | 13 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_ksyms_module_lskel() 27 err = bpf_prog_test_run_opts(skel->progs.load.prog_fd, &topts); in test_ksyms_module_lskel() 30 ASSERT_EQ(topts.retval, 0, "retval"); in test_ksyms_module_lskel() 40 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_ksyms_module_libbpf() 54 err = bpf_prog_test_run_opts(bpf_program__fd(skel->progs.load), &topts); in test_ksyms_module_libbpf() 57 ASSERT_EQ(topts.retval, 0, "retval"); in test_ksyms_module_libbpf()
|
D | get_func_ip_test.c | 14 LIBBPF_OPTS(bpf_test_run_opts, topts); in test_function_entry() 31 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_function_entry() 33 ASSERT_EQ(topts.retval, 0, "test_run"); in test_function_entry() 36 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_function_entry() 67 LIBBPF_OPTS(bpf_test_run_opts, topts); in test_function_body_kprobe() 92 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_function_body_kprobe() 94 ASSERT_EQ(topts.retval, 0, "test_run"); in test_function_body_kprobe()
|
D | parse_tcp_hdr_opt.c | 34 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_parse_opt() 49 err = bpf_prog_test_run_opts(bpf_program__fd(prog), &topts); in test_parse_opt() 51 ASSERT_EQ(topts.retval, XDP_PASS, "ipv6 test_run retval"); in test_parse_opt() 64 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_parse_opt_dynptr() 79 err = bpf_prog_test_run_opts(bpf_program__fd(prog), &topts); in test_parse_opt_dynptr() 81 ASSERT_EQ(topts.retval, XDP_PASS, "ipv6 test_run retval"); in test_parse_opt_dynptr()
|
D | xdp_bpf2bpf.c | 50 LIBBPF_OPTS(bpf_test_run_opts, topts); in run_xdp_bpf2bpf_pkt_size() 76 topts.data_in = buf_in; in run_xdp_bpf2bpf_pkt_size() 77 topts.data_size_in = pkt_size; in run_xdp_bpf2bpf_pkt_size() 78 topts.data_out = buf; in run_xdp_bpf2bpf_pkt_size() 79 topts.data_size_out = BUF_SZ; in run_xdp_bpf2bpf_pkt_size() 81 err = bpf_prog_test_run_opts(pkt_fd, &topts); in run_xdp_bpf2bpf_pkt_size() 84 ASSERT_EQ(topts.retval, XDP_PASS, "ipv4 retval"); in run_xdp_bpf2bpf_pkt_size() 85 ASSERT_EQ(topts.data_size_out, pkt_size, "ipv4 size"); in run_xdp_bpf2bpf_pkt_size()
|
D | type_cast.c | 13 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_xdp() 31 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_xdp() 33 ASSERT_EQ(topts.retval, XDP_PASS, "xdp test_run retval"); in test_xdp() 49 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_tc() 65 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_tc() 67 ASSERT_EQ(topts.retval, 0, "tc test_run retval"); in test_tc()
|
D | raw_tp_writable_test_run.c | 59 LIBBPF_OPTS(bpf_test_run_opts, topts, in serial_test_raw_tp_writable_test_run() 64 int err = bpf_prog_test_run_opts(filter_fd, &topts); in serial_test_raw_tp_writable_test_run() 67 CHECK(topts.retval != 0, "test_run_ret", in serial_test_raw_tp_writable_test_run() 72 err = bpf_prog_test_run_opts(filter_fd, &topts); in serial_test_raw_tp_writable_test_run() 75 CHECK(topts.retval != 0, "test_run_ret_notrace", in serial_test_raw_tp_writable_test_run()
|
D | xdp_perf.c | 10 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_xdp_perf() 22 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_xdp_perf() 24 ASSERT_EQ(topts.retval, XDP_PASS, "test_run retval"); in test_xdp_perf() 25 ASSERT_EQ(topts.data_size_out, 128, "test_run data_size_out"); in test_xdp_perf()
|
D | global_data.c | 137 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_global_data() 147 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_global_data() 149 ASSERT_OK(topts.retval, "pass global data run retval"); in test_global_data() 151 test_global_data_number(obj, topts.duration); in test_global_data() 152 test_global_data_string(obj, topts.duration); in test_global_data() 153 test_global_data_struct(obj, topts.duration); in test_global_data() 154 test_global_data_rdonly(obj, topts.duration); in test_global_data()
|
D | flow_dissector_load_bytes.c | 29 LIBBPF_OPTS(bpf_test_run_opts, topts, in serial_test_flow_dissector_load_bytes() 43 err = bpf_prog_test_run_opts(fd, &topts); in serial_test_flow_dissector_load_bytes() 45 ASSERT_EQ(topts.data_size_out, sizeof(flow_keys), in serial_test_flow_dissector_load_bytes() 47 ASSERT_EQ(topts.retval, BPF_OK, "test_run retval"); in serial_test_flow_dissector_load_bytes()
|
D | modify_return.c | 20 LIBBPF_OPTS(bpf_test_run_opts, topts); in run_test() 32 err = bpf_prog_test_run_opts(prog_fd, &topts); in run_test() 35 side_effect = UPPER(topts.retval); in run_test() 36 ret = LOWER(topts.retval); in run_test()
|
D | pkt_md_access.c | 10 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_pkt_md_access() 20 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_pkt_md_access() 22 ASSERT_OK(topts.retval, "test_run_opts retval"); in test_pkt_md_access()
|
D | check_mtu.c | 86 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_check_mtu_run_xdp() 94 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_check_mtu_run_xdp() 96 ASSERT_EQ(topts.retval, retval_expect, "retval"); in test_check_mtu_run_xdp() 139 LIBBPF_OPTS(bpf_test_run_opts, topts, in test_check_mtu_run_tc() 147 err = bpf_prog_test_run_opts(prog_fd, &topts); in test_check_mtu_run_tc() 149 ASSERT_EQ(topts.retval, retval_expect, "retval"); in test_check_mtu_run_tc()
|