int uc_type; /* conn type */
int uc_activeflag; /* active side of connection? */
int uc_flip; /* is peer other endian? */
int uc_type; /* conn type */
int uc_activeflag; /* active side of connection? */
int uc_flip; /* is peer other endian? */
__u32 uc_peer_ip; /* IP address of the peer */
__u16 uc_peer_port; /* port of the peer */
struct list_head uc_stale_list; /* orphaned connections */
__u32 uc_peer_ip; /* IP address of the peer */
__u16 uc_peer_port; /* port of the peer */
struct list_head uc_stale_list; /* orphaned connections */
int uc_tx_flag; /* deadline valid? */
int uc_sending; /* send op is in progress */
usock_tx_t *uc_tx_hello; /* fake tx with hello */
int uc_tx_flag; /* deadline valid? */
int uc_sending; /* send op is in progress */
usock_tx_t *uc_tx_hello; /* fake tx with hello */
* hasn't been set so far */
cfs_atomic_t up_refcount; /* # of users */
pthread_mutex_t up_lock; /* serialize */
* hasn't been set so far */
cfs_atomic_t up_refcount; /* # of users */
pthread_mutex_t up_lock; /* serialize */
struct pollfd *upt_pollfd; /* poll fds */
int upt_nfds; /* active poll fds */
int upt_npollfd; /* allocated poll fds */
struct pollfd *upt_pollfd; /* poll fds */
int upt_nfds; /* active poll fds */
int upt_npollfd; /* allocated poll fds */
pthread_cond_t un_cond; /* condvar to wait for notifications */
pthread_mutex_t un_lock; /* a lock to protect un_cond */
} usock_net_t;
pthread_cond_t un_cond; /* condvar to wait for notifications */
pthread_mutex_t un_lock; /* a lock to protect un_cond */
} usock_net_t;
typedef struct {
int ut_poll_timeout; /* the third arg for poll(2) (seconds) */
int ut_timeout; /* "stuck" socket timeout (seconds) */
typedef struct {
int ut_poll_timeout; /* the third arg for poll(2) (seconds) */
int ut_timeout; /* "stuck" socket timeout (seconds) */
int usocklnd_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
unsigned int niov, struct iovec *iov, lnet_kiov_t *kiov,
unsigned int offset, unsigned int mlen, unsigned int rlen);
int usocklnd_recv(lnet_ni_t *ni, void *private, lnet_msg_t *msg, int delayed,
unsigned int niov, struct iovec *iov, lnet_kiov_t *kiov,
unsigned int offset, unsigned int mlen, unsigned int rlen);
int usocklnd_poll_thread(void *arg);
int usocklnd_add_pollrequest(usock_conn_t *conn, int type, short value);
int usocklnd_poll_thread(void *arg);
int usocklnd_add_pollrequest(usock_conn_t *conn, int type, short value);
void usocklnd_conn_free(usock_conn_t *conn);
void usocklnd_tear_peer_conn(usock_conn_t *conn);
void usocklnd_check_peer_stale(lnet_ni_t *ni, lnet_process_id_t id);
void usocklnd_conn_free(usock_conn_t *conn);
void usocklnd_tear_peer_conn(usock_conn_t *conn);
void usocklnd_check_peer_stale(lnet_ni_t *ni, lnet_process_id_t id);
-int usocklnd_create_passive_conn(lnet_ni_t *ni, int fd, usock_conn_t **connp);
+int usocklnd_create_passive_conn(lnet_ni_t *ni,
+ cfs_socket_t *sock, usock_conn_t **connp);
-int usocklnd_connect_srv_mode(int *fdp, __u32 dst_ip, __u16 dst_port);
-int usocklnd_connect_cli_mode(int *fdp, __u32 dst_ip, __u16 dst_port);
-int usocklnd_set_sock_options(int fd);
+int usocklnd_connect_srv_mode(cfs_socket_t **sockp,
+ __u32 dst_ip, __u16 dst_port);
+int usocklnd_connect_cli_mode(cfs_socket_t **sockp,
+ __u32 dst_ip, __u16 dst_port);
+int usocklnd_set_sock_options(cfs_socket_t *sock);
usock_tx_t *usocklnd_create_noop_tx(__u64 cookie);
usock_tx_t *usocklnd_create_tx(lnet_msg_t *lntmsg);
void usocklnd_init_hello_msg(ksock_hello_msg_t *hello,
usock_tx_t *usocklnd_create_noop_tx(__u64 cookie);
usock_tx_t *usocklnd_create_tx(lnet_msg_t *lntmsg);
void usocklnd_init_hello_msg(ksock_hello_msg_t *hello,
int usocklnd_find_or_create_conn(usock_peer_t *peer, int type,
usock_conn_t **connp,
usock_tx_t *tx, usock_zc_ack_t *zc_ack,
int usocklnd_find_or_create_conn(usock_peer_t *peer, int type,
usock_conn_t **connp,
usock_tx_t *tx, usock_zc_ack_t *zc_ack,
void usocklnd_link_conn_to_peer(usock_conn_t *conn, usock_peer_t *peer, int idx);
int usocklnd_invert_type(int type);
void usocklnd_conn_new_state(usock_conn_t *conn, int new_state);
void usocklnd_link_conn_to_peer(usock_conn_t *conn, usock_peer_t *peer, int idx);
int usocklnd_invert_type(int type);
void usocklnd_conn_new_state(usock_conn_t *conn, int new_state);