Home
last modified time | relevance | path

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

/Linux-v5.10/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.10/tools/testing/selftests/bpf/
Dtest_tcpnotify_user.c78 int prog_fd, rv, cg_fd = -1; in main() local
89 cg_fd = cgroup_setup_and_join(cg_path); in main()
90 if (cg_fd < 0) in main()
98 rv = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_SOCK_OPS, 0); in main()
163 bpf_prog_detach(cg_fd, BPF_CGROUP_SOCK_OPS); in main()
164 close(cg_fd); in main()
Dtest_tcpbpf_user.c100 int cg_fd = -1; in main() local
105 cg_fd = cgroup_setup_and_join(cg_path); in main()
106 if (cg_fd < 0) in main()
114 rv = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_SOCK_OPS, 0); in main()
161 bpf_prog_detach(cg_fd, BPF_CGROUP_SOCK_OPS); in main()
162 close(cg_fd); in main()
Dcgroup_helpers.c295 int cg_fd; in cgroup_setup_and_join() local
302 cg_fd = create_and_get_cgroup(path); in cgroup_setup_and_join()
303 if (cg_fd < 0) { in cgroup_setup_and_join()
306 return cg_fd; in cgroup_setup_and_join()
314 return cg_fd; in cgroup_setup_and_join()
Dtest_sockmap.c153 void (*tester)(int cg_fd, struct sockmap_options *opt);
909 static int run_options(struct sockmap_options *options, int cg_fd, int test) in run_options() argument
960 err = bpf_prog_attach(prog_fd[3], cg_fd, BPF_CGROUP_SOCK_OPS, 0); in run_options()
1238 bpf_prog_detach2(prog_fd[3], cg_fd, BPF_CGROUP_SOCK_OPS); in run_options()
1820 static int __test_selftests(int cg_fd, struct sockmap_options *opt) in __test_selftests() argument
1840 t.tester(cg_fd, opt); in __test_selftests()
1847 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt) in test_selftests_sockmap() argument
1850 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
1853 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt) in test_selftests_sockhash() argument
1856 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
[all …]
/Linux-v5.10/tools/testing/selftests/bpf/prog_tests/
Dtcp_hdr_options.c33 static int cg_fd; variable
355 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in fastopen_estab()
400 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in syncookie_estab()
433 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in fin()
473 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in __simple_estab()
511 link = bpf_program__attach_cgroup(misc_skel->progs.misc_estab, cg_fd); in misc()
590 cg_fd = test__join_cgroup(CG_NAME); in test_tcp_hdr_options()
591 if (CHECK_FAIL(cg_fd < 0)) in test_tcp_hdr_options()
606 close(cg_fd); in test_tcp_hdr_options()