All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-rc 0/3] mlx5 and NLDEV fixes
@ 2017-10-30 12:23 Leon Romanovsky
       [not found] ` <20171030122315.21924-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Leon Romanovsky @ 2017-10-30 12:23 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky

Hi Doug,

There are three patches targeted for this -RC, while mlx5 patches can
easily go to -next, the nldev patch better to be forwarded to Linus in
this cycle.

Because, we are in -rc7 now, I would really appreciate to hear your
plans regarding nldev patch.

The patches are available in the git repository at:
  git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git tags/rdma-rc-2017-10-30

	Thanks
---------------------------------------

Leon Romanovsky (1):
  RDMA/nldev: Enforce device index check for port callback

Majd Dibbiny (2):
  IB/mlx5: Assign send CQ and recv CQ of UMR QP
  IB/mlx5: Fix RoCE Address Path fields

 drivers/infiniband/core/nldev.c   | 4 +++-
 drivers/infiniband/hw/mlx5/main.c | 2 ++
 drivers/infiniband/hw/mlx5/qp.c   | 8 ++++++--
 3 files changed, 11 insertions(+), 3 deletions(-)

--
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH rdma-rc 1/3] IB/mlx5: Assign send CQ and recv CQ of UMR QP
       [not found] ` <20171030122315.21924-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2017-10-30 12:23   ` Leon Romanovsky
  2017-10-30 12:23   ` [PATCH rdma-rc 2/3] IB/mlx5: Fix RoCE Address Path fields Leon Romanovsky
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2017-10-30 12:23 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky, Majd Dibbiny

From: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

The UMR's QP is created by calling mlx5_ib_create_qp directly, and
therefore the send CQ and the recv CQ on the ibqp weren't assigned.

Assign them right after calling the mlx5_ib_create_qp to assure
that any access to those pointers will work as expected and won't
crash the system as might happen as part of reset flow.

Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 552f7bd4ecc3..5aff1e33d984 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -3097,6 +3097,8 @@ static int create_umr_res(struct mlx5_ib_dev *dev)
 	qp->real_qp    = qp;
 	qp->uobject    = NULL;
 	qp->qp_type    = MLX5_IB_QPT_REG_UMR;
+	qp->send_cq    = init_attr->send_cq;
+	qp->recv_cq    = init_attr->recv_cq;
 
 	attr->qp_state = IB_QPS_INIT;
 	attr->port_num = 1;
-- 
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH rdma-rc 2/3] IB/mlx5: Fix RoCE Address Path fields
       [not found] ` <20171030122315.21924-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
  2017-10-30 12:23   ` [PATCH rdma-rc 1/3] IB/mlx5: Assign send CQ and recv CQ of UMR QP Leon Romanovsky
@ 2017-10-30 12:23   ` Leon Romanovsky
  2017-10-30 12:23     ` Leon Romanovsky
  2017-11-13 18:54   ` [PATCH rdma-rc 0/3] mlx5 and NLDEV fixes Doug Ledford
  3 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2017-10-30 12:23 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky, Majd Dibbiny

From: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

When working over a RoCE network, the UDP source port should be set only
for statically connected QPs (RC, UC and XRC).

Fixes: 2811ba51b049 ("IB/mlx5: Add RoCE fields to Address Vector")
Signed-off-by: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
 drivers/infiniband/hw/mlx5/qp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index acb79d3a4f1d..a63060b93a43 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -2283,8 +2283,12 @@ static int mlx5_set_path(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
 		if (err)
 			return err;
 		memcpy(path->rmac, ah->roce.dmac, sizeof(ah->roce.dmac));
-		path->udp_sport = mlx5_get_roce_udp_sport(dev, port,
-							  grh->sgid_index);
+		if (qp->ibqp.qp_type == IB_QPT_RC ||
+		    qp->ibqp.qp_type == IB_QPT_UC ||
+		    qp->ibqp.qp_type == IB_QPT_XRC_INI ||
+		    qp->ibqp.qp_type == IB_QPT_XRC_TGT)
+			path->udp_sport = mlx5_get_roce_udp_sport(dev, port,
+								  grh->sgid_index);
 		path->dci_cfi_prio_sl = (sl & 0x7) << 4;
 		if (gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP)
 			path->ecn_dscp = (grh->traffic_class >> 2) & 0x3f;
-- 
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH rdma-rc 3/3] RDMA/nldev: Enforce device index check for port callback
  2017-10-30 12:23 [PATCH rdma-rc 0/3] mlx5 and NLDEV fixes Leon Romanovsky
@ 2017-10-30 12:23     ` Leon Romanovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2017-10-30 12:23 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Leon Romanovsky,
	Leon Romanovsky, stable-u79uwXL29TY76Z2rM5mHXA

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

IB device index is nldev's handler and it should be always checked.

Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Fixes: c3f66f7b0052 ("RDMA/netlink: Implement nldev port doit callback")
Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/core/nldev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 3ba24c428c3b..2fae850a3eff 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -214,7 +214,9 @@ static int nldev_port_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,

 	err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
 			  nldev_policy, extack);
-	if (err || !tb[RDMA_NLDEV_ATTR_PORT_INDEX])
+	if (err ||
+	    !tb[RDMA_NLDEV_ATTR_DEV_INDEX] ||
+	    !tb[RDMA_NLDEV_ATTR_PORT_INDEX])
 		return -EINVAL;

 	index = nla_get_u32(tb[RDMA_NLDEV_ATTR_DEV_INDEX]);
--
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH rdma-rc 3/3] RDMA/nldev: Enforce device index check for port callback
@ 2017-10-30 12:23     ` Leon Romanovsky
  0 siblings, 0 replies; 6+ messages in thread
From: Leon Romanovsky @ 2017-10-30 12:23 UTC (permalink / raw)
  To: Doug Ledford; +Cc: linux-rdma, Leon Romanovsky, Leon Romanovsky, stable

From: Leon Romanovsky <leonro@mellanox.com>

IB device index is nldev's handler and it should be always checked.

Cc: stable@vger.kernel.org
Fixes: c3f66f7b0052 ("RDMA/netlink: Implement nldev port doit callback")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/core/nldev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/core/nldev.c b/drivers/infiniband/core/nldev.c
index 3ba24c428c3b..2fae850a3eff 100644
--- a/drivers/infiniband/core/nldev.c
+++ b/drivers/infiniband/core/nldev.c
@@ -214,7 +214,9 @@ static int nldev_port_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,

 	err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
 			  nldev_policy, extack);
-	if (err || !tb[RDMA_NLDEV_ATTR_PORT_INDEX])
+	if (err ||
+	    !tb[RDMA_NLDEV_ATTR_DEV_INDEX] ||
+	    !tb[RDMA_NLDEV_ATTR_PORT_INDEX])
 		return -EINVAL;

 	index = nla_get_u32(tb[RDMA_NLDEV_ATTR_DEV_INDEX]);
--
2.14.2

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

* Re: [PATCH rdma-rc 0/3] mlx5 and NLDEV fixes
       [not found] ` <20171030122315.21924-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
                     ` (2 preceding siblings ...)
  2017-10-30 12:23     ` Leon Romanovsky
@ 2017-11-13 18:54   ` Doug Ledford
  3 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2017-11-13 18:54 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]

On Mon, 2017-10-30 at 14:23 +0200, Leon Romanovsky wrote:
> Hi Doug,
> 
> There are three patches targeted for this -RC, while mlx5 patches can
> easily go to -next, the nldev patch better to be forwarded to Linus in
> this cycle.
> 
> Because, we are in -rc7 now, I would really appreciate to hear your
> plans regarding nldev patch.
> 
> The patches are available in the git repository at:
>   git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git tags/rdma-rc-2017-10-30
> 
> 	Thanks
> ---------------------------------------
> 
> Leon Romanovsky (1):
>   RDMA/nldev: Enforce device index check for port callback

This went into -rc7 direct from you to Linus, so I dropped it here.

> Majd Dibbiny (2):
>   IB/mlx5: Assign send CQ and recv CQ of UMR QP
>   IB/mlx5: Fix RoCE Address Path fields

But I went ahead and took these two.  Thanks.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2017-11-13 18:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-30 12:23 [PATCH rdma-rc 0/3] mlx5 and NLDEV fixes Leon Romanovsky
     [not found] ` <20171030122315.21924-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-10-30 12:23   ` [PATCH rdma-rc 1/3] IB/mlx5: Assign send CQ and recv CQ of UMR QP Leon Romanovsky
2017-10-30 12:23   ` [PATCH rdma-rc 2/3] IB/mlx5: Fix RoCE Address Path fields Leon Romanovsky
2017-10-30 12:23   ` [PATCH rdma-rc 3/3] RDMA/nldev: Enforce device index check for port callback Leon Romanovsky
2017-10-30 12:23     ` Leon Romanovsky
2017-11-13 18:54   ` [PATCH rdma-rc 0/3] mlx5 and NLDEV fixes Doug Ledford

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.