Home
last modified time | relevance | path

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

/linux-6.1.9/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 serial_test_netcnt() local
33 cg_fd = test__join_cgroup(CG_NAME); in serial_test_netcnt()
34 if (!ASSERT_GE(cg_fd, 0, "test__join_cgroup")) in serial_test_netcnt()
37 skel->links.bpf_nextcnt = bpf_program__attach_cgroup(skel->progs.bpf_nextcnt, cg_fd); in serial_test_netcnt()
78 if (cg_fd != -1) in serial_test_netcnt()
79 close(cg_fd); in serial_test_netcnt()
Dcgroup_iter.c23 static int cg_fd[] = {-1, -1, -1, -1}; variable
36 cg_fd[i] = fd; in setup_cgroups()
47 close(cg_fd[i]); in cleanup_cgroups()
119 linfo.cgroup.cgroup_fd = (__u32)cg_fd[PARENT]; in test_invalid_cgroup_spec()
136 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_walk_preorder()
147 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_walk_postorder()
161 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_walk_ancestors_up()
176 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_early_termination()
188 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_walk_self_only()
Dsetget_sockopt.c20 static int cg_fd; variable
88 cg_fd = test__join_cgroup(CG_NAME); in test_setget_sockopt()
89 if (cg_fd < 0) in test_setget_sockopt()
108 bpf_program__attach_cgroup(skel->progs.skops_sockopt, cg_fd); in test_setget_sockopt()
113 bpf_program__attach_cgroup(skel->progs.socket_post_create, cg_fd); in test_setget_sockopt()
124 close(cg_fd); in test_setget_sockopt()
Dtcpbpf_user.c117 int cg_fd = -1; in test_tcpbpf_user() local
123 cg_fd = test__join_cgroup(CG_NAME); in test_tcpbpf_user()
124 if (!ASSERT_GE(cg_fd, 0, "test__join_cgroup(" CG_NAME ")")) in test_tcpbpf_user()
127 skel->links.bpf_testcb = bpf_program__attach_cgroup(skel->progs.bpf_testcb, cg_fd); in test_tcpbpf_user()
134 if (cg_fd != -1) in test_tcpbpf_user()
135 close(cg_fd); in test_tcpbpf_user()
Dtcp_hdr_options.c33 static int cg_fd; variable
319 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in fastopen_estab()
363 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in syncookie_estab()
395 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in fin()
434 link = bpf_program__attach_cgroup(skel->progs.estab, cg_fd); in __simple_estab()
471 link = bpf_program__attach_cgroup(misc_skel->progs.misc_estab, cg_fd); in misc()
541 cg_fd = test__join_cgroup(CG_NAME); in test_tcp_hdr_options()
542 if (!ASSERT_GE(cg_fd, 0, "join_cgroup")) in test_tcp_hdr_options()
557 close(cg_fd); in test_tcp_hdr_options()
/linux-6.1.9/samples/bpf/
Dtest_cgrp2_attach.c92 static int attach_filter(int cg_fd, int type, int verdict) in attach_filter() argument
113 ret = bpf_prog_attach(prog_fd, cg_fd, type, 0); in attach_filter()
138 int opt, cg_fd, ret; in main() local
163 cg_fd = open(argv[optind], O_DIRECTORY | O_RDONLY); in main()
164 if (cg_fd < 0) { in main()
170 ret = bpf_prog_detach(cg_fd, type); in main()
174 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.c212 int cg_fd, prog_fd, ret; in main() local
261 cg_fd = open(cgrp_path, O_DIRECTORY | O_RDONLY); in main()
262 if (cg_fd < 0) { in main()
276 ret = bpf_prog_attach(prog_fd, cg_fd, in main()
284 ret = bpf_prog_detach(cg_fd, BPF_CGROUP_INET_SOCK_CREATE); in main()
292 close(cg_fd); in main()
/linux-6.1.9/tools/testing/selftests/bpf/
Dtest_tcpnotify_user.c77 int prog_fd, rv, cg_fd = -1; in main() local
90 cg_fd = cgroup_setup_and_join(cg_path); in main()
91 if (cg_fd < 0) in main()
99 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_sockmap.c153 void (*tester)(int cg_fd, struct sockmap_options *opt);
953 static int run_options(struct sockmap_options *options, int cg_fd, int test) in run_options() argument
1004 err = bpf_prog_attach(prog_fd[3], cg_fd, BPF_CGROUP_SOCK_OPS, 0); in run_options()
1282 bpf_prog_detach2(prog_fd[3], cg_fd, BPF_CGROUP_SOCK_OPS); in run_options()
1899 static int __test_selftests(int cg_fd, struct sockmap_options *opt) in __test_selftests() argument
1919 t.tester(cg_fd, opt); in __test_selftests()
1926 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt) in test_selftests_sockmap() argument
1929 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
1932 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt) in test_selftests_sockhash() argument
1935 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
[all …]
Dcgroup_helpers.c422 int cg_fd; in cgroup_setup_and_join() local
429 cg_fd = create_and_get_cgroup(path); in cgroup_setup_and_join()
430 if (cg_fd < 0) { in cgroup_setup_and_join()
433 return cg_fd; in cgroup_setup_and_join()
441 return cg_fd; in cgroup_setup_and_join()