Searched refs:prog_fd (Results 76 - 100 of 160) sorted by relevance

1234567

/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dstacktrace_map_raw_tp.c10 int err, prog_fd; local
15 err = bpf_prog_test_load(file, BPF_PROG_TYPE_RAW_TRACEPOINT, &obj, &prog_fd);
H A Dtask_local_storage.c82 int err, map_fd, prog_fd, task_fd; local
120 prog_fd = bpf_program__fd(skel->progs.on_update);
122 err = bpf_prog_get_info_by_fd(prog_fd, &info, &info_len);
126 prog_fd = bpf_program__fd(skel->progs.on_enter);
128 err = bpf_prog_get_info_by_fd(prog_fd, &info, &info_len);
170 int i, prog_fd, err; local
217 prog_fd = bpf_program__fd(skel->progs.socket_post_create);
218 err = bpf_prog_get_info_by_fd(prog_fd, &info, &info_len);
H A Dunpriv_bpf_disabled.c59 __u32 prog_id, int prog_fd, int perf_fd,
117 vals[0] = prog_fd;
142 __u32 prog_id, int prog_fd, int perf_fd,
203 ASSERT_EQ(bpf_prog_query(prog_fd, BPF_TRACE_FENTRY, 0, &attach_flags, prog_ids,
236 int prog_fd, perf_fd = -1, i, ret; local
275 prog_fd = bpf_program__fd(skel->progs.sys_nanosleep_enter);
276 ASSERT_OK(bpf_prog_get_info_by_fd(prog_fd, &prog_info, &prog_info_len),
297 test_unpriv_bpf_disabled_positive(skel, prog_id, prog_fd, perf_fd, map_paths,
301 test_unpriv_bpf_disabled_negative(skel, prog_id, prog_fd, perf_fd, map_paths,
58 test_unpriv_bpf_disabled_positive(struct test_unpriv_bpf_disabled *skel, __u32 prog_id, int prog_fd, int perf_fd, char **map_paths, int *map_fds) argument
141 test_unpriv_bpf_disabled_negative(struct test_unpriv_bpf_disabled *skel, __u32 prog_id, int prog_fd, int perf_fd, char **map_paths, int *map_fds) argument
H A Dkfree_skb.c66 int err, prog_fd; local
73 &obj, &prog_fd);
103 err = bpf_prog_test_run_opts(prog_fd, &topts);
H A Dmetadata.c16 static int prog_holds_map(int prog_fd, int map_fd) argument
33 ret = bpf_prog_get_info_by_fd(prog_fd, &prog_info, &prog_info_len);
47 ret = bpf_prog_get_info_by_fd(prog_fd, &prog_info, &prog_info_len);
H A Dtc_bpf.c14 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_f, .prog_fd = __fd); \
16 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_hf, .handle = 1, .prog_fd = __fd); \
17 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_pf, .priority = 1, .prog_fd = __fd); \
18 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_hpf, .handle = 1, .priority = 1, .prog_fd = __fd); \
22 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_hpfi, .handle = 1, .priority = 1, .prog_fd = __fd, \
28 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts, .handle = 1, .priority = 1, .prog_fd = fd);
52 opts.flags = opts.prog_fd = opts.prog_id = 0;
63 opts.flags = opts.prog_fd = opts.prog_id = 0;
71 DECLARE_LIBBPF_OPTS(bpf_tc_opts, attach_opts, .handle = 1, .priority = 1, .prog_fd = fd);
218 if (!ASSERT_EQ(ret, -EINVAL, "bpf_tc_detach invalid prog_fd se
[all...]
H A Dtest_ldsx_insn.c104 int err, prog_fd; local
121 prog_fd = bpf_program__fd(skel->progs._tc);
122 err = bpf_prog_test_run_opts(prog_fd, &topts);
H A Dtcp_rtt.c108 int prog_fd; local
117 prog_fd = bpf_program__fd(skel->progs._sockops);
119 err = bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_SOCK_OPS, 0);
H A Dmap_ptr.c35 err = bpf_prog_test_run_opts(skel->progs.cg_skb.prog_fd, &topts);
H A Dtp_attach_query.c7 int i, j, bytes, efd, err, prog_fd[num_progs], pmu_fd[num_progs]; local
44 &prog_fd[i]);
53 err = bpf_prog_get_info_by_fd(prog_fd[i], &prog_info,
82 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, prog_fd[i]);
H A Dflow_dissector.c510 int i, err, map_fd, prog_fd; local
525 prog_fd = bpf_program__fd(prog);
526 if (prog_fd < 0)
529 err = bpf_map_update_elem(map_fd, &i, &prog_fd, BPF_ANY);
579 int err, prog_fd; local
581 prog_fd = bpf_program__fd(skel->progs._dissect);
582 if (CHECK(prog_fd < 0, "bpf_program__fd", "err %d\n", prog_fd))
585 err = bpf_prog_attach(prog_fd, 0, BPF_FLOW_DISSECTOR, 0);
591 err = bpf_prog_detach2(prog_fd,
618 int i, err, prog_fd, keys_fd = -1, tap_fd; local
[all...]
H A Dkprobe_multi_test.c15 int err, prog_fd; local
17 prog_fd = bpf_program__fd(skel->progs.trigger);
18 err = bpf_prog_test_run_opts(prog_fd, &topts);
65 int prog_fd, link1_fd = -1, link2_fd = -1; local
73 prog_fd = bpf_program__fd(skel->progs.test_kprobe);
74 link1_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_KPROBE_MULTI, opts);
79 prog_fd = bpf_program__fd(skel->progs.test_kretprobe);
80 link2_fd = bpf_link_create(prog_fd, 0, BPF_TRACE_KPROBE_MULTI, opts);
337 int i, err, prog_fd; local
349 prog_fd
373 int err, prog_fd; local
[all...]
H A Dbpf_obj_id.c157 int prog_fd, cmp_res; local
161 prog_fd = bpf_prog_get_fd_by_id(next_id);
162 if (prog_fd < 0 && errno == ENOENT)
165 if (!ASSERT_GE(prog_fd, 0, "bpf_prog_get_fd_by_id"))
182 err = bpf_prog_get_info_by_fd(prog_fd, &prog_info, &info_len);
192 err = bpf_prog_get_info_by_fd(prog_fd, &prog_info, &info_len);
201 close(prog_fd);
H A Dassign_reuse.c16 static int attach_reuseport(int sock_fd, int prog_fd) argument
19 &prog_fd, sizeof(prog_fd));
136 tc_opts.prog_fd = fd_tc;
162 tc_opts.flags = tc_opts.prog_fd = tc_opts.prog_id = 0;
H A Dglobal_data.c136 int err, prog_fd; local
143 err = bpf_prog_test_load(file, BPF_PROG_TYPE_SCHED_CLS, &obj, &prog_fd);
147 err = bpf_prog_test_run_opts(prog_fd, &topts);
H A Dget_stack_raw_tp.c90 int i, err, prog_fd, exp_cnt = MAX_CNT_RAWTP; local
99 err = bpf_prog_test_load(file_err, BPF_PROG_TYPE_RAW_TRACEPOINT, &obj, &prog_fd);
103 err = bpf_prog_test_load(file, BPF_PROG_TYPE_RAW_TRACEPOINT, &obj, &prog_fd);
/linux-master/tools/testing/selftests/bpf/
H A Dtest_tcp_check_syncookie_user.c26 int prog_fd = -1; local
29 prog_fd = bpf_prog_get_fd_by_id(prog_id);
30 if (prog_fd < 0) {
38 if (bpf_prog_get_info_by_fd(prog_fd, &info, &info_len)) {
39 log_err("Failed to get info by prog fd %d", prog_fd);
44 log_err("No maps found for prog fd %d", prog_fd);
54 if (prog_fd >= 0)
55 close(prog_fd);
H A Dxdp_redirect_multi.c85 int prog_fd, group_all, mac_map; local
153 prog_fd = bpf_program__fd(bpf_object__next_program(obj, NULL));
174 prog_fd = bpf_program__fd(ingress_prog);
176 if (prog_fd < 0 || egress_prog_fd < 0) {
211 /* bind prog_fd to each interface */
212 ret = bpf_xdp_attach(ifindex, prog_fd, xdp_flags, NULL);
H A Dtest_cgroup_storage.c41 int map_fd, percpu_map_fd, prog_fd, cgroup_fd; local
73 prog_fd = bpf_test_load_program(BPF_PROG_TYPE_CGROUP_SKB,
76 if (prog_fd < 0) {
84 if (bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_INET_EGRESS, 0)) {
H A Dtest_tcpnotify_user.c77 int prog_fd, rv, cg_fd = -1; local
94 if (bpf_prog_test_load(file, BPF_PROG_TYPE_SOCK_OPS, &obj, &prog_fd)) {
99 rv = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_SOCK_OPS, 0);
/linux-master/samples/bpf/
H A Dtest_cgrp2_attach.c94 int prog_fd, map_fd, ret, key; local
105 prog_fd = prog_load(map_fd, verdict);
108 if (prog_fd < 0) {
113 ret = bpf_prog_attach(prog_fd, cg_fd, type, 0);
H A Dxdp_adjust_tail_user.c89 int i, prog_fd, map_fd, opt; local
160 prog_fd = bpf_program__fd(prog);
182 if (bpf_xdp_attach(ifindex, prog_fd, xdp_flags, NULL) < 0) {
187 err = bpf_prog_get_info_by_fd(prog_fd, &info, &info_len);
H A Dcookie_uid_helper_example.c64 static int map_fd, prog_fd; variable
165 prog_fd = bpf_prog_load(BPF_PROG_TYPE_SOCKET_FILTER, NULL, "GPL",
167 if (prog_fd < 0)
176 if (bpf_obj_pin(prog_fd, file))
329 close(prog_fd);
/linux-master/tools/lib/bpf/
H A Dbpf.h330 LIBBPF_API int bpf_prog_attach(int prog_fd, int attachable_fd,
333 LIBBPF_API int bpf_prog_detach2(int prog_fd, int attachable_fd,
362 * *prog_fd* to a *target* which can represent a file descriptor or netdevice
365 * @param prog_fd BPF program file descriptor
372 LIBBPF_API int bpf_prog_attach_opts(int prog_fd, int target,
378 * *prog_fd* from a *target* which can represent a file descriptor or netdevice
381 * @param prog_fd BPF program file descriptor
388 LIBBPF_API int bpf_prog_detach_opts(int prog_fd, int target,
443 LIBBPF_API int bpf_link_create(int prog_fd, int target_fd,
463 int prog_fd; member in struct:bpf_prog_test_run_attr
[all...]
/linux-master/tools/perf/util/
H A Dbpf_counter_cgroup.c53 int prog_fd, err; local
157 prog_fd = bpf_program__fd(skel->progs.trigger_read);
158 err = bperf_trigger_reading(prog_fd, 0);
202 int prog_fd = bpf_program__fd(skel->progs.trigger_read); local
205 bperf_trigger_reading(prog_fd, cpu.cpu);

Completed in 167 milliseconds

1234567