Skip to contentSkip to conversation

mlx5 and NLDEV fixes

PATCH In review Leon Romanovsky 2 participants 5 messages Oct 30, 2017 – Nov 13, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover mlx5 and NLDEV fixes

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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

PATCH 1/3 IB/mlx5: Assign send CQ and recv CQ of UMR QP

In reply to a message not in the archive

From: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/[email protected]>

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")
---
 drivers/infiniband/hw/mlx5/main.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/infiniband/hw/mlx5/main.c +2 -0
index 552f7bd4ecc3..5aff1e33d984 100644
@@ -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;
Signature · 6 lines
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH 2/3 IB/mlx5: Fix RoCE Address Path fields

In reply to a message not in the archive

From: Majd Dibbiny <majd-VPRAkNaXOzVWk0Htik3J/[email protected]>

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")
---
 drivers/infiniband/hw/mlx5/qp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/infiniband/hw/mlx5/qp.c +6 -2
index acb79d3a4f1d..a63060b93a43 100644
@@ -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;
Signature · 6 lines
2.14.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

PATCH 3/3 RDMA/nldev: Enforce device index check for port callback

In reply to a message not in the archive

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/[email protected]>

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

Fixes c3f66f7b0052 ("RDMA/netlink: Implement nldev port doit callback")
---
 drivers/infiniband/core/nldev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/core/nldev.c +3 -1
index 3ba24c428c3b..2fae850a3eff 100644
@@ -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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · 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.

Quoted 8 lines

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.

Quoted 3 lines

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.

Signature · 3 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD