Lines Matching full:smc
3 * Shared Memory Communications over RDMA (SMC-R) and RoCE
21 #include "smc.h"
59 static int smc_rx_update_consumer(struct smc_sock *smc, in smc_rx_update_consumer() argument
62 struct smc_connection *conn = &smc->conn; in smc_rx_update_consumer()
63 struct sock *sk = &smc->sk; in smc_rx_update_consumer()
100 static void smc_rx_update_cons(struct smc_sock *smc, size_t len) in smc_rx_update_cons() argument
102 struct smc_connection *conn = &smc->conn; in smc_rx_update_cons()
106 smc_rx_update_consumer(smc, cons, len); in smc_rx_update_cons()
110 struct smc_sock *smc; member
118 struct smc_sock *smc = priv->smc; in smc_rx_pipe_buf_release() local
120 struct sock *sk = &smc->sk; in smc_rx_pipe_buf_release()
126 conn = &smc->conn; in smc_rx_pipe_buf_release()
128 smc_rx_update_cons(smc, priv->len); in smc_rx_pipe_buf_release()
150 struct smc_sock *smc) in smc_rx_splice() argument
152 struct smc_link_group *lgr = smc->conn.lgr; in smc_rx_splice()
161 nr_pages = !lgr->is_smcd && smc->conn.rmb_desc->is_vm ? in smc_rx_splice()
180 (!lgr->is_smcd && !smc->conn.rmb_desc->is_vm)) { in smc_rx_splice()
183 priv[0]->smc = smc; in smc_rx_splice()
184 partial[0].offset = src - (char *)smc->conn.rmb_desc->cpu_addr; in smc_rx_splice()
187 pages[0] = smc->conn.rmb_desc->pages; in smc_rx_splice()
195 priv[i]->smc = smc; in smc_rx_splice()
214 sock_hold(&smc->sk); in smc_rx_splice()
215 if (!lgr->is_smcd && smc->conn.rmb_desc->is_vm) { in smc_rx_splice()
219 get_page(smc->conn.rmb_desc->pages); in smc_rx_splice()
221 atomic_add(bytes, &smc->conn.splice_pending); in smc_rx_splice()
248 * @smc smc socket
255 int smc_rx_wait(struct smc_sock *smc, long *timeo, in smc_rx_wait() argument
259 struct smc_connection *conn = &smc->conn; in smc_rx_wait()
262 struct sock *sk = &smc->sk; in smc_rx_wait()
281 static int smc_rx_recv_urg(struct smc_sock *smc, struct msghdr *msg, int len, in smc_rx_recv_urg() argument
284 struct smc_connection *conn = &smc->conn; in smc_rx_recv_urg()
286 struct sock *sk = &smc->sk; in smc_rx_recv_urg()
294 SMC_STAT_INC(smc, urg_data_cnt); in smc_rx_recv_urg()
297 smc->conn.urg_state = SMC_URG_READ; in smc_rx_recv_urg()
311 smc_rx_update_consumer(smc, cons, 0); in smc_rx_recv_urg()
325 static bool smc_rx_recvmsg_data_available(struct smc_sock *smc) in smc_rx_recvmsg_data_available() argument
327 struct smc_connection *conn = &smc->conn; in smc_rx_recvmsg_data_available()
333 smc_rx_update_cons(smc, 0); in smc_rx_recvmsg_data_available()
344 int smc_rx_recvmsg(struct smc_sock *smc, struct msghdr *msg, in smc_rx_recvmsg() argument
349 struct smc_connection *conn = &smc->conn; in smc_rx_recvmsg()
363 sk = &smc->sk; in smc_rx_recvmsg()
367 return smc_rx_recv_urg(smc, msg, len, flags); in smc_rx_recvmsg()
373 SMC_STAT_RMB_RX_FULL(smc, !conn->lnk); in smc_rx_recvmsg()
376 SMC_STAT_RMB_RX_SIZE_SMALL(smc, !conn->lnk); in smc_rx_recvmsg()
387 if (smc_rx_recvmsg_data_available(smc)) in smc_rx_recvmsg()
394 if (smc_rx_recvmsg_data_available(smc)) in smc_rx_recvmsg()
429 smc_rx_wait(smc, &timeo, smc_rx_data_available); in smc_rx_recvmsg()
443 smc_rx_wait(smc, &timeo, func); in smc_rx_recvmsg()
452 sock_flag(&smc->sk, SOCK_URGINLINE) && in smc_rx_recvmsg()
473 smc); in smc_rx_recvmsg()
499 if (msg && smc_rx_update_consumer(smc, cons, copylen)) in smc_rx_recvmsg()
503 trace_smc_rx_recvmsg(smc, copylen); in smc_rx_recvmsg()
510 void smc_rx_init(struct smc_sock *smc) in smc_rx_init() argument
512 smc->sk.sk_data_ready = smc_rx_wake_up; in smc_rx_init()
513 atomic_set(&smc->conn.splice_pending, 0); in smc_rx_init()
514 smc->conn.urg_state = SMC_URG_READ; in smc_rx_init()