From f1eb02f952448405e360d94649846668c32364e1 Mon Sep 17 00:00:00 2001 From: Ursula Braun Date: Sat, 26 Sep 2020 12:44:20 +0200 Subject: net/smc: CLC header fields renaming SMCD version 2 defines 2 more bits in the CLC header to specify version 2 types. This patch prepares better naming of the CLC header fields. No functional change. Signed-off-by: Ursula Braun Signed-off-by: Karsten Graul Signed-off-by: David S. Miller --- net/smc/af_smc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'net/smc/af_smc.c') diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c index ed8f97166be9..1a02d3665c46 100644 --- a/net/smc/af_smc.c +++ b/net/smc/af_smc.c @@ -618,7 +618,7 @@ static int smc_connect_rdma(struct smc_sock *smc, ini->is_smcd = false; ini->ib_lcl = &aclc->r0.lcl; ini->ib_clcqpn = ntoh24(aclc->r0.qpn); - ini->first_contact_peer = aclc->hdr.flag; + ini->first_contact_peer = aclc->hdr.typev2 & SMC_FIRST_CONTACT_MASK; mutex_lock(&smc_client_lgr_pending); reason_code = smc_conn_create(smc, ini); @@ -713,7 +713,7 @@ static int smc_connect_ism(struct smc_sock *smc, ini->is_smcd = true; ini->ism_peer_gid = aclc->d0.gid; - ini->first_contact_peer = aclc->hdr.flag; + ini->first_contact_peer = aclc->hdr.typev2 & SMC_FIRST_CONTACT_MASK; /* there is only one lgr role for SMC-D; use server lock */ mutex_lock(&smc_server_lgr_pending); @@ -804,9 +804,9 @@ static int __smc_connect(struct smc_sock *smc) } /* depending on previous steps, connect using rdma or ism */ - if (rdma_supported && aclc.hdr.path == SMC_TYPE_R) + if (rdma_supported && aclc.hdr.typev1 == SMC_TYPE_R) rc = smc_connect_rdma(smc, &aclc, &ini); - else if (ism_supported && aclc.hdr.path == SMC_TYPE_D) + else if (ism_supported && aclc.hdr.typev1 == SMC_TYPE_D) rc = smc_connect_ism(smc, &aclc, &ini); else rc = SMC_CLC_DECL_MODEUNSUPP; @@ -1316,7 +1316,7 @@ static void smc_listen_work(struct work_struct *work) smc_tx_init(new_smc); /* check if ISM is available */ - if (pclc->hdr.path == SMC_TYPE_D || pclc->hdr.path == SMC_TYPE_B) { + if (pclc->hdr.typev1 == SMC_TYPE_D || pclc->hdr.typev1 == SMC_TYPE_B) { struct smc_clc_msg_smcd *pclc_smcd = smc_get_clc_msg_smcd(pclc); ini.is_smcd = true; /* prepare ISM check */ @@ -1326,7 +1326,7 @@ static void smc_listen_work(struct work_struct *work) rc = smc_listen_ism_init(new_smc, pclc, &ini); if (!rc) ism_supported = true; - else if (pclc->hdr.path == SMC_TYPE_D) + else if (pclc->hdr.typev1 == SMC_TYPE_D) goto out_unlock; /* skip RDMA and decline */ } @@ -1339,7 +1339,7 @@ static void smc_listen_work(struct work_struct *work) rc = smc_find_rdma_device(new_smc, &ini); if (rc) { /* no RDMA device found */ - if (pclc->hdr.path == SMC_TYPE_B) + if (pclc->hdr.typev1 == SMC_TYPE_B) /* neither ISM nor RDMA device found */ rc = SMC_CLC_DECL_NOSMCDEV; goto out_unlock; -- cgit v1.2.3