Lines Matching defs:cg_fd
160 void (*tester)(int cg_fd, struct sockmap_options *opt);
1049 static int run_options(struct sockmap_options *options, int cg_fd, int test)
1097 err = bpf_prog_attach(bpf_program__fd(progs[3]), cg_fd, BPF_CGROUP_SOCK_OPS, 0);
1376 bpf_prog_detach2(bpf_program__fd(progs[3]), cg_fd, BPF_CGROUP_SOCK_OPS);
2049 static int __test_selftests(int cg_fd, struct sockmap_options *opt)
2069 t.tester(cg_fd, opt);
2076 static void test_selftests_sockmap(int cg_fd, struct sockmap_options *opt)
2079 __test_selftests(cg_fd, opt);
2082 static void test_selftests_sockhash(int cg_fd, struct sockmap_options *opt)
2085 __test_selftests(cg_fd, opt);
2088 static void test_selftests_ktls(int cg_fd, struct sockmap_options *opt)
2093 __test_selftests(cg_fd, opt);
2097 static int test_selftest(int cg_fd, struct sockmap_options *opt)
2099 test_selftests_sockmap(cg_fd, opt);
2100 test_selftests_sockhash(cg_fd, opt);
2101 test_selftests_ktls(cg_fd, opt);
2110 int opt, longindex, err, cg_fd = 0;
2143 cg_fd = open(optarg, O_DIRECTORY, O_RDONLY);
2144 if (cg_fd < 0) {
2147 cg_fd, optarg);
2148 return cg_fd;
2202 if (!cg_fd) {
2203 cg_fd = cgroup_setup_and_join(CG_PATH);
2204 if (cg_fd < 0)
2205 return cg_fd;
2213 err = test_selftest(cg_fd, &options);
2232 err = run_options(&options, cg_fd, test);
2238 close(cg_fd);