Home
last modified time | relevance | path

Searched refs:cg_fd (Results 1 – 6 of 6) sorted by relevance

/Linux-v5.4/samples/bpf/
Dtest_cgrp2_attach.c87 static int attach_filter(int cg_fd, int type, int verdict) in attach_filter() argument
108 ret = bpf_prog_attach(prog_fd, cg_fd, type, 0); in attach_filter()
133 int opt, cg_fd, ret; in main() local
158 cg_fd = open(argv[optind], O_DIRECTORY | O_RDONLY); in main()
159 if (cg_fd < 0) { in main()
165 ret = bpf_prog_detach(cg_fd, type); in main()
169 ret = attach_filter(cg_fd, type, verdict); in main()
Dtest_cgrp2_sock2.c35 int cg_fd, ret, filter_id = 0; in main() local
40 cg_fd = open(argv[1], O_DIRECTORY | O_RDONLY); in main()
41 if (cg_fd < 0) { in main()
59 ret = bpf_prog_attach(prog_fd[filter_id], cg_fd, in main()
Dtest_cgrp2_sock.c208 int cg_fd, prog_fd, ret; in main() local
257 cg_fd = open(cgrp_path, O_DIRECTORY | O_RDONLY); in main()
258 if (cg_fd < 0) { in main()
272 ret = bpf_prog_attach(prog_fd, cg_fd, in main()
280 ret = bpf_prog_detach(cg_fd, BPF_CGROUP_INET_SOCK_CREATE); in main()
288 close(cg_fd); in main()
/Linux-v5.4/tools/testing/selftests/bpf/
Dtest_tcpbpf_user.c98 int cg_fd = -1; in main() local
105 cg_fd = create_and_get_cgroup(cg_path); in main()
106 if (cg_fd < 0) in main()
117 rv = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_SOCK_OPS, 0); in main()
156 bpf_prog_detach(cg_fd, BPF_CGROUP_SOCK_OPS); in main()
157 close(cg_fd); in main()
Dtest_tcpnotify_user.c78 int prog_fd, rv, cg_fd = -1; in main() local
92 cg_fd = create_and_get_cgroup(cg_path); in main()
93 if (cg_fd < 0) in main()
104 rv = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_SOCK_OPS, 0); in main()
162 bpf_prog_detach(cg_fd, BPF_CGROUP_SOCK_OPS); in main()
163 close(cg_fd); in main()
Dtest_sockmap.c789 static int run_options(struct sockmap_options *options, int cg_fd, int test) in run_options() argument
816 err = bpf_prog_attach(prog_fd[2], cg_fd, BPF_CGROUP_SOCK_OPS, 0); in run_options()
1067 bpf_prog_detach2(prog_fd[2], cg_fd, BPF_CGROUP_SOCK_OPS); in run_options()
1661 static int __test_suite(int cg_fd, char *bpf_file) in __test_suite() argument
1663 int err, cleanup = cg_fd; in __test_suite()
1671 if (cg_fd < 0) { in __test_suite()
1677 cg_fd = create_and_get_cgroup(CG_PATH); in __test_suite()
1678 if (cg_fd < 0) { in __test_suite()
1681 cg_fd, optarg); in __test_suite()
1682 return cg_fd; in __test_suite()
[all …]