Skip to content

Commit 90b4978

Browse files
committed
Merge branch 'net-smc-fixes-2020-11-18'
Karsten Graul says: ==================== net/smc: fixes 2020-11-18 Patch 1 fixes the matching of link groups because with SMC-Dv2 the vlanid should no longer be part of this matching. Patch 2 removes a sparse message. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 2d8f648 + 41a0be3 commit 90b4978

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

net/smc/af_smc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,8 @@ static int __smc_connect(struct smc_sock *smc)
979979

980980
/* check if smc modes and versions of CLC proposal and accept match */
981981
rc = smc_connect_check_aclc(ini, aclc);
982-
version = aclc->hdr.version == SMC_V1 ? SMC_V1 : version;
982+
version = aclc->hdr.version == SMC_V1 ? SMC_V1 : SMC_V2;
983+
ini->smcd_version = version;
983984
if (rc)
984985
goto vlan_cleanup;
985986

net/smc/smc_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,8 @@ int smc_conn_create(struct smc_sock *smc, struct smc_init_info *ini)
13091309
ini->ism_peer_gid[ini->ism_selected]) :
13101310
smcr_lgr_match(lgr, ini->ib_lcl, role, ini->ib_clcqpn)) &&
13111311
!lgr->sync_err &&
1312-
lgr->vlan_id == ini->vlan_id &&
1312+
(ini->smcd_version == SMC_V2 ||
1313+
lgr->vlan_id == ini->vlan_id) &&
13131314
(role == SMC_CLNT || ini->is_smcd ||
13141315
lgr->conns_num < SMC_RMBS_PER_LGR_MAX)) {
13151316
/* link group found */

net/smc/smc_ib.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ int smc_ib_determine_gid(struct smc_ib_device *smcibdev, u8 ibport,
198198
rcu_read_lock();
199199
ndev = rdma_read_gid_attr_ndev_rcu(attr);
200200
if (!IS_ERR(ndev) &&
201-
((!vlan_id && !is_vlan_dev(attr->ndev)) ||
202-
(vlan_id && is_vlan_dev(attr->ndev) &&
203-
vlan_dev_vlan_id(attr->ndev) == vlan_id)) &&
201+
((!vlan_id && !is_vlan_dev(ndev)) ||
202+
(vlan_id && is_vlan_dev(ndev) &&
203+
vlan_dev_vlan_id(ndev) == vlan_id)) &&
204204
attr->gid_type == IB_GID_TYPE_ROCE) {
205205
rcu_read_unlock();
206206
if (gid)

0 commit comments

Comments
 (0)