Home
last modified time | relevance | path

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

/linux/tools/testing/selftests/bpf/prog_tests/
H A 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()
58 cg_fd); in test_sockopt_qos_to_cc()
63 run_setsockopt_test(cg_fd, sock_fd); in test_sockopt_qos_to_cc()
68 if (cg_fd != -1) in test_sockopt_qos_to_cc()
69 close(cg_fd); in test_sockopt_qos_to_cc()
H A 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()
H A 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()
H A Dcgroup_iter.c24 static int cg_fd[] = {-1, -1, -1, -1}; variable
37 cg_fd[i] = fd; in setup_cgroups()
48 close(cg_fd[i]); in cleanup_cgroups()
120 linfo.cgroup.cgroup_fd = (__u32)cg_fd[PARENT]; in test_invalid_cgroup_spec()
137 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_walk_preorder()
148 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_walk_postorder()
162 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_walk_ancestors_up()
177 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_early_termination()
189 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT], in test_walk_self_only()
289 read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[CHILD2], in test_walk_self_only_css_task()
H A Dsetget_sockopt.c21 static int cg_fd; variable
159 cg_fd = test__join_cgroup(CG_NAME); in test_setget_sockopt()
160 if (cg_fd < 0) in test_setget_sockopt()
179 bpf_program__attach_cgroup(skel->progs.skops_sockopt, cg_fd); in test_setget_sockopt()
184 bpf_program__attach_cgroup(skel->progs.socket_post_create, cg_fd); in test_setget_sockopt()
197 close(cg_fd); in test_setget_sockopt()
H A 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()
543 cg_fd = test__join_cgroup(CG_NAME); in test_tcp_hdr_options()
544 if (!ASSERT_GE(cg_fd, 0, "join_cgroup")) in test_tcp_hdr_options()
559 close(cg_fd); in test_tcp_hdr_options()
H A Diters.c209 int err, cg_fd, cg_id; in subtest_css_task_iters() local
215 cg_fd = create_and_get_cgroup(cgrp_path); in subtest_css_task_iters()
216 if (!ASSERT_GE(cg_fd, 0, "create_and_get_cgroup")) in subtest_css_task_iters()
/linux/samples/bpf/
H A 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()
H A 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()
H A 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/tools/testing/selftests/bpf/
H A 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()
H A Dtest_sockmap.c1943 t.tester(cg_fd, opt); in __test_selftests()
1953 __test_selftests(cg_fd, opt); in test_selftests_sockmap()
1959 __test_selftests(cg_fd, opt); in test_selftests_sockhash()
1967 __test_selftests(cg_fd, opt); in test_selftests_ktls()
2019 if (cg_fd < 0) { in main()
2022 cg_fd, optarg); in main()
2023 return cg_fd; in main()
2077 if (!cg_fd) { in main()
2079 if (cg_fd < 0) in main()
2080 return cg_fd; in main()
[all …]
H A Dcgroup_helpers.c486 int cg_fd; in cgroup_setup_and_join() local
493 cg_fd = create_and_get_cgroup(path); in cgroup_setup_and_join()
494 if (cg_fd < 0) { in cgroup_setup_and_join()
497 return cg_fd; in cgroup_setup_and_join()
505 return cg_fd; in cgroup_setup_and_join()
/linux/tools/tracing/rtla/src/
H A Dutils.c639 int cg_fd; in set_pid_cgroup() local
663 cg_fd = open(cgroup_procs, O_RDWR); in set_pid_cgroup()
664 if (cg_fd < 0) in set_pid_cgroup()
669 retval = write(cg_fd, pid_str, strlen(pid_str)); in set_pid_cgroup()
676 close(cg_fd); in set_pid_cgroup()
698 int cg_fd; in set_comm_cgroup() local
728 cg_fd = open(cgroup_procs, O_RDWR); in set_comm_cgroup()
729 if (cg_fd < 0) in set_comm_cgroup()
744 retval = write(cg_fd, proc_entry->d_name, strlen(proc_entry->d_name)); in set_comm_cgroup()
755 close(cg_fd); in set_comm_cgroup()
[all …]