diff options
author | Ursula Braun <ubraun@linux.vnet.ibm.com> | 2017-01-09 16:55:20 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-09 16:07:39 -0500 |
commit | bd4ad57718cc86d2972a20f9791cd079996a4dd6 (patch) | |
tree | 8dd6f3960a397907d58b335f4b0d024a57258665 /net/smc/af_smc.c | |
parent | f38ba179c6ca94ebeb0ac6a0956c4ea533151ad8 (diff) | |
download | lwn-bd4ad57718cc86d2972a20f9791cd079996a4dd6.tar.gz lwn-bd4ad57718cc86d2972a20f9791cd079996a4dd6.zip |
smc: initialize IB transport incl. PD, MR, QP, CQ, event, WR
Prepare the link for RDMA transport:
Create a queue pair (QP) and move it into the state Ready-To-Receive (RTR).
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.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index a38f470130d3..1026fad35998 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -339,9 +339,20 @@ static int smc_connect_rdma(struct smc_sock *smc) if (local_contact == SMC_FIRST_CONTACT) smc_link_save_peer_info(link, &aclc); - /* tbd in follow-on patch: more steps to setup RDMA communcication, - * create rmbs, map rmbs, rtoken_handling, modify_qp - */ + + rc = smc_rmb_rtoken_handling(&smc->conn, &aclc); + if (rc) { + reason_code = SMC_CLC_DECL_INTERR; + goto decline_rdma_unlock; + } + + if (local_contact == SMC_FIRST_CONTACT) { + rc = smc_ib_ready_link(link); + if (rc) { + reason_code = SMC_CLC_DECL_INTERR; + goto decline_rdma_unlock; + } + } rc = smc_clc_send_confirm(smc); if (rc) @@ -638,9 +649,20 @@ static void smc_listen_work(struct work_struct *work) if (local_contact == SMC_FIRST_CONTACT) smc_link_save_peer_info(link, &cclc); - /* tbd in follow-on patch: more steps to setup RDMA communcication, - * rtoken_handling, modify_qp - */ + rc = smc_rmb_rtoken_handling(&new_smc->conn, &cclc); + if (rc) { + reason_code = SMC_CLC_DECL_INTERR; + goto decline_rdma; + } + + /* tbd in follow-on patch: modify_qp, llc_confirm */ + if (local_contact == SMC_FIRST_CONTACT) { + rc = smc_ib_ready_link(link); + if (rc) { + reason_code = SMC_CLC_DECL_INTERR; + goto decline_rdma; + } + } out_connected: sk_refcnt_debug_inc(newsmcsk); |