diff options
author | Karsten Graul <kgraul@linux.vnet.ibm.com> | 2018-03-01 13:51:32 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-03-01 13:21:31 -0500 |
commit | 52bedf37bafe1d3bc36d1513ad059d9fd28b3c3f (patch) | |
tree | c49df5fc6752db70b3cb7acfe963e3a9b9ea2249 /net/smc/af_smc.c | |
parent | 75d320d611d8569ebe4e42718de035fcc79f8069 (diff) |
net/smc: process add/delete link messages
Add initial support for the LLC messages ADD LINK and DELETE LINK.
Introduce a link state field. Extend the initial LLC handshake with
ADD LINK processing.
Signed-off-by: Karsten Graul <kgraul@linux.vnet.ibm.com>
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 | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index 0d491f505608..5267ed19b67d 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -313,6 +313,27 @@ static int smc_clnt_conf_first_link(struct smc_sock *smc) if (rc < 0) return SMC_CLC_DECL_TCL; + /* receive ADD LINK request from server over RoCE fabric */ + rest = wait_for_completion_interruptible_timeout(&link->llc_add, + SMC_LLC_WAIT_TIME); + if (rest <= 0) { + struct smc_clc_msg_decline dclc; + + rc = smc_clc_wait_msg(smc, &dclc, sizeof(dclc), + SMC_CLC_DECLINE); + return rc; + } + + /* send add link reject message, only one link supported for now */ + rc = smc_llc_send_add_link(link, + link->smcibdev->mac[link->ibport - 1], + &link->smcibdev->gid[link->ibport - 1], + SMC_LLC_RESP); + if (rc < 0) + return SMC_CLC_DECL_TCL; + + link->state = SMC_LNK_ACTIVE; + return 0; } @@ -714,6 +735,27 @@ static int smc_serv_conf_first_link(struct smc_sock *smc) if (link->llc_confirm_resp_rc) return SMC_CLC_DECL_RMBE_EC; + /* send ADD LINK request to client over the RoCE fabric */ + rc = smc_llc_send_add_link(link, + link->smcibdev->mac[link->ibport - 1], + &link->smcibdev->gid[link->ibport - 1], + SMC_LLC_REQ); + if (rc < 0) + return SMC_CLC_DECL_TCL; + + /* receive ADD LINK response from client over the RoCE fabric */ + rest = wait_for_completion_interruptible_timeout(&link->llc_add_resp, + SMC_LLC_WAIT_TIME); + if (rest <= 0) { + struct smc_clc_msg_decline dclc; + + rc = smc_clc_wait_msg(smc, &dclc, sizeof(dclc), + SMC_CLC_DECLINE); + return rc; + } + + link->state = SMC_LNK_ACTIVE; + return 0; } |