Home
last modified time | relevance | path

Searched refs:sk_fds (Results 1 – 3 of 3) sorted by relevance

/Linux-v5.10/tools/testing/selftests/bpf/prog_tests/
Dtcp_hdr_options.c35 struct sk_fds { struct
90 static void sk_fds_close(struct sk_fds *sk_fds) in sk_fds_close() argument
92 close(sk_fds->srv_fd); in sk_fds_close()
93 close(sk_fds->passive_fd); in sk_fds_close()
94 close(sk_fds->active_fd); in sk_fds_close()
97 static int sk_fds_shutdown(struct sk_fds *sk_fds) in sk_fds_shutdown() argument
101 shutdown(sk_fds->active_fd, SHUT_WR); in sk_fds_shutdown()
102 ret = read(sk_fds->passive_fd, &abyte, sizeof(abyte)); in sk_fds_shutdown()
108 shutdown(sk_fds->passive_fd, SHUT_WR); in sk_fds_shutdown()
109 ret = read(sk_fds->active_fd, &abyte, sizeof(abyte)); in sk_fds_shutdown()
[all …]
Dselect_reuseport.c37 static int sk_fds[REUSEPORT_ARRAY_SIZE]; variable
437 srv_fd = sk_fds[ev.data.u32]; in do_test()
559 err = setsockopt(sk_fds[0], SOL_SOCKET, SO_DETACH_REUSEPORT_BPF, in test_detach_bpf()
564 err = setsockopt(sk_fds[1], SOL_SOCKET, SO_DETACH_REUSEPORT_BPF, in test_detach_bpf()
621 sk_fds[i] = socket(family, type, 0); in prepare_sk_fds()
622 RET_IF(sk_fds[i] == -1, "socket()", "sk_fds[%d]:%d errno:%d\n", in prepare_sk_fds()
623 i, sk_fds[i], errno); in prepare_sk_fds()
624 err = setsockopt(sk_fds[i], SOL_SOCKET, SO_REUSEPORT, in prepare_sk_fds()
631 err = setsockopt(sk_fds[i], SOL_SOCKET, in prepare_sk_fds()
639 err = bind(sk_fds[i], (struct sockaddr *)&srv_sa, addrlen); in prepare_sk_fds()
[all …]
/Linux-v5.10/tools/testing/selftests/bpf/map_tests/
Dsk_storage_map.c170 int i, map_fd, err, *sk_fds; in insert_close_thread() local
172 sk_fds = malloc(sizeof(*sk_fds) * nr_sk_per_thread); in insert_close_thread()
173 if (!sk_fds) { in insert_close_thread()
179 sk_fds[i] = -1; in insert_close_thread()
187 sk_fds[i] = socket(AF_INET6, SOCK_STREAM, 0); in insert_close_thread()
188 if (sk_fds[i] == -1) { in insert_close_thread()
193 err = bpf_map_update_elem(map_fd, &sk_fds[i], &value, in insert_close_thread()
209 close(sk_fds[i]); in insert_close_thread()
210 sk_fds[i] = -1; in insert_close_thread()
216 free(sk_fds); in insert_close_thread()
[all …]