summaryrefslogtreecommitdiff
path: root/net/smc/af_smc.c
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.vnet.ibm.com>2017-01-09 16:55:23 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-09 16:07:40 -0500
commite6727f39004bd95725342b3b343a14c7d59df07f (patch)
tree376bebbead3f9f2cabaddd75cfd34c32fe16ffda /net/smc/af_smc.c
parent5f08318f617b05b6ee389d8bd174c7af921ebf19 (diff)
downloadlwn-e6727f39004bd95725342b3b343a14c7d59df07f.tar.gz
lwn-e6727f39004bd95725342b3b343a14c7d59df07f.zip
smc: send data (through RDMA)
copy data to kernel send buffer, and trigger RDMA write Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/smc/af_smc.c')
-rw-r--r--net/smc/af_smc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index 4b1611d46ef7..b62b69c6c718 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -37,6 +37,7 @@
#include "smc_core.h"
#include "smc_ib.h"
#include "smc_pnet.h"
+#include "smc_tx.h"
static DEFINE_MUTEX(smc_create_lgr_pending); /* serialize link group
* creation
@@ -410,6 +411,8 @@ static int smc_connect_rdma(struct smc_sock *smc)
}
mutex_unlock(&smc_create_lgr_pending);
+ smc_tx_init(smc);
+
out_connected:
smc_copy_sock_settings_to_clc(smc);
smc->sk.sk_state = SMC_ACTIVE;
@@ -751,6 +754,8 @@ static void smc_listen_work(struct work_struct *work)
goto decline_rdma;
}
+ smc_tx_init(new_smc);
+
out_connected:
sk_refcnt_debug_inc(newsmcsk);
newsmcsk->sk_state = SMC_ACTIVE;
@@ -924,7 +929,7 @@ static int smc_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
if (smc->use_fallback)
rc = smc->clcsock->ops->sendmsg(smc->clcsock, msg, len);
else
- rc = sock_no_sendmsg(sock, msg, len);
+ rc = smc_tx_sendmsg(smc, msg, len);
out:
release_sock(sk);
return rc;
@@ -1005,6 +1010,12 @@ static unsigned int smc_poll(struct file *file, struct socket *sock,
mask |= smc_accept_poll(sk);
if (sk->sk_err)
mask |= POLLERR;
+ if (atomic_read(&smc->conn.sndbuf_space)) {
+ mask |= POLLOUT | POLLWRNORM;
+ } else {
+ sk_set_bit(SOCKWQ_ASYNC_NOSPACE, sk);
+ set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
+ }
/* for now - to be enhanced in follow-on patch */
}