Skip to content

Commit 0530bd6

Browse files
karstengrkuba-moo
authored andcommitted
net/smc: fix matching of existing link groups
With the multi-subnet support of SMC-Dv2 the match for existing link groups should not include the vlanid of the network device. Set ini->smcd_version accordingly before the call to smc_conn_create() and use this value in smc_conn_create() to skip the vlanid check. Fixes: 5c21c4c ("net/smc: determine accepted ISM devices") Signed-off-by: Karsten Graul <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2d8f648 commit 0530bd6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
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 */

0 commit comments

Comments
 (0)