Lines Matching refs:cg_fd
789 static int run_options(struct sockmap_options *options, int cg_fd, int test) in run_options() argument
816 err = bpf_prog_attach(prog_fd[2], cg_fd, BPF_CGROUP_SOCK_OPS, 0); in run_options()
1067 bpf_prog_detach2(prog_fd[2], cg_fd, BPF_CGROUP_SOCK_OPS); in run_options()
1661 static int __test_suite(int cg_fd, char *bpf_file) in __test_suite() argument
1663 int err, cleanup = cg_fd; in __test_suite()
1671 if (cg_fd < 0) { in __test_suite()
1677 cg_fd = create_and_get_cgroup(CG_PATH); in __test_suite()
1678 if (cg_fd < 0) { in __test_suite()
1681 cg_fd, optarg); in __test_suite()
1682 return cg_fd; in __test_suite()
1693 err = test_txmsg(cg_fd); in __test_suite()
1698 err = test_mixed(cg_fd); in __test_suite()
1703 err = test_start_end(cg_fd); in __test_suite()
1711 close(cg_fd); in __test_suite()
1716 static int test_suite(int cg_fd) in test_suite() argument
1720 err = __test_suite(cg_fd, BPF_SOCKMAP_FILENAME); in test_suite()
1723 err = __test_suite(cg_fd, BPF_SOCKHASH_FILENAME); in test_suite()
1725 if (cg_fd > -1) in test_suite()
1726 close(cg_fd); in test_suite()
1734 int opt, longindex, err, cg_fd = 0; in main() local
1769 cg_fd = open(optarg, O_DIRECTORY, O_RDONLY); in main()
1770 if (cg_fd < 0) { in main()
1773 cg_fd, optarg); in main()
1774 return cg_fd; in main()
1817 if (argc <= 3 && cg_fd) in main()
1818 return test_suite(cg_fd); in main()
1820 if (!cg_fd) { in main()
1841 err = run_options(&options, cg_fd, test); in main()
1842 close(cg_fd); in main()