Home
last modified time | relevance | path

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

/external/linux-kselftest/tools/testing/selftests/bpf/prog_tests/
Dsockopt_sk.c134 static int prog_attach(struct bpf_object *obj, int cgroup_fd, const char *title) in prog_attach() argument
153 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, in prog_attach()
163 static void run_test(int cgroup_fd) in run_test() argument
176 err = prog_attach(obj, cgroup_fd, "cgroup/getsockopt"); in run_test()
180 err = prog_attach(obj, cgroup_fd, "cgroup/setsockopt"); in run_test()
192 int cgroup_fd; in test_sockopt_sk() local
194 cgroup_fd = test__join_cgroup("/sockopt_sk"); in test_sockopt_sk()
195 if (CHECK_FAIL(cgroup_fd < 0)) in test_sockopt_sk()
198 run_test(cgroup_fd); in test_sockopt_sk()
199 close(cgroup_fd); in test_sockopt_sk()
Dsockopt_inherit.c139 static int prog_attach(struct bpf_object *obj, int cgroup_fd, const char *title) in prog_attach() argument
158 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, in prog_attach()
168 static void run_test(int cgroup_fd) in run_test() argument
184 err = prog_attach(obj, cgroup_fd, "cgroup/getsockopt"); in run_test()
188 err = prog_attach(obj, cgroup_fd, "cgroup/setsockopt"); in run_test()
227 int cgroup_fd; in test_sockopt_inherit() local
229 cgroup_fd = test__join_cgroup("/sockopt_inherit"); in test_sockopt_inherit()
230 if (CHECK_FAIL(cgroup_fd < 0)) in test_sockopt_inherit()
233 run_test(cgroup_fd); in test_sockopt_inherit()
234 close(cgroup_fd); in test_sockopt_inherit()
Dtcp_rtt.c119 static int run_test(int cgroup_fd, int server_fd) in run_test() argument
142 err = bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_SOCK_OPS, 0); in run_test()
250 int server_fd, cgroup_fd; in test_tcp_rtt() local
253 cgroup_fd = test__join_cgroup("/tcp_rtt"); in test_tcp_rtt()
254 if (CHECK_FAIL(cgroup_fd < 0)) in test_tcp_rtt()
269 CHECK_FAIL(run_test(cgroup_fd, server_fd)); in test_tcp_rtt()
273 close(cgroup_fd); in test_tcp_rtt()
Dsockopt_multi.c5 static int prog_attach(struct bpf_object *obj, int cgroup_fd, const char *title) in prog_attach() argument
24 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, in prog_attach()
34 static int prog_detach(struct bpf_object *obj, int cgroup_fd, const char *title) in prog_detach() argument
49 err = bpf_prog_detach2(bpf_program__fd(prog), cgroup_fd, in prog_detach()
Dsockopt.c877 static int run_test(int cgroup_fd, struct sockopt_test *test) in run_test() argument
892 err = bpf_prog_attach(prog_fd, cgroup_fd, test->attach_type, 0); in run_test()
965 bpf_prog_detach2(prog_fd, cgroup_fd, test->attach_type); in run_test()
973 int cgroup_fd, i; in test_sockopt() local
975 cgroup_fd = test__join_cgroup("/sockopt"); in test_sockopt()
976 if (CHECK_FAIL(cgroup_fd < 0)) in test_sockopt()
981 CHECK_FAIL(run_test(cgroup_fd, &tests[i])); in test_sockopt()
984 close(cgroup_fd); in test_sockopt()
/external/linux-kselftest/tools/testing/selftests/bpf/
Dtest_dev_cgroup.c27 int prog_fd, cgroup_fd; in main() local
42 cgroup_fd = create_and_get_cgroup(TEST_CGROUP); in main()
43 if (cgroup_fd < 0) { in main()
54 if (bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_DEVICE, 0)) { in main()
59 if (bpf_prog_query(cgroup_fd, BPF_CGROUP_DEVICE, 0, NULL, NULL, in main()
Dtest_netcnt.c42 int prog_fd, cgroup_fd; in main() local
67 cgroup_fd = create_and_get_cgroup(TEST_CGROUP); in main()
68 if (cgroup_fd < 0) { in main()
79 if (bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_INET_EGRESS, 0)) { in main()
89 if (bpf_prog_query(cgroup_fd, BPF_CGROUP_INET_EGRESS, 0, NULL, NULL, in main()
Dget_cgroup_id_user.c53 int cgroup_fd, cgidmap_fd, pidmap_fd; in main() local
66 cgroup_fd = create_and_get_cgroup(TEST_CGROUP); in main()
67 if (CHECK(cgroup_fd < 0, "create_and_get_cgroup", "err %d errno %d\n", in main()
68 cgroup_fd, errno)) in main()
Dtest_cgroup_storage.c40 int map_fd, percpu_map_fd, prog_fd, cgroup_fd; in main() local
83 cgroup_fd = create_and_get_cgroup(TEST_CGROUP); in main()
84 if (cgroup_fd < 0) { in main()
95 if (bpf_prog_attach(prog_fd, cgroup_fd, BPF_CGROUP_INET_EGRESS, 0)) { in main()
Dtest_sock_fields.c419 int cgroup_fd, egress_fd, ingress_fd, err; in main() local
431 cgroup_fd = create_and_get_cgroup(TEST_CGROUP); in main()
432 CHECK(cgroup_fd == -1, "create_and_get_cgroup()", in main()
433 "cgroup_fd:%d errno:%d", cgroup_fd, errno); in main()
448 err = bpf_prog_attach(egress_fd, cgroup_fd, BPF_CGROUP_INET_EGRESS, 0); in main()
452 err = bpf_prog_attach(ingress_fd, cgroup_fd, in main()
456 close(cgroup_fd); in main()