Home
last modified time | relevance | path

Searched refs:progfd (Results 1 – 7 of 7) sorted by relevance

/linux-6.1.9/tools/testing/selftests/bpf/
Dtest_lirc_mode2_user.c52 int ret, lircfd, progfd, inputfd; in main() local
63 BPF_PROG_TYPE_LIRC_MODE2, &obj, &progfd); in main()
76 ret = bpf_prog_detach2(progfd, lircfd, BPF_LIRC_MODE2); in main()
101 ret = bpf_prog_attach(progfd, lircfd, BPF_LIRC_MODE2, 0); in main()
170 ret = bpf_prog_detach2(progfd, lircfd, BPF_LIRC_MODE2); in main()
Dtest_sock.c407 static int attach_sock_prog(int cgfd, int progfd, in attach_sock_prog() argument
410 return bpf_prog_attach(progfd, cgfd, attach_type, BPF_F_ALLOW_OVERRIDE); in attach_sock_prog()
482 int progfd = -1; in run_test_case() local
487 progfd = load_sock_prog(test->insns, test->expected_attach_type); in run_test_case()
488 if (progfd < 0) { in run_test_case()
495 if (attach_sock_prog(cgfd, progfd, test->attach_type) < 0) { in run_test_case()
511 if (progfd != -1) in run_test_case()
513 close(progfd); in run_test_case()
Dtest_sock_addr.c1319 int progfd = -1; in run_test_case() local
1324 progfd = test->loadfn(test); in run_test_case()
1325 if (test->expected_result == LOAD_REJECT && progfd < 0) in run_test_case()
1327 else if (test->expected_result == LOAD_REJECT || progfd < 0) in run_test_case()
1330 err = bpf_prog_attach(progfd, cgfd, test->attach_type, in run_test_case()
1381 if (progfd != -1) in run_test_case()
1383 close(progfd); in run_test_case()
Dtest_sysctl.c1547 int progfd = -1; in run_test_case() local
1555 progfd = load_sysctl_prog(test, sysctl_path); in run_test_case()
1556 if (progfd < 0) { in run_test_case()
1563 if (bpf_prog_attach(progfd, cgfd, atype, BPF_F_ALLOW_OVERRIDE) < 0) { in run_test_case()
1588 if (progfd != -1) in run_test_case()
1590 close(progfd); in run_test_case()
/linux-6.1.9/tools/bpf/bpftool/
Dnet.c540 static int do_attach_detach_xdp(int progfd, enum net_attach_type attach_type, in do_attach_detach_xdp() argument
554 return bpf_xdp_attach(ifindex, progfd, flags, NULL); 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()
Dprog.c1023 static int parse_attach_detach_args(int argc, char **argv, int *progfd, in parse_attach_detach_args() argument
1030 *progfd = prog_parse_fd(&argc, &argv); in parse_attach_detach_args()
1031 if (*progfd < 0) in parse_attach_detach_args()
1032 return *progfd; in parse_attach_detach_args()
1059 int err, progfd; in do_attach() local
1063 &progfd, &attach_type, &mapfd); in do_attach()
1067 err = bpf_prog_attach(progfd, mapfd, attach_type, 0); in do_attach()
1081 int err, progfd; in do_detach() local
1085 &progfd, &attach_type, &mapfd); in do_detach()
1089 err = bpf_prog_detach2(progfd, mapfd, attach_type); in do_detach()
/linux-6.1.9/tools/testing/selftests/bpf/prog_tests/
Dsockmap_listen.c272 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()