net/smc: fixes 2020-11-18
cover net/smc: fixes 2020-11-18
Please apply the following patch series for smc to netdev's net tree.
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.
Karsten Graul (2):
net/smc: fix matching of existing link groups net/smc: fix direct access to ib_gid_addr->ndev in
smc_ib_determine_gid()
net/smc/af_smc.c | 3 ++- net/smc/smc_core.c | 3 ++- net/smc/smc_ib.c | 6 +++--- 3 files changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
PATCH 1/2 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.
--- net/smc/af_smc.c | 3 ++- net/smc/smc_core.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
net/smc/af_smc.c +2 -1
@@ -979,7 +979,8 @@ static int __smc_connect(struct smc_sock *smc)/* check if smc modes and versions of CLC proposal and accept match */ rc =smc_connect_check_aclc (ini, aclc); - version = aclc->hdr.version ==SMC_V1 ?SMC_V1 : version; + version = aclc->hdr.version ==SMC_V1 ?SMC_V1 :SMC_V2 ; + ini->smcd_version = version;if (rc) goto vlan_cleanup;
net/smc/smc_core.c +2 -1
@@ -1309,7 +1309,8 @@ int smc_conn_create(struct smc_sock *smc, struct smc_init_info *ini) ini->ism_peer_gid[ini->ism_selected]) : smcr_lgr_match(lgr, ini->ib_lcl, role, ini->ib_clcqpn)) && !lgr->sync_err && - lgr->vlan_id == ini->vlan_id && + (ini->smcd_version == SMC_V2 || + lgr->vlan_id == ini->vlan_id) && (role == SMC_CLNT || ini->is_smcd || lgr->conns_num < SMC_RMBS_PER_LGR_MAX)) {/* link group found */
Signature · 1 line
2.17.1
PATCH 2/2 net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid()
In reply to Karsten GraulSparse complaints 3 times about:net/smc/smc_ib.c:203:52: warning: incorrect type in argument 1 (different address spaces)net/smc/smc_ib.c:203:52: expected struct net_device const *devnet/smc/smc_ib.c:203:52: got struct net_device [noderef] __rcu *const ndev
Fix that by using the existing and validated ndev variable instead of accessing attr->ndev directly.
--- net/smc/smc_ib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
net/smc/smc_ib.c +3 -3
@@ -198,9 +198,9 @@ int smc_ib_determine_gid(struct smc_ib_device *smcibdev, u8 ibport,rcu_read_lock (); ndev =rdma_read_gid_attr_ndev_rcu (attr);if (!IS_ERR (ndev) && - ((!vlan_id && !is_vlan_dev (attr->ndev)) || - (vlan_id &&is_vlan_dev (attr->ndev) && -vlan_dev_vlan_id (attr->ndev) == vlan_id)) && + ((!vlan_id && !is_vlan_dev (ndev)) || + (vlan_id &&is_vlan_dev (ndev) && +vlan_dev_vlan_id (ndev) == vlan_id)) && attr->gid_type ==IB_GID_TYPE_ROCE ) {rcu_read_unlock ();if (gid)
Signature · 1 line
2.17.1
This series was applied to netdev/net.git (refs/heads/master):
Hello:
This series was applied to netdev/net.git (refs/heads/master):
Quoted 11 lines · On Wed, 18 Nov 2020 22:40:36 +0100 you wrote:
Please apply the following patch series for smc to netdev's net tree.
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.
Karsten Graul (2):
net/smc: fix matching of existing link groups net/smc: fix direct access toib_gid_addr->ndevin
smc_ib_determine_gid()[...]
Here is the summary with links:
- [net,1/2] net/smc: fix matching of existing link groups
https://git.kernel.org/netdev/net/c/0530bd6e6a3d - [net,2/2] net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() https://git.kernel.org/netdev/net/c/41a0be3f8f6b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html