]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RDMA/mlx5: Use correct device num_ports when modify DC
authorMark Zhang <markzhang@nvidia.com>
Thu, 20 Apr 2023 01:39:06 +0000 (04:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:11:29 +0000 (23:11 +0900)
commitab6aa42976e56800586bc5c2c02d162e57cb779d
tree4b372a4ffdccc426c2c79d74e4186c944108791c
parent2591c459851a6ca9bc20f05cbc6cc5dc0fc552b6
RDMA/mlx5: Use correct device num_ports when modify DC

[ Upstream commit 746aa3c8cb1a650ff2583497ac646e505831b9b9 ]

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")
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx5/qp.c