Skip to content

Commit 746aa3c

Browse files
MarkZhang81jgunthorpe
authored andcommitted
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: 776a390 ("IB/mlx5: Add support for DC target QP") Link: https://lore.kernel.org/r/20230420013906.1244185-1-markzhang@nvidia.com Signed-off-by: Mark Zhang <markzhang@nvidia.com> Reviewed-by: Maor Gottlieb <maorg@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
1 parent 109205b commit 746aa3c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/infiniband/hw/mlx5

drivers/infiniband/hw/mlx5/qp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4493,7 +4493,7 @@ static int mlx5_ib_modify_dct(struct ib_qp *ibqp, struct ib_qp_attr *attr,
44934493
return -EINVAL;
44944494

44954495
if (attr->port_num == 0 ||
4496-
attr->port_num > MLX5_CAP_GEN(dev->mdev, num_ports)) {
4496+
attr->port_num > dev->num_ports) {
44974497
mlx5_ib_dbg(dev, "invalid port number %d. number of ports is %d\n",
44984498
attr->port_num, dev->num_ports);
44994499
return -EINVAL;

0 commit comments

Comments
 (0)