Home
last modified time | relevance | path

Searched refs:prog_fd (Results 1 – 25 of 81) sorted by relevance

1234

/external/linux-kselftest/tools/testing/selftests/bpf/prog_tests/
Dtailcalls.c10 int err, map_fd, prog_fd, main_fd, i, j; in test_tailcall_1() local
19 &prog_fd); in test_tailcall_1()
46 prog_fd = bpf_program__fd(prog); in test_tailcall_1()
47 if (CHECK_FAIL(prog_fd < 0)) in test_tailcall_1()
50 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1()
78 prog_fd = bpf_program__fd(prog); in test_tailcall_1()
79 if (CHECK_FAIL(prog_fd < 0)) in test_tailcall_1()
82 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY); in test_tailcall_1()
100 prog_fd = bpf_program__fd(prog); in test_tailcall_1()
101 if (CHECK_FAIL(prog_fd < 0)) in test_tailcall_1()
[all …]
Dflow_dissector_reattach.c53 int prog_fd[2] = { -1, -1 }; in do_flow_dissector_reattach() local
56 prog_fd[0] = load_prog(); in do_flow_dissector_reattach()
57 if (prog_fd[0] < 0) in do_flow_dissector_reattach()
60 prog_fd[1] = load_prog(); in do_flow_dissector_reattach()
61 if (prog_fd[1] < 0) in do_flow_dissector_reattach()
64 err = bpf_prog_attach(prog_fd[0], 0, BPF_FLOW_DISSECTOR, 0); in do_flow_dissector_reattach()
71 err = bpf_prog_attach(prog_fd[1], 0, BPF_FLOW_DISSECTOR, 0); in do_flow_dissector_reattach()
78 err = bpf_prog_attach(prog_fd[1], 0, BPF_FLOW_DISSECTOR, 0); in do_flow_dissector_reattach()
88 close(prog_fd[1]); in do_flow_dissector_reattach()
89 close(prog_fd[0]); in do_flow_dissector_reattach()
Dspinlock.c9 int prog_fd; in test_spinlock() local
13 err = bpf_prog_load(file, BPF_PROG_TYPE_CGROUP_SKB, &obj, &prog_fd); in test_spinlock()
20 &spin_lock_thread, &prog_fd))) in test_spinlock()
25 ret != (void *)&prog_fd)) in test_spinlock()
Dpkt_access.c9 int err, prog_fd; in test_pkt_access() local
11 err = bpf_prog_load(file, BPF_PROG_TYPE_SCHED_CLS, &obj, &prog_fd); in test_pkt_access()
15 err = bpf_prog_test_run(prog_fd, 100000, &pkt_v4, sizeof(pkt_v4), in test_pkt_access()
21 err = bpf_prog_test_run(prog_fd, 100000, &pkt_v6, sizeof(pkt_v6), in test_pkt_access()
Dxdp_adjust_tail.c10 int err, prog_fd; in test_xdp_adjust_tail() local
12 err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); in test_xdp_adjust_tail()
16 err = bpf_prog_test_run(prog_fd, 1, &pkt_v4, sizeof(pkt_v4), in test_xdp_adjust_tail()
23 err = bpf_prog_test_run(prog_fd, 1, &pkt_v6, sizeof(pkt_v6), in test_xdp_adjust_tail()
Dsignal_pending.c16 int prog_fd; in test_signal_pending_by_type() local
24 prog_fd = bpf_load_program(prog_type, prog, ARRAY_SIZE(prog), in test_signal_pending_by_type()
26 CHECK(prog_fd < 0, "test-run", "errno %d\n", errno); in test_signal_pending_by_type()
34 err = bpf_prog_test_run(prog_fd, 0xffffffff, &pkt_v4, sizeof(pkt_v4), in test_signal_pending_by_type()
Dxdp.c16 int err, prog_fd, map_fd; in test_xdp() local
18 err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); in test_xdp()
28 err = bpf_prog_test_run(prog_fd, 1, &pkt_v4, sizeof(pkt_v4), in test_xdp()
36 err = bpf_prog_test_run(prog_fd, 1, &pkt_v6, sizeof(pkt_v6), in test_xdp()
Dpkt_md_access.c9 int err, prog_fd; in test_pkt_md_access() local
11 err = bpf_prog_load(file, BPF_PROG_TYPE_SCHED_CLS, &obj, &prog_fd); in test_pkt_md_access()
15 err = bpf_prog_test_run(prog_fd, 10, &pkt_v4, sizeof(pkt_v4), in test_pkt_md_access()
Dbpf_obj_id.c146 int prog_fd; in test_bpf_obj_id() local
150 prog_fd = bpf_prog_get_fd_by_id(next_id); in test_bpf_obj_id()
151 if (prog_fd < 0 && errno == ENOENT) in test_bpf_obj_id()
154 if (CHECK(prog_fd < 0, "get-prog-fd(next_id)", in test_bpf_obj_id()
156 prog_fd, next_id, errno)) in test_bpf_obj_id()
173 err = bpf_obj_get_info_by_fd(prog_fd, &prog_info, &info_len); in test_bpf_obj_id()
184 err = bpf_obj_get_info_by_fd(prog_fd, &prog_info, &info_len); in test_bpf_obj_id()
195 close(prog_fd); in test_bpf_obj_id()
Dmap_lock.c36 int prog_fd, map_fd[2], vars[17] = {}; in test_map_lock() local
42 err = bpf_prog_load(file, BPF_PROG_TYPE_CGROUP_SKB, &obj, &prog_fd); in test_map_lock()
58 &spin_lock_thread, &prog_fd))) in test_map_lock()
67 ret != (void *)&prog_fd)) in test_map_lock()
Dqueue_stack_map.c13 int i, err, prog_fd, map_in_fd, map_out_fd; in test_queue_stack_map_by_type() local
29 err = bpf_prog_load(file, BPF_PROG_TYPE_SCHED_CLS, &obj, &prog_fd); in test_queue_stack_map_by_type()
60 err = bpf_prog_test_run(prog_fd, 1, &pkt_v4, sizeof(pkt_v4), in test_queue_stack_map_by_type()
73 err = bpf_prog_test_run(prog_fd, 1, &pkt_v4, sizeof(pkt_v4), in test_queue_stack_map_by_type()
Dxdp_noinline.c27 int err, i, prog_fd, map_fd; in test_xdp_noinline() local
33 err = bpf_prog_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); in test_xdp_noinline()
52 err = bpf_prog_test_run(prog_fd, NUM_ITER, &pkt_v4, sizeof(pkt_v4), in test_xdp_noinline()
59 err = bpf_prog_test_run(prog_fd, NUM_ITER, &pkt_v6, sizeof(pkt_v6), in test_xdp_noinline()
Dl4lb_all.c26 int err, i, prog_fd, map_fd; in test_l4lb() local
32 err = bpf_prog_load(file, BPF_PROG_TYPE_SCHED_CLS, &obj, &prog_fd); in test_l4lb()
51 err = bpf_prog_test_run(prog_fd, NUM_ITER, &pkt_v4, sizeof(pkt_v4), in test_l4lb()
58 err = bpf_prog_test_run(prog_fd, NUM_ITER, &pkt_v6, sizeof(pkt_v6), in test_l4lb()
Dtask_fd_query_tp.c8 int err, bytes, efd, prog_fd, pmu_fd; in test_task_fd_query_tp_core() local
16 err = bpf_prog_load(file, BPF_PROG_TYPE_TRACEPOINT, &obj, &prog_fd); in test_task_fd_query_tp_core()
47 err = ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd); in test_task_fd_query_tp_core()
/external/bcc/introspection/
Dbps.c186 int prog_fd; in print_one_prog() local
189 prog_fd = bpf_prog_get_fd_by_id(prog_id); in print_one_prog()
190 if (prog_fd == -1) { in print_one_prog()
208 close(prog_fd); in print_one_prog()
216 ret = bpf_obj_get_info(prog_fd, &prog_info, &info_len); in print_one_prog()
220 close(prog_fd); in print_one_prog()
230 close(prog_fd); in print_one_prog()
280 int prog_fd; in print_all_progs() local
283 prog_fd = bpf_prog_get_fd_by_id(next_id); in print_all_progs()
284 if (prog_fd < 0) { in print_all_progs()
[all …]
/external/linux-kselftest/tools/testing/selftests/bpf/
Dtest_skb_cgroup_id_user.c85 int prog_fd = -1; in get_map_fd_by_prog_id() local
88 prog_fd = bpf_prog_get_fd_by_id(prog_id); in get_map_fd_by_prog_id()
89 if (prog_fd < 0) { in get_map_fd_by_prog_id()
97 if (bpf_obj_get_info_by_fd(prog_fd, &info, &info_len)) { in get_map_fd_by_prog_id()
98 log_err("Failed to get info by prog fd %d", prog_fd); in get_map_fd_by_prog_id()
103 log_err("No maps found for prog fd %d", prog_fd); in get_map_fd_by_prog_id()
111 if (prog_fd >= 0) in get_map_fd_by_prog_id()
112 close(prog_fd); in get_map_fd_by_prog_id()
Dflow_dissector_load.h13 int *prog_fd, in bpf_flow_load() argument
22 prog_fd); in bpf_flow_load()
30 *prog_fd = bpf_program__fd(main_prog); in bpf_flow_load()
31 if (*prog_fd < 0) in bpf_flow_load()
58 if (fd != *prog_fd) { in bpf_flow_load()
Dxdping.c96 int prog_fd = -1, map_fd = -1; in main() local
176 if (bpf_prog_load(filename, BPF_PROG_TYPE_XDP, &obj, &prog_fd)) { in main()
185 prog_fd = bpf_program__fd(main_prog); in main()
186 if (!main_prog || prog_fd < 0) { in main()
206 if (bpf_set_link_xdp_fd(ifindex, prog_fd, xdp_flags) < 0) { in main()
212 close(prog_fd); in main()
252 if (prog_fd > 0) in main()
253 close(prog_fd); in main()
Dtest_tcp_check_syncookie_user.c86 int prog_fd = -1; in get_map_fd_by_prog_id() local
89 prog_fd = bpf_prog_get_fd_by_id(prog_id); in get_map_fd_by_prog_id()
90 if (prog_fd < 0) { in get_map_fd_by_prog_id()
98 if (bpf_obj_get_info_by_fd(prog_fd, &info, &info_len)) { in get_map_fd_by_prog_id()
99 log_err("Failed to get info by prog fd %d", prog_fd); in get_map_fd_by_prog_id()
104 log_err("No maps found for prog fd %d", prog_fd); in get_map_fd_by_prog_id()
114 if (prog_fd >= 0) in get_map_fd_by_prog_id()
115 close(prog_fd); in get_map_fd_by_prog_id()
Dtest_dev_cgroup.c27 int prog_fd, cgroup_fd; in main() local
31 &obj, &prog_fd)) { in main()
54 if (bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_DEVICE, 0)) { in main()
Dflow_dissector_load.c25 int prog_fd, ret; in load_and_attach_program() local
29 cfg_map_name, NULL, &prog_fd, NULL); in load_and_attach_program()
33 ret = bpf_prog_attach(prog_fd, 0 /* Ignore */, BPF_FLOW_DISSECTOR, 0); in load_and_attach_program()
Dtest_cgroup_storage.c40 int map_fd, percpu_map_fd, prog_fd, cgroup_fd; in main() local
69 prog_fd = bpf_load_program(BPF_PROG_TYPE_CGROUP_SKB, in main()
72 if (prog_fd < 0) { in main()
95 if (bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_INET_EGRESS, 0)) { in main()
/external/ltp/testcases/kernel/syscalls/bpf/
Dbpf_prog03.c123 int map_fd, prog_fd; in run() local
144 prog_fd = load_prog(map_fd); in run()
145 if (prog_fd == -1) in run()
152 &prog_fd, sizeof(prog_fd)); in run()
170 SAFE_CLOSE(prog_fd); in run()
Dbpf_prog01.c106 int map_fd, prog_fd; in run() local
128 prog_fd = load_prog(map_fd); in run()
132 &prog_fd, sizeof(prog_fd)); in run()
152 SAFE_CLOSE(prog_fd); in run()
Dbpf_prog02.c105 int map_fd, prog_fd; in run() local
116 prog_fd = load_prog(map_fd); in run()
120 &prog_fd, sizeof(prog_fd)); in run()
163 SAFE_CLOSE(prog_fd); in run()

1234