summaryrefslogtreecommitdiffstats
path: root/net/smc/af_smc.c
diff options
context:
space:
mode:
authorUrsula Braun <ubraun@linux.ibm.com>2020-09-10 18:48:24 +0200
committerDavid S. Miller <davem@davemloft.net>2020-09-11 00:24:26 +0200
commit7b2977d0830493452f1afaa8d8e1b4f8248df9d1 (patch)
tree5c0a1c2d49cd070db002b2ea378bb3026e1e7355 /net/smc/af_smc.c
parentnet/smc: common routine for CLC accept and confirm (diff)
downloadlinux-7b2977d0830493452f1afaa8d8e1b4f8248df9d1.tar.xz
linux-7b2977d0830493452f1afaa8d8e1b4f8248df9d1.zip
net/smc: improve server ISM device determination
Move check whether peer can be reached into smc_pnet_find_ism_by_pnetid(). Thus searching continues for another ism device, if check fails. Signed-off-by: Ursula Braun <ubraun@linux.ibm.com> Signed-off-by: Karsten Graul <kgraul@linux.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.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index fa97144690e0..f27a596b2624 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1188,26 +1188,12 @@ static int smc_listen_ism_init(struct smc_sock *new_smc,
struct smc_clc_msg_proposal *pclc,
struct smc_init_info *ini)
{
- struct smc_clc_msg_smcd *pclc_smcd;
int rc;
- pclc_smcd = smc_get_clc_msg_smcd(pclc);
- ini->ism_peer_gid = pclc_smcd->gid;
rc = smc_conn_create(new_smc, ini);
if (rc)
return rc;
- /* Check if peer can be reached via ISM device */
- if (smc_ism_cantalk(new_smc->conn.lgr->peer_gid,
- new_smc->conn.lgr->vlan_id,
- new_smc->conn.lgr->smcd)) {
- if (ini->first_contact_local)
- smc_lgr_cleanup_early(&new_smc->conn);
- else
- smc_conn_free(&new_smc->conn);
- return SMC_CLC_DECL_SMCDNOTALK;
- }
-
/* Create send and receive buffers */
rc = smc_buf_create(new_smc, true);
if (rc) {
@@ -1338,7 +1324,10 @@ static void smc_listen_work(struct work_struct *work)
/* check if ISM is available */
if (pclc->hdr.path == SMC_TYPE_D || pclc->hdr.path == SMC_TYPE_B) {
+ struct smc_clc_msg_smcd *pclc_smcd = smc_get_clc_msg_smcd(pclc);
+
ini.is_smcd = true; /* prepare ISM check */
+ ini.ism_peer_gid = pclc_smcd->gid;
rc = smc_find_ism_device(new_smc, &ini);
if (!rc)
rc = smc_listen_ism_init(new_smc, pclc, &ini);