/kernel/linux/linux-5.10/tools/testing/selftests/bpf/ |
D | test_lirc_mode2_user.c | 51 int ret, lircfd, progfd, inputfd; in main() local 62 BPF_PROG_TYPE_LIRC_MODE2, &obj, &progfd); in main() 75 ret = bpf_prog_detach2(progfd, lircfd, BPF_LIRC_MODE2); in main() 100 ret = bpf_prog_attach(progfd, lircfd, BPF_LIRC_MODE2, 0); in main() 169 ret = bpf_prog_detach2(progfd, lircfd, BPF_LIRC_MODE2); in main()
|
D | test_sock.c | 349 static int attach_sock_prog(int cgfd, int progfd, in attach_sock_prog() argument 352 return bpf_prog_attach(progfd, cgfd, attach_type, BPF_F_ALLOW_OVERRIDE); in attach_sock_prog() 401 int progfd = -1; in run_test_case() local 405 progfd = load_sock_prog(test->insns, test->expected_attach_type); in run_test_case() 406 if (progfd < 0) { in run_test_case() 413 if (attach_sock_prog(cgfd, progfd, test->attach_type) == -1) { in run_test_case() 439 if (progfd != -1) in run_test_case() 441 close(progfd); in run_test_case()
|
D | test_sock_addr.c | 1544 int progfd = -1; in run_test_case() local 1549 progfd = test->loadfn(test); in run_test_case() 1550 if (test->expected_result == LOAD_REJECT && progfd < 0) in run_test_case() 1552 else if (test->expected_result == LOAD_REJECT || progfd < 0) in run_test_case() 1555 err = bpf_prog_attach(progfd, cgfd, test->attach_type, in run_test_case() 1606 if (progfd != -1) in run_test_case() 1608 close(progfd); in run_test_case()
|
D | test_sysctl.c | 1553 int progfd = -1; in run_test_case() local 1561 progfd = load_sysctl_prog(test, sysctl_path); in run_test_case() 1562 if (progfd < 0) { in run_test_case() 1569 if (bpf_prog_attach(progfd, cgfd, atype, BPF_F_ALLOW_OVERRIDE) == -1) { in run_test_case() 1594 if (progfd != -1) in run_test_case() 1596 close(progfd); in run_test_case()
|
/kernel/linux/linux-5.10/tools/bpf/bpftool/ |
D | net.c | 540 static int do_attach_detach_xdp(int progfd, enum net_attach_type attach_type, in do_attach_detach_xdp() argument 554 return bpf_set_link_xdp_fd(ifindex, progfd, flags); in do_attach_detach_xdp() 560 int progfd, ifindex, err = 0; in do_attach() local 574 progfd = prog_parse_fd(&argc, &argv); in do_attach() 575 if (progfd < 0) in do_attach() 596 err = do_attach_detach_xdp(progfd, attach_type, ifindex, in do_attach() 607 close(progfd); in do_attach() 614 int progfd, ifindex, err = 0; in do_detach() local 632 progfd = -1; in do_detach() 634 err = do_attach_detach_xdp(progfd, attach_type, ifindex, NULL); in do_detach()
|
D | prog.c | 927 static int parse_attach_detach_args(int argc, char **argv, int *progfd, in parse_attach_detach_args() argument 934 *progfd = prog_parse_fd(&argc, &argv); in parse_attach_detach_args() 935 if (*progfd < 0) in parse_attach_detach_args() 936 return *progfd; in parse_attach_detach_args() 963 int err, progfd; in do_attach() local 967 &progfd, &attach_type, &mapfd); in do_attach() 971 err = bpf_prog_attach(progfd, mapfd, attach_type, 0); in do_attach() 985 int err, progfd; in do_detach() local 989 &progfd, &attach_type, &mapfd); in do_detach() 993 err = bpf_prog_detach2(progfd, mapfd, attach_type); in do_detach()
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/prog_tests/ |
D | sockmap_listen.c | 272 static int enable_reuseport(int s, int progfd) in enable_reuseport() argument 279 err = xsetsockopt(s, SOL_SOCKET, SO_ATTACH_REUSEPORT_EBPF, &progfd, in enable_reuseport() 280 sizeof(progfd)); in enable_reuseport() 287 static int socket_loopback_reuseport(int family, int sotype, int progfd) in socket_loopback_reuseport() argument 299 if (progfd >= 0) in socket_loopback_reuseport() 300 enable_reuseport(s, progfd); in socket_loopback_reuseport()
|