linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mlx5-next 0/2] Add DC RoCE LAG support
@ 2020-08-18 11:52 Leon Romanovsky
  2020-08-18 11:52 ` [PATCH mlx5-next 1/2] IB/mlx5: Add tx_affinity support for DCI QP Leon Romanovsky
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Leon Romanovsky @ 2020-08-18 11:52 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, Leon Romanovsky, linux-rdma, Maor Gottlieb,
	Mark Zhang, netdev, Saeed Mahameed

From: Leon Romanovsky <leonro@nvidia.com>

Hi,

Two extremely short patches to enable DC RoCE LAG support.

Thanks

Mark Zhang (2):
  IB/mlx5: Add tx_affinity support for DCI QP
  IB/mlx5: Add DCT RoCE LAG support

 drivers/infiniband/hw/mlx5/qp.c | 23 ++++++++++++++---------
 include/linux/mlx5/mlx5_ifc.h   |  3 ++-
 2 files changed, 16 insertions(+), 10 deletions(-)

--
2.26.2


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

* [PATCH mlx5-next 1/2] IB/mlx5: Add tx_affinity support for DCI QP
  2020-08-18 11:52 [PATCH mlx5-next 0/2] Add DC RoCE LAG support Leon Romanovsky
@ 2020-08-18 11:52 ` Leon Romanovsky
  2020-08-18 11:52 ` [PATCH mlx5-next 2/2] IB/mlx5: Add DCT RoCE LAG support Leon Romanovsky
  2020-08-27 11:37 ` [PATCH mlx5-next 0/2] Add DC " Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2020-08-18 11:52 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Mark Zhang, Leon Romanovsky, linux-rdma, Maor Gottlieb, netdev,
	Saeed Mahameed

From: Mark Zhang <markz@mellanox.com>

DCI QP supports tx_affinity as well.

Signed-off-by: Mark Zhang <markz@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/qp.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index da9f15e0a644..0526d574cd9b 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -3667,14 +3667,12 @@ static unsigned int get_tx_affinity_rr(struct mlx5_ib_dev *dev,
 		MLX5_MAX_PORTS + 1;
 }

-static bool qp_supports_affinity(struct ib_qp *qp)
+static bool qp_supports_affinity(struct mlx5_ib_qp *qp)
 {
-	if ((qp->qp_type == IB_QPT_RC) ||
-	    (qp->qp_type == IB_QPT_UD) ||
-	    (qp->qp_type == IB_QPT_UC) ||
-	    (qp->qp_type == IB_QPT_RAW_PACKET) ||
-	    (qp->qp_type == IB_QPT_XRC_INI) ||
-	    (qp->qp_type == IB_QPT_XRC_TGT))
+	if ((qp->type == IB_QPT_RC) || (qp->type == IB_QPT_UD) ||
+	    (qp->type == IB_QPT_UC) || (qp->type == IB_QPT_RAW_PACKET) ||
+	    (qp->type == IB_QPT_XRC_INI) || (qp->type == IB_QPT_XRC_TGT) ||
+	    (qp->type == MLX5_IB_QPT_DCI))
 		return true;
 	return false;
 }
@@ -3692,7 +3690,7 @@ static unsigned int get_tx_affinity(struct ib_qp *qp,
 	unsigned int tx_affinity;

 	if (!(mlx5_ib_lag_should_assign_affinity(dev) &&
-	      qp_supports_affinity(qp)))
+	      qp_supports_affinity(mqp)))
 		return 0;

 	if (mqp->flags & MLX5_IB_QP_CREATE_SQPN_QP1)
--
2.26.2


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

* [PATCH mlx5-next 2/2] IB/mlx5: Add DCT RoCE LAG support
  2020-08-18 11:52 [PATCH mlx5-next 0/2] Add DC RoCE LAG support Leon Romanovsky
  2020-08-18 11:52 ` [PATCH mlx5-next 1/2] IB/mlx5: Add tx_affinity support for DCI QP Leon Romanovsky
@ 2020-08-18 11:52 ` Leon Romanovsky
  2020-08-27 11:37 ` [PATCH mlx5-next 0/2] Add DC " Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2020-08-18 11:52 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Mark Zhang, Leon Romanovsky, linux-rdma, Maor Gottlieb, netdev,
	Saeed Mahameed

From: Mark Zhang <markz@mellanox.com>

When DCT QPs work in RoCE LAG mode:
1. DCT creation is allowed only when it is supported.
2. The "port" of a DCT QP is assigned in a round-robin way.

Signed-off-by: Mark Zhang <markz@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/qp.c | 9 ++++++++-
 include/linux/mlx5/mlx5_ifc.h   | 3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 0526d574cd9b..4eff325c4d2c 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -2409,6 +2409,9 @@ static int create_dct(struct mlx5_ib_dev *dev, struct ib_pd *pd,
 	u32 uidx = params->uidx;
 	void *dctc;

+	if (mlx5_lag_is_active(dev->mdev) && !MLX5_CAP_GEN(dev->mdev, lag_dct))
+		return -EOPNOTSUPP;
+
 	qp->dct.in = kzalloc(MLX5_ST_SZ_BYTES(create_dct_in), GFP_KERNEL);
 	if (!qp->dct.in)
 		return -ENOMEM;
@@ -4183,7 +4186,11 @@ static int mlx5_ib_modify_dct(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 			MLX5_SET(dctc, dctc, rae, 1);
 		}
 		MLX5_SET(dctc, dctc, pkey_index, attr->pkey_index);
-		MLX5_SET(dctc, dctc, port, attr->port_num);
+		if (mlx5_lag_is_active(dev->mdev))
+			MLX5_SET(dctc, dctc, port,
+				 get_tx_affinity_rr(dev, udata));
+		else
+			MLX5_SET(dctc, dctc, port, attr->port_num);

 		set_id = mlx5_ib_get_counters_id(dev, attr->port_num - 1);
 		MLX5_SET(dctc, dctc, counter_set_id, set_id);
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index de1ffb4804d6..aee25e4fb2cc 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -1430,7 +1430,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {

 	u8         log_bf_reg_size[0x5];

-	u8         reserved_at_270[0x8];
+	u8         reserved_at_270[0x6];
+	u8         lag_dct[0x2];
 	u8         lag_tx_port_affinity[0x1];
 	u8         reserved_at_279[0x2];
 	u8         lag_master[0x1];
--
2.26.2


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

* Re: [PATCH mlx5-next 0/2] Add DC RoCE LAG support
  2020-08-18 11:52 [PATCH mlx5-next 0/2] Add DC RoCE LAG support Leon Romanovsky
  2020-08-18 11:52 ` [PATCH mlx5-next 1/2] IB/mlx5: Add tx_affinity support for DCI QP Leon Romanovsky
  2020-08-18 11:52 ` [PATCH mlx5-next 2/2] IB/mlx5: Add DCT RoCE LAG support Leon Romanovsky
@ 2020-08-27 11:37 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2020-08-27 11:37 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Leon Romanovsky, Leon Romanovsky, linux-rdma,
	Maor Gottlieb, Mark Zhang, netdev, Saeed Mahameed

On Tue, Aug 18, 2020 at 02:52:43PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
> 
> Hi,
> 
> Two extremely short patches to enable DC RoCE LAG support.
> 
> Thanks
> 
> Mark Zhang (2):
>   IB/mlx5: Add tx_affinity support for DCI QP
>   IB/mlx5: Add DCT RoCE LAG support

Applied to for-next, thanks

Jason

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

end of thread, other threads:[~2020-08-27 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 11:52 [PATCH mlx5-next 0/2] Add DC RoCE LAG support Leon Romanovsky
2020-08-18 11:52 ` [PATCH mlx5-next 1/2] IB/mlx5: Add tx_affinity support for DCI QP Leon Romanovsky
2020-08-18 11:52 ` [PATCH mlx5-next 2/2] IB/mlx5: Add DCT RoCE LAG support Leon Romanovsky
2020-08-27 11:37 ` [PATCH mlx5-next 0/2] Add DC " Jason Gunthorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).