Lines Matching full:conn
49 * @conn connection to update
58 struct smc_connection *conn = &smc->conn; in smc_rx_update_consumer() local
63 smc_curs_add(conn->rmb_desc->len, &cons, len); in smc_rx_update_consumer()
66 if (conn->urg_state == SMC_URG_VALID || conn->urg_rx_skip_pend) { in smc_rx_update_consumer()
67 diff = smc_curs_comp(conn->rmb_desc->len, &cons, in smc_rx_update_consumer()
68 &conn->urg_curs); in smc_rx_update_consumer()
73 conn->urg_state = SMC_URG_READ; in smc_rx_update_consumer()
79 smc_curs_add(conn->rmb_desc->len, &cons, 1); in smc_rx_update_consumer()
80 conn->urg_rx_skip_pend = false; in smc_rx_update_consumer()
83 conn->urg_state = SMC_URG_READ; in smc_rx_update_consumer()
87 smc_curs_copy(&conn->local_tx_ctrl.cons, &cons, conn); in smc_rx_update_consumer()
91 smc_tx_consumer_update(conn, force); in smc_rx_update_consumer()
98 struct smc_connection *conn = &smc->conn; in smc_rx_update_cons() local
101 smc_curs_copy(&cons, &conn->local_tx_ctrl.cons, conn); in smc_rx_update_cons()
115 struct smc_connection *conn; in smc_rx_pipe_buf_release() local
122 conn = &smc->conn; in smc_rx_pipe_buf_release()
126 if (atomic_sub_and_test(priv->len, &conn->splice_pending)) in smc_rx_pipe_buf_release()
148 struct smc_link_group *lgr = smc->conn.lgr; in smc_rx_splice()
157 nr_pages = !lgr->is_smcd && smc->conn.rmb_desc->is_vm ? in smc_rx_splice()
176 (!lgr->is_smcd && !smc->conn.rmb_desc->is_vm)) { in smc_rx_splice()
180 partial[0].offset = src - (char *)smc->conn.rmb_desc->cpu_addr; in smc_rx_splice()
183 pages[0] = smc->conn.rmb_desc->pages; in smc_rx_splice()
211 if (!lgr->is_smcd && smc->conn.rmb_desc->is_vm) { in smc_rx_splice()
215 get_page(smc->conn.rmb_desc->pages); in smc_rx_splice()
217 atomic_add(bytes, &smc->conn.splice_pending); in smc_rx_splice()
237 static int smc_rx_data_available_and_no_splice_pend(struct smc_connection *conn) in smc_rx_data_available_and_no_splice_pend() argument
239 return atomic_read(&conn->bytes_to_rcv) && in smc_rx_data_available_and_no_splice_pend()
240 !atomic_read(&conn->splice_pending); in smc_rx_data_available_and_no_splice_pend()
252 int (*fcrit)(struct smc_connection *conn)) in smc_rx_wait() argument
255 struct smc_connection *conn = &smc->conn; in smc_rx_wait() local
257 &conn->local_tx_ctrl.conn_state_flags; in smc_rx_wait()
261 if (fcrit(conn)) in smc_rx_wait()
269 conn->killed || in smc_rx_wait()
270 fcrit(conn), in smc_rx_wait()
280 struct smc_connection *conn = &smc->conn; in smc_rx_recv_urg() local
286 !(conn->urg_state == SMC_URG_VALID) || in smc_rx_recv_urg()
287 conn->urg_state == SMC_URG_READ) in smc_rx_recv_urg()
291 if (conn->urg_state == SMC_URG_VALID) { in smc_rx_recv_urg()
293 smc->conn.urg_state = SMC_URG_READ; in smc_rx_recv_urg()
297 rc = memcpy_to_msg(msg, &conn->urg_rx_byte, 1); in smc_rx_recv_urg()
299 smc_curs_copy(&cons, &conn->local_tx_ctrl.cons, conn); in smc_rx_recv_urg()
300 if (smc_curs_diff(conn->rmb_desc->len, &cons, in smc_rx_recv_urg()
301 &conn->urg_curs) > 1) in smc_rx_recv_urg()
302 conn->urg_rx_skip_pend = true; in smc_rx_recv_urg()
323 struct smc_connection *conn = &smc->conn; in smc_rx_recvmsg_data_available() local
325 if (smc_rx_data_available(conn)) in smc_rx_recvmsg_data_available()
327 else if (conn->urg_state == SMC_URG_VALID) in smc_rx_recvmsg_data_available()
345 struct smc_connection *conn = &smc->conn; in smc_rx_recvmsg() local
346 int (*func)(struct smc_connection *conn); in smc_rx_recvmsg()
367 readable = atomic_read(&conn->bytes_to_rcv); in smc_rx_recvmsg()
368 if (readable >= conn->rmb_desc->len) in smc_rx_recvmsg()
369 SMC_STAT_RMB_RX_FULL(smc, !conn->lnk); in smc_rx_recvmsg()
372 SMC_STAT_RMB_RX_SIZE_SMALL(smc, !conn->lnk); in smc_rx_recvmsg()
374 rcvbuf_base = conn->rx_off + conn->rmb_desc->cpu_addr; in smc_rx_recvmsg()
380 if (conn->killed) in smc_rx_recvmsg()
424 if (!smc_rx_data_available(conn)) { in smc_rx_recvmsg()
432 readable = atomic_read(&conn->bytes_to_rcv); in smc_rx_recvmsg()
433 splbytes = atomic_read(&conn->splice_pending); in smc_rx_recvmsg()
443 smc_curs_copy(&cons, &conn->local_tx_ctrl.cons, conn); in smc_rx_recvmsg()
446 smc_curs_add(conn->rmb_desc->len, &cons, splbytes); in smc_rx_recvmsg()
447 if (conn->urg_state == SMC_URG_VALID && in smc_rx_recvmsg()
455 chunk_len = min_t(size_t, copylen, conn->rmb_desc->len - in smc_rx_recvmsg()
459 smc_rmb_sync_sg_for_cpu(conn); in smc_rx_recvmsg()
492 atomic_sub(copylen, &conn->bytes_to_rcv); in smc_rx_recvmsg()
509 atomic_set(&smc->conn.splice_pending, 0); in smc_rx_init()
510 smc->conn.urg_state = SMC_URG_READ; in smc_rx_init()