| /linux/tools/testing/selftests/net/ |
| A D | bind_bhash.c | 33 int sock_fd, reuse = 1, err; in bind_socket() local 37 if (sock_fd < 0) { in bind_socket() 39 return sock_fd; in bind_socket() 65 return sock_fd; in bind_socket() 68 close(sock_fd); in bind_socket() 74 int sock_fd, i; in setup() local 79 if (sock_fd < 0) { in setup() 80 ret = sock_fd; in setup() 83 array[i] = sock_fd; in setup() 126 if (sock_fd < 0) in main() [all …]
|
| /linux/tools/testing/selftests/bpf/prog_tests/ |
| A D | sockopt_multi.c | 8 int cg_child, int sock_fd) in run_getsockopt_test() argument 19 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_getsockopt_test() 95 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_getsockopt_test() 131 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_getsockopt_test() 159 int cg_child, int sock_fd) in run_setsockopt_test() argument 170 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_setsockopt_test() 198 err = setsockopt(sock_fd, SOL_IP, IP_TOS, &buf, 1); in run_setsockopt_test() 257 int sock_fd = -1; in test_sockopt_multi() local 273 sock_fd = socket(AF_INET, SOCK_STREAM, 0); in test_sockopt_multi() 274 if (!ASSERT_GE(sock_fd, 0, "socket")) in test_sockopt_multi() [all …]
|
| A D | cgroup_getset_retval.c | 19 static void test_setsockopt_set(int cgroup_fd, int sock_fd) in test_setsockopt_set() argument 436 if (!ASSERT_OK(getsockopt(sock_fd, SOL_CUSTOM, 0, in test_getsockopt_retval_sync() 504 int sock_fd = -1; in test_cgroup_getset_retval() local 511 if (!ASSERT_GE(sock_fd, 0, "start-server")) in test_cgroup_getset_retval() 515 test_setsockopt_set(cgroup_fd, sock_fd); in test_cgroup_getset_retval() 518 test_setsockopt_set_and_get(cgroup_fd, sock_fd); in test_cgroup_getset_retval() 527 test_setsockopt_override(cgroup_fd, sock_fd); in test_cgroup_getset_retval() 536 test_getsockopt_get(cgroup_fd, sock_fd); in test_cgroup_getset_retval() 539 test_getsockopt_override(cgroup_fd, sock_fd); in test_cgroup_getset_retval() 542 test_getsockopt_retval_sync(cgroup_fd, sock_fd); in test_cgroup_getset_retval() [all …]
|
| A 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 47 sock_fd = socket(AF_INET6, SOCK_STREAM, 0); in test_sockopt_qos_to_cc() 48 if (!ASSERT_GE(sock_fd, 0, "v6 socket open")) in test_sockopt_qos_to_cc() 51 err = setsockopt(sock_fd, SOL_TCP, TCP_CONGESTION, &cc_cubic, in test_sockopt_qos_to_cc() 63 run_setsockopt_test(cg_fd, sock_fd); in test_sockopt_qos_to_cc() 66 if (sock_fd != -1) in test_sockopt_qos_to_cc() 67 close(sock_fd); in test_sockopt_qos_to_cc()
|
| A D | probe_user.c | 16 int err, results_map_fd, sock_fd, duration = 0; in serial_test_probe_user() local 58 sock_fd = socket(AF_INET, SOCK_STREAM, 0); in serial_test_probe_user() 59 if (CHECK(sock_fd < 0, "create_sock_fd", "err %d\n", sock_fd)) in serial_test_probe_user() 62 connect(sock_fd, &curr, sizeof(curr)); in serial_test_probe_user() 63 close(sock_fd); in serial_test_probe_user()
|
| A D | connect_ping.c | 34 int sock_fd; in subtest() local 52 sock_fd = socket(family, SOCK_DGRAM, protocol); in subtest() 53 if (!ASSERT_GE(sock_fd, 0, "sock-create")) in subtest() 56 if (!ASSERT_OK(connect(sock_fd, sa, sa_len), "connect")) in subtest() 68 if (!ASSERT_OK(getsockname(sock_fd, sa, &sa_len), in subtest() 93 close(sock_fd); in subtest()
|
| A D | bpf_iter.c | 1131 int sock_fd = -1; in test_bpf_sk_storage_delete() local 1142 if (!ASSERT_GE(sock_fd, 0, "socket")) in test_bpf_sk_storage_delete() 1184 if (sock_fd >= 0) in test_bpf_sk_storage_delete() 1185 close(sock_fd); in test_bpf_sk_storage_delete() 1199 int sock_fd = -1; in test_bpf_sk_storage_get() local 1209 err = listen(sock_fd, 1); in test_bpf_sk_storage_get() 1233 close(sock_fd); in test_bpf_sk_storage_get() 1258 int sock_fd[3] = {-1, -1, -1}; in test_bpf_sk_storage_map() local 1268 num_sockets = ARRAY_SIZE(sock_fd); in test_bpf_sk_storage_map() 1330 if (sock_fd[i] >= 0) in test_bpf_sk_storage_map() [all …]
|
| A D | xdp_metadata.c | 224 int sock_fd, err = 0; in generate_packet_inet() local 232 sock_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); in generate_packet_inet() 233 if (!ASSERT_GE(sock_fd, 0, "socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)")) in generate_packet_inet() 234 return sock_fd; in generate_packet_inet() 236 err = sendto(sock_fd, udp_payload, UDP_PAYLOAD_BYTES, MSG_DONTWAIT, in generate_packet_inet() 240 close(sock_fd); in generate_packet_inet() 380 int sock_fd; in test_xdp_metadata() local 451 sock_fd = xsk_socket__fd(rx_xsk.socket); in test_xdp_metadata() 452 ret = bpf_map_update_elem(bpf_map__fd(bpf_obj->maps.xsk), &queue_id, &sock_fd, 0); in test_xdp_metadata()
|
| A D | sockmap_basic.c | 256 __s64 *sock_fd = NULL; in test_sockmap_copy() local 275 sock_fd = calloc(num_sockets, sizeof(*sock_fd)); in test_sockmap_copy() 276 if (!ASSERT_OK_PTR(sock_fd, "calloc(sock_fd)")) in test_sockmap_copy() 280 sock_fd[i] = -1; in test_sockmap_copy() 285 sock_fd[i] = connected_socket_v4(); in test_sockmap_copy() 286 if (!ASSERT_NEQ(sock_fd[i], -1, "connected_socket_v4")) in test_sockmap_copy() 325 for (i = 0; sock_fd && i < num_sockets; i++) in test_sockmap_copy() 326 if (sock_fd[i] >= 0) in test_sockmap_copy() 327 close(sock_fd[i]); in test_sockmap_copy() 328 if (sock_fd) in test_sockmap_copy() [all …]
|
| A D | token.c | 285 static void child(int sock_fd, struct bpffs_opts *opts, child_callback_fn callback) in child() argument 332 err = sendfd(sock_fd, fs_fd); in child() 340 err = recvfd(sock_fd, &mnt_fd); in child() 386 err = sendfd(sock_fd, token_fd); in child() 398 zclose(sock_fd); in child() 429 static void parent(int child_pid, struct bpffs_opts *bpffs_opts, int sock_fd) in parent() argument 433 err = recvfd(sock_fd, &fs_fd); in parent() 445 err = sendfd(sock_fd, mnt_fd); in parent() 451 err = recvfd(sock_fd, &token_fd); in parent() 459 zclose(sock_fd); in parent()
|
| A D | sockopt.c | 1075 int sock_fd, err, prog_fd, link_fd = -1; in run_test() local 1106 sock_fd = socket(AF_INET, SOCK_STREAM, 0); in run_test() 1107 if (sock_fd < 0) { in run_test() 1121 err = call_setsockopt(use_io_uring, sock_fd, test->set_level, in run_test() 1150 err = call_getsockopt(use_io_uring, sock_fd, test->get_level, in run_test() 1185 close(sock_fd); in run_test()
|
| A D | assign_reuse.c | 16 static int attach_reuseport(int sock_fd, int prog_fd) in attach_reuseport() argument 18 return setsockopt(sock_fd, SOL_SOCKET, SO_ATTACH_REUSEPORT_EBPF, in attach_reuseport()
|
| A D | sk_lookup.c | 90 static int attach_reuseport(int sock_fd, struct bpf_program *reuseport_prog) in attach_reuseport() argument 100 err = setsockopt(sock_fd, SOL_SOCKET, SO_ATTACH_REUSEPORT_EBPF, in attach_reuseport() 433 static int update_lookup_map(struct bpf_map *map, int index, int sock_fd) in update_lookup_map() argument 445 value = (uint64_t)sock_fd; in update_lookup_map()
|
| /linux/arch/um/drivers/ |
| A D | port_user.c | 151 int sock_fd; member 159 dup2(data->sock_fd, 0); in port_pre_exec() 160 dup2(data->sock_fd, 1); in port_pre_exec() 161 dup2(data->sock_fd, 2); in port_pre_exec() 162 close(data->sock_fd); in port_pre_exec() 199 { .sock_fd = new, in port_connection()
|
| /linux/drivers/infiniband/hw/usnic/ |
| A D | usnic_transport.c | 144 struct socket *usnic_transport_get_socket(int sock_fd) in usnic_transport_get_socket() argument 151 sock = sockfd_lookup(sock_fd, &err); in usnic_transport_get_socket() 154 sock_fd, err); in usnic_transport_get_socket()
|
| A D | usnic_ib_qp_grp.c | 266 int sock_fd; in create_udp_flow() local 278 sock_fd = trans_spec->udp.sock_fd; in create_udp_flow() 281 sock = usnic_transport_get_socket(sock_fd); in create_udp_flow() 290 usnic_err("Protocol for fd %d is not UDP", sock_fd); in create_udp_flow()
|
| A D | usnic_transport.h | 57 struct socket *usnic_transport_get_socket(int sock_fd);
|
| A D | usnic_abi.h | 59 uint32_t sock_fd; member
|
| /linux/tools/testing/selftests/bpf/ |
| A D | test_progs.c | 1289 int sock_fd; member 1294 if (recv_message(sock_fd, msg) < 0) in read_prog_test_msg() 1317 if (read_prog_test_msg(sock_fd, &msg, MSG_TEST_LOG)) { in dispatch_thread_read_log() 1356 if (dispatch_thread_read_log(sock_fd, in dispatch_thread_send_subtests() 1368 int sock_fd; in dispatch_thread() local 1370 sock_fd = data->sock_fd; in dispatch_thread() 1403 if (send_message(sock_fd, &msg_do_test) < 0) { in dispatch_thread() 1428 if (dispatch_thread_read_log(sock_fd, in dispatch_thread() 1438 if (dispatch_thread_send_subtests(sock_fd, state)) in dispatch_thread() 1455 if (send_message(sock_fd, &msg_exit) < 0) { in dispatch_thread() [all …]
|
| A D | xdp_hw_metadata.c | 713 int sock_fd = xsk_socket__fd(rx_xsk[i].socket); in main() local 716 printf("map[%d] = %d\n", queue_id, sock_fd); in main() 717 ret = bpf_map_update_elem(bpf_map__fd(bpf_obj->maps.xsk), &queue_id, &sock_fd, 0); in main()
|
| A D | network_helpers.h | 82 int get_socket_local_port(int sock_fd);
|
| A D | xsk.c | 450 int map_fd, sock_fd; in xsk_update_xskmap() local 453 sock_fd = xsk_socket__fd(xsk); in xsk_update_xskmap() 455 return bpf_map_update_elem(map_fd, &index, &sock_fd, 0); in xsk_update_xskmap()
|
| A D | network_helpers.c | 551 int get_socket_local_port(int sock_fd) in get_socket_local_port() argument 557 err = getsockname(sock_fd, (struct sockaddr *)&addr, &addrlen); in get_socket_local_port()
|
| /linux/tools/testing/selftests/landlock/ |
| A D | net_test.c | 184 static int bind_variant_addrlen(const int sock_fd, in bind_variant_addrlen() argument 193 ret = bind(sock_fd, &srv->ipv4_addr, addrlen); in bind_variant_addrlen() 197 ret = bind(sock_fd, &srv->ipv6_addr, addrlen); in bind_variant_addrlen() 201 ret = bind(sock_fd, &srv->unix_addr, addrlen); in bind_variant_addrlen() 214 static int bind_variant(const int sock_fd, in bind_variant() argument 217 return bind_variant_addrlen(sock_fd, srv, get_addrlen(srv, false)); in bind_variant() 220 static int connect_variant_addrlen(const int sock_fd, in connect_variant_addrlen() argument 229 ret = connect(sock_fd, &srv->ipv4_addr, addrlen); in connect_variant_addrlen() 233 ret = connect(sock_fd, &srv->ipv6_addr, addrlen); in connect_variant_addrlen() 237 ret = connect(sock_fd, &srv->unix_addr, addrlen); in connect_variant_addrlen() [all …]
|
| /linux/tools/perf/ |
| A D | builtin-daemon.c | 810 static int handle_server_socket(struct daemon *daemon, int sock_fd) in handle_server_socket() argument 816 fd = accept(sock_fd, NULL, NULL); in handle_server_socket() 1256 int sock_fd = -1, conf_fd = -1, signal_fd = -1; in __cmd_start() local 1296 sock_fd = setup_server_socket(daemon); in __cmd_start() 1297 if (sock_fd < 0) in __cmd_start() 1308 sock_pos = fdarray__add(&fda, sock_fd, POLLIN|POLLERR|POLLHUP, 0); in __cmd_start() 1331 err = handle_server_socket(daemon, sock_fd); in __cmd_start() 1348 if (sock_fd != -1) in __cmd_start() 1349 close(sock_fd); in __cmd_start()
|