Home
last modified time | relevance | path

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

/Linux-v5.15/tools/testing/selftests/bpf/prog_tests/
Dsockopt_qos_to_cc.c7 static void run_setsockopt_test(int cg_fd, int sock_fd) in run_setsockopt_test() argument
33 int cg_fd = -1; in test_sockopt_qos_to_cc() local
37 cg_fd = test__join_cgroup("/sockopt_qos_to_cc"); in test_sockopt_qos_to_cc()
38 if (!ASSERT_GE(cg_fd, 0, "cg-join(sockopt_qos_to_cc)")) in test_sockopt_qos_to_cc()
56 cg_fd); in test_sockopt_qos_to_cc()
61 run_setsockopt_test(cg_fd, sock_fd); in test_sockopt_qos_to_cc()
66 if (cg_fd != -1) in test_sockopt_qos_to_cc()
67 close(cg_fd); in test_sockopt_qos_to_cc()
Dnetcnt.c21 int cg_fd = -1; in test_netcnt() local
33 cg_fd = test__join_cgroup(CG_NAME); in test_netcnt()
34 if (!ASSERT_GE(cg_fd, 0, "test__join_cgroup")) in test_netcnt()
37 skel->links.bpf_nextcnt = bpf_program__attach_cgroup(skel->progs.bpf_nextcnt, cg_fd); in test_netcnt()
78 if (cg_fd != -1) in test_netcnt()
79 close(cg_fd); in test_netcnt()
Dtcpbpf_user.c124 int cg_fd = -1; in test_tcpbpf_user() local
130 cg_fd = test__join_cgroup(CG_NAME); in test_tcpbpf_user()
131 if (CHECK(cg_fd < 0, "test__join_cgroup(" CG_NAME ")", in test_tcpbpf_user()
132 "cg_fd:%d errno:%d", cg_fd, errno)) in test_tcpbpf_user()
135 skel->links.bpf_testcb = bpf_program__attach_cgroup(skel->progs.bpf_testcb, cg_fd); in test_tcpbpf_user()
142 if (cg_fd != -1) in test_tcpbpf_user()
143 close(cg_fd); in test_tcpbpf_user()
Dtcp_hdr_options.c33 static int cg_fd; variable
355 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in fastopen_estab()
399 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in syncookie_estab()
431 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in fin()
470 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in __simple_estab()
507 link = bpf_program__attach_cgroup(misc_skel->progs.misc_estab, cg_fd); in misc()
585 cg_fd = test__join_cgroup(CG_NAME); in test_tcp_hdr_options()
586 if (CHECK_FAIL(cg_fd < 0)) in test_tcp_hdr_options()
601 close(cg_fd); in test_tcp_hdr_options()
/Linux-v5.15/samples/bpf/
Dtest_cgrp2_attach.c88 static int attach_filter(int cg_fd, int type, int verdict) in attach_filter() argument
109 ret = bpf_prog_attach(prog_fd, cg_fd, type, 0); in attach_filter()
134 int opt, cg_fd, ret; in main() local
159 cg_fd = open(argv[optind], O_DIRECTORY | O_RDONLY); in main()
160 if (cg_fd < 0) { in main()
166 ret = bpf_prog_detach(cg_fd, type); in main()
170 ret = attach_filter(cg_fd, type, verdict); in main()
Dtest_cgrp2_sock2.c35 int cg_fd, err, ret = EXIT_FAILURE, filter_id = 0, prog_cnt = 0; in main() local
48 cg_fd = open(argv[1], O_DIRECTORY | O_RDONLY); in main()
49 if (cg_fd < 0) { in main()
76 link = bpf_program__attach_cgroup(progs[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.15/tools/testing/selftests/bpf/
Dtest_tcpnotify_user.c78 int prog_fd, rv, cg_fd = -1; in main() local
91 cg_fd = cgroup_setup_and_join(cg_path); in main()
92 if (cg_fd < 0) in main()
100 rv = bpf_prog_attach(prog_fd, cg_fd, BPF_CGROUP_SOCK_OPS, 0); in main()
165 bpf_prog_detach(cg_fd, BPF_CGROUP_SOCK_OPS); in main()
166 close(cg_fd); in main()
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()
1830 static int __test_selftests(int cg_fd, struct sockmap_options *opt) in __test_selftests() argument
1850 t.tester(cg_fd, opt); in __test_selftests()
1857 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt) in test_selftests_sockmap() argument
1860 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
1863 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt) in test_selftests_sockhash() argument
1866 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
[all …]
Dcgroup_helpers.c303 int cg_fd; in cgroup_setup_and_join() local
310 cg_fd = create_and_get_cgroup(path); in cgroup_setup_and_join()
311 if (cg_fd < 0) { in cgroup_setup_and_join()
314 return cg_fd; in cgroup_setup_and_join()
322 return cg_fd; in cgroup_setup_and_join()