Skip to contentSkip to conversation

RDMA/mlx5: Use correct device num_ports when modify DC

PATCH Applied Mark Zhang 2 participants 2 messages Apr 20, 2023 – Apr 21, 2023

Subsystems (2)
lore
Share & tools
lore

Mark Zhang

author
#0 lore raw

PATCH 1/1 RDMA/mlx5: Use correct device num_ports when modify DC

Just like other QP types, when modify DC, the port_num should be compared with dev->num_ports, instead of HCA_CAP.num_ports. Otherwise Multi-port vHCA on DC may not work.

Fixes 776a3906b692 ("IB/mlx5: Add support for DC target QP")
---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/qp.c +1 -1
index 1093d3a0ed43..70ca8ffa9256 100644
@@ -4493,7 +4493,7 @@ static int mlx5_ib_modify_dct(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 			return -EINVAL;
 
 		if (attr->port_num == 0 ||
-		    attr->port_num > MLX5_CAP_GEN(dev->mdev, num_ports)) {
+		    attr->port_num > dev->num_ports) {
 			mlx5_ib_dbg(dev, "invalid port number %d. number of ports is %d\n",
 				    attr->port_num, dev->num_ports);
 			return -EINVAL;
Signature · 1 line
2.37.1
maintainer Applied
#1 lore raw
Quoted 10 lines · Mark Zhang

Just like other QP types, when modify DC, the port_num should be compared with dev->num_ports, instead of HCA_CAP.num_ports. Otherwise Multi-port vHCA on DC may not work.

Fixes 776a3906b692 ("IB/mlx5: Add support for DC target QP")
---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason