/tools/testing/selftests/bpf/prog_tests/ |
D | sockopt_qos_to_cc.c | 7 static void run_setsockopt_test(int cg_fd, int sock_fd) in run_setsockopt_test() argument 15 err = setsockopt(sock_fd, SOL_IPV6, IPV6_TCLASS, &buf, sizeof(buf)); in run_setsockopt_test() 21 err = getsockopt(sock_fd, SOL_TCP, TCP_CONGESTION, cc, &optlen); in run_setsockopt_test() 34 int sock_fd = -1; in test_sockopt_qos_to_cc() local 45 sock_fd = socket(AF_INET6, SOCK_STREAM, 0); in test_sockopt_qos_to_cc() 46 if (!ASSERT_GE(sock_fd, 0, "v6 socket open")) in test_sockopt_qos_to_cc() 49 err = setsockopt(sock_fd, SOL_TCP, TCP_CONGESTION, &cc_cubic, in test_sockopt_qos_to_cc() 61 run_setsockopt_test(cg_fd, sock_fd); in test_sockopt_qos_to_cc() 64 if (sock_fd != -1) in test_sockopt_qos_to_cc() 65 close(sock_fd); in test_sockopt_qos_to_cc()
|
D | sockopt_multi.c | 58 int cg_child, int sock_fd) in run_getsockopt_test() argument 67 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_getsockopt_test() 75 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test() 98 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test() 122 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test() 141 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_getsockopt_test() 149 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test() 168 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test() 180 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_getsockopt_test() 188 err = getsockopt(sock_fd, SOL_IP, IP_TOS, &buf, &optlen); in run_getsockopt_test() [all …]
|
D | probe_user.c | 9 int err, results_map_fd, sock_fd, duration = 0; in test_probe_user() local 45 sock_fd = socket(AF_INET, SOCK_STREAM, 0); in test_probe_user() 46 if (CHECK(sock_fd < 0, "create_sock_fd", "err %d\n", sock_fd)) in test_probe_user() 49 connect(sock_fd, &curr, sizeof(curr)); in test_probe_user() 50 close(sock_fd); in test_probe_user()
|
D | sockmap_basic.c | 206 __s64 *sock_fd = NULL; in test_sockmap_copy() local 225 sock_fd = calloc(num_sockets, sizeof(*sock_fd)); in test_sockmap_copy() 226 if (CHECK(!sock_fd, "calloc(sock_fd)", "failed to allocate\n")) in test_sockmap_copy() 230 sock_fd[i] = -1; in test_sockmap_copy() 235 sock_fd[i] = connected_socket_v4(); in test_sockmap_copy() 236 if (CHECK(sock_fd[i] == -1, "connected_socket_v4", "cannot connect\n")) in test_sockmap_copy() 239 err = bpf_map_update_elem(src_fd, &i, &sock_fd[i], BPF_NOEXIST); in test_sockmap_copy() 277 for (i = 0; sock_fd && i < num_sockets; i++) in test_sockmap_copy() 278 if (sock_fd[i] >= 0) in test_sockmap_copy() 279 close(sock_fd[i]); in test_sockmap_copy() [all …]
|
D | bpf_iter.c | 950 int sock_fd = -1; in test_bpf_sk_storage_delete() local 961 sock_fd = socket(AF_INET6, SOCK_STREAM, 0); in test_bpf_sk_storage_delete() 962 if (CHECK(sock_fd < 0, "socket", "errno: %d\n", errno)) in test_bpf_sk_storage_delete() 964 err = bpf_map_update_elem(map_fd, &sock_fd, &val, BPF_NOEXIST); in test_bpf_sk_storage_delete() 988 err = bpf_map_lookup_elem(map_fd, &sock_fd, &val); in test_bpf_sk_storage_delete() 998 if (sock_fd >= 0) in test_bpf_sk_storage_delete() 999 close(sock_fd); in test_bpf_sk_storage_delete() 1013 int sock_fd = -1; in test_bpf_sk_storage_get() local 1020 sock_fd = socket(AF_INET6, SOCK_STREAM, 0); in test_bpf_sk_storage_get() 1021 if (CHECK(sock_fd < 0, "socket", "errno: %d\n", errno)) in test_bpf_sk_storage_get() [all …]
|
D | sockopt.c | 879 int sock_fd, err, prog_fd; in run_test() local 902 sock_fd = socket(AF_INET, SOCK_STREAM, 0); in run_test() 903 if (sock_fd < 0) { in run_test() 910 err = setsockopt(sock_fd, test->set_level, test->set_optname, in run_test() 930 err = getsockopt(sock_fd, test->get_level, test->get_optname, in run_test() 963 close(sock_fd); in run_test()
|
D | sk_lookup.c | 88 static int attach_reuseport(int sock_fd, struct bpf_program *reuseport_prog) in attach_reuseport() argument 98 err = setsockopt(sock_fd, SOL_SOCKET, SO_ATTACH_REUSEPORT_EBPF, in attach_reuseport() 494 static int update_lookup_map(struct bpf_map *map, int index, int sock_fd) in update_lookup_map() argument 506 value = (uint64_t)sock_fd; in update_lookup_map()
|
/tools/perf/ |
D | builtin-daemon.c | 809 static int handle_server_socket(struct daemon *daemon, int sock_fd) in handle_server_socket() argument 815 fd = accept(sock_fd, NULL, NULL); in handle_server_socket() 1257 int sock_fd = -1, conf_fd = -1, signal_fd = -1; in __cmd_start() local 1297 sock_fd = setup_server_socket(daemon); in __cmd_start() 1298 if (sock_fd < 0) in __cmd_start() 1309 sock_pos = fdarray__add(&fda, sock_fd, POLLIN|POLLERR|POLLHUP, 0); in __cmd_start() 1332 err = handle_server_socket(daemon, sock_fd); in __cmd_start() 1349 if (sock_fd != -1) in __cmd_start() 1350 close(sock_fd); in __cmd_start()
|