All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] net/smc: fixes 2020-11-18
@ 2020-11-18 21:40 Karsten Graul
  2020-11-18 21:40 ` [PATCH net 1/2] net/smc: fix matching of existing link groups Karsten Graul
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Karsten Graul @ 2020-11-18 21:40 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, hca, raspl

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(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] net/smc: fix matching of existing link groups
  2020-11-18 21:40 [PATCH net 0/2] net/smc: fixes 2020-11-18 Karsten Graul
@ 2020-11-18 21:40 ` Karsten Graul
  2020-11-18 21:40 ` [PATCH net 2/2] net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() Karsten Graul
  2020-11-19 19:10 ` [PATCH net 0/2] net/smc: fixes 2020-11-18 patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Karsten Graul @ 2020-11-18 21:40 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, hca, raspl

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: 5c21c4ccafe8 ("net/smc: determine accepted ISM devices")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
 net/smc/af_smc.c   | 3 ++-
 net/smc/smc_core.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
index e9f487c8c6d5..5dd4faaf7d6e 100644
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -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;
 
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index 2b19863f7171..af96f813c075 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -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 */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid()
  2020-11-18 21:40 [PATCH net 0/2] net/smc: fixes 2020-11-18 Karsten Graul
  2020-11-18 21:40 ` [PATCH net 1/2] net/smc: fix matching of existing link groups Karsten Graul
@ 2020-11-18 21:40 ` Karsten Graul
  2020-11-19 19:10 ` [PATCH net 0/2] net/smc: fixes 2020-11-18 patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Karsten Graul @ 2020-11-18 21:40 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-s390, hca, raspl

Sparse 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 *dev
net/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.

Fixes: 5102eca9039b ("net/smc: Use rdma_read_gid_l2_fields to L2 fields")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
---
 net/smc/smc_ib.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c
index 1c314dbdc7fa..fc766b537ac7 100644
--- a/net/smc/smc_ib.c
+++ b/net/smc/smc_ib.c
@@ -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)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 0/2] net/smc: fixes 2020-11-18
  2020-11-18 21:40 [PATCH net 0/2] net/smc: fixes 2020-11-18 Karsten Graul
  2020-11-18 21:40 ` [PATCH net 1/2] net/smc: fix matching of existing link groups Karsten Graul
  2020-11-18 21:40 ` [PATCH net 2/2] net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() Karsten Graul
@ 2020-11-19 19:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2020-11-19 19:10 UTC (permalink / raw)
  To: Karsten Graul; +Cc: davem, netdev, linux-s390, hca, raspl

Hello:

This series was applied to netdev/net.git (refs/heads/master):

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 to ib_gid_addr->ndev in
>     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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-19 19:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 21:40 [PATCH net 0/2] net/smc: fixes 2020-11-18 Karsten Graul
2020-11-18 21:40 ` [PATCH net 1/2] net/smc: fix matching of existing link groups Karsten Graul
2020-11-18 21:40 ` [PATCH net 2/2] net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid() Karsten Graul
2020-11-19 19:10 ` [PATCH net 0/2] net/smc: fixes 2020-11-18 patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.