All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-next] RDMA/mlx5: Use correct device num_ports when modify DC
@ 2023-04-20  1:39 Mark Zhang
  2023-04-21 15:39 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Zhang @ 2023-04-20  1:39 UTC (permalink / raw)
  To: jgg, leonro; +Cc: linux-rdma, monis, yishaih, Mark Zhang, Maor Gottlieb

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")
Signed-off-by: Mark Zhang <markzhang@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
---
 drivers/infiniband/hw/mlx5/qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 1093d3a0ed43..70ca8ffa9256 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -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;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH rdma-next] RDMA/mlx5: Use correct device num_ports when modify DC
  2023-04-20  1:39 [PATCH rdma-next] RDMA/mlx5: Use correct device num_ports when modify DC Mark Zhang
@ 2023-04-21 15:39 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2023-04-21 15:39 UTC (permalink / raw)
  To: Mark Zhang; +Cc: leonro, linux-rdma, monis, yishaih, Maor Gottlieb

On Thu, Apr 20, 2023 at 04:39:06AM +0300, Mark Zhang wrote:
> 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")
> Signed-off-by: Mark Zhang <markzhang@nvidia.com>
> Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
> ---
>  drivers/infiniband/hw/mlx5/qp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-21 15:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-20  1:39 [PATCH rdma-next] RDMA/mlx5: Use correct device num_ports when modify DC Mark Zhang
2023-04-21 15:39 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.