Skip to contentSkip to conversation

Enable querying AH for XRC QP types

PATCH Applied Leon Romanovsky 2 participants 4 messages Nov 15, 2020 – Nov 26, 2020

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

cover Enable querying AH for XRC QP types

From: Leon Romanovsky <[email protected]>

Update mlx4 and mlx5 drivers to support querying AH for XRC QP types.

Thanks

Avihai Horon (2):
RDMA/mlx5: Enable querying AH for XRC QP types
RDMA/mlx4: Enable querying AH for XRC QP types

 drivers/infiniband/hw/mlx4/qp.c | 4 +++-
 drivers/infiniband/hw/mlx5/qp.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

--
2.28.0

#1 lore raw

PATCH 1/2 RDMA/mlx5: Enable querying AH for XRC QP types

From: Avihai Horon <[email protected]>

Address handle is set for connected QP types such as RC and UC, and thus can also be queried.

Since XRC QP types INI and TGT are connected, it should be possible to query their address handle as well.

Until now it was not the case, and although the firmware supported it, the driver allowed querying the address handle only for RC and UC.

Hence, we enable it now for INI and TGT QPs as well.

---
 drivers/infiniband/hw/mlx5/qp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/qp.c +3 -1
index 8b1c4f509248..c053a790fc60 100644
@@ -4555,7 +4555,9 @@ static int query_qp_attr(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
 	pri_path = MLX5_ADDR_OF(qpc, qpc, primary_address_path);
 	alt_path = MLX5_ADDR_OF(qpc, qpc, secondary_address_path);
 
-	if (qp->ibqp.qp_type == IB_QPT_RC || qp->ibqp.qp_type == IB_QPT_UC) {
+	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) {
 		to_rdma_ah_attr(dev, &qp_attr->ah_attr, pri_path);
 		to_rdma_ah_attr(dev, &qp_attr->alt_ah_attr, alt_path);
 		qp_attr->alt_pkey_index = MLX5_GET(ads, alt_path, pkey_index);
Signature · 1 line
2.28.0
#2 lore raw

PATCH 2/2 RDMA/mlx4: Enable querying AH for XRC QP types

In reply to Leon Romanovsky

From: Avihai Horon <[email protected]>

Address handle is set for connected QP types such as RC and UC, and thus can also be queried.

Since XRC QP types INI and TGT are connected, it should be possible to query their address handle as well.

Until now it was not the case, and although the firmware supported it, the driver allowed querying the address handle only for RC and UC.

Hence, we enable it now for INI and TGT QPs as well.

---
 drivers/infiniband/hw/mlx4/qp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx4/qp.c +3 -1
index 44534a12819a..651785bd57f2 100644
@@ -4015,7 +4015,9 @@ int mlx4_ib_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr, int qp_attr
 	qp_attr->qp_access_flags     =
 		to_ib_qp_access_flags(be32_to_cpu(context.params2));
 
-	if (qp->ibqp.qp_type == IB_QPT_RC || qp->ibqp.qp_type == IB_QPT_UC) {
+	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) {
 		to_rdma_ah_attr(dev, &qp_attr->ah_attr, &context.pri_path);
 		to_rdma_ah_attr(dev, &qp_attr->alt_ah_attr, &context.alt_path);
 		qp_attr->alt_pkey_index = context.alt_path.pkey_index & 0x7f;
Signature · 1 line
2.28.0
maintainer Applied
#3 lore raw
In reply to Leon Romanovsky
Quoted 9 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Update mlx4 and mlx5 drivers to support querying AH for XRC QP types.

Thanks

Avihai Horon (2):
RDMA/mlx5: Enable querying AH for XRC QP types
RDMA/mlx4: Enable querying AH for XRC QP types

Applied to for-next, thanks

Jason