All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-rc] RDMA/mlx5: Fix missed RST2INIT and INIT2INIT steps during ECE handshake
@ 2020-06-16 10:45 Leon Romanovsky
  2020-06-18 13:01 ` Jason Gunthorpe
  0 siblings, 1 reply; 2+ messages in thread
From: Leon Romanovsky @ 2020-06-16 10:45 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Leon Romanovsky, linux-rdma, Mark Zhang, netdev, Saeed Mahameed

From: Leon Romanovsky <leonro@mellanox.com>

Missed step during ECE handshake left userspace application with less
options for the ECE handshake with a need to do workarounds.

Fixes: 50aec2c3135e ("RDMA/mlx5: Return ECE data after modify QP")
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/qpc.c |  8 ++++++++
 include/linux/mlx5/mlx5_ifc.h    | 10 ++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/infiniband/hw/mlx5/qpc.c b/drivers/infiniband/hw/mlx5/qpc.c
index c19d91d6dce8..7c3968ef9cd1 100644
--- a/drivers/infiniband/hw/mlx5/qpc.c
+++ b/drivers/infiniband/hw/mlx5/qpc.c
@@ -346,6 +346,9 @@ static int get_ece_from_mbox(void *out, u16 opcode)
 	int ece = 0;

 	switch (opcode) {
+	case MLX5_CMD_OP_INIT2INIT_QP:
+		ece = MLX5_GET(init2init_qp_out, out, ece);
+		break;
 	case MLX5_CMD_OP_INIT2RTR_QP:
 		ece = MLX5_GET(init2rtr_qp_out, out, ece);
 		break;
@@ -355,6 +358,9 @@ static int get_ece_from_mbox(void *out, u16 opcode)
 	case MLX5_CMD_OP_RTS2RTS_QP:
 		ece = MLX5_GET(rts2rts_qp_out, out, ece);
 		break;
+	case MLX5_CMD_OP_RST2INIT_QP:
+		ece = MLX5_GET(rst2init_qp_out, out, ece);
+		break;
 	default:
 		break;
 	}
@@ -406,6 +412,7 @@ static int modify_qp_mbox_alloc(struct mlx5_core_dev *dev, u16 opcode, int qpn,
 			return -ENOMEM;
 		MOD_QP_IN_SET_QPC(rst2init_qp, mbox->in, opcode, qpn,
 				  opt_param_mask, qpc, uid);
+		MLX5_SET(rst2init_qp_in, mbox->in, ece, ece);
 		break;
 	case MLX5_CMD_OP_INIT2RTR_QP:
 		if (MBOX_ALLOC(mbox, init2rtr_qp))
@@ -439,6 +446,7 @@ static int modify_qp_mbox_alloc(struct mlx5_core_dev *dev, u16 opcode, int qpn,
 			return -ENOMEM;
 		MOD_QP_IN_SET_QPC(init2init_qp, mbox->in, opcode, qpn,
 				  opt_param_mask, qpc, uid);
+		MLX5_SET(init2init_qp_in, mbox->in, ece, ece);
 		break;
 	default:
 		return -EINVAL;
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index 66aeaf113995..7a00110f2f01 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -4286,7 +4286,8 @@ struct mlx5_ifc_rst2init_qp_out_bits {

 	u8         syndrome[0x20];

-	u8         reserved_at_40[0x40];
+	u8         reserved_at_40[0x20];
+	u8         ece[0x20];
 };

 struct mlx5_ifc_rst2init_qp_in_bits {
@@ -4303,7 +4304,7 @@ struct mlx5_ifc_rst2init_qp_in_bits {

 	u8         opt_param_mask[0x20];

-	u8         reserved_at_a0[0x20];
+	u8         ece[0x20];

 	struct mlx5_ifc_qpc_bits qpc;

@@ -6622,7 +6623,8 @@ struct mlx5_ifc_init2init_qp_out_bits {

 	u8         syndrome[0x20];

-	u8         reserved_at_40[0x40];
+	u8         reserved_at_40[0x20];
+	u8         ece[0x20];
 };

 struct mlx5_ifc_init2init_qp_in_bits {
@@ -6639,7 +6641,7 @@ struct mlx5_ifc_init2init_qp_in_bits {

 	u8         opt_param_mask[0x20];

-	u8         reserved_at_a0[0x20];
+	u8         ece[0x20];

 	struct mlx5_ifc_qpc_bits qpc;

--
2.26.2


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

* Re: [PATCH rdma-rc] RDMA/mlx5: Fix missed RST2INIT and INIT2INIT steps during ECE handshake
  2020-06-16 10:45 [PATCH rdma-rc] RDMA/mlx5: Fix missed RST2INIT and INIT2INIT steps during ECE handshake Leon Romanovsky
@ 2020-06-18 13:01 ` Jason Gunthorpe
  0 siblings, 0 replies; 2+ messages in thread
From: Jason Gunthorpe @ 2020-06-18 13:01 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Doug Ledford, Leon Romanovsky, linux-rdma, Mark Zhang, netdev,
	Saeed Mahameed

On Tue, Jun 16, 2020 at 01:45:36PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
> 
> Missed step during ECE handshake left userspace application with less
> options for the ECE handshake with a need to do workarounds.
> 
> Fixes: 50aec2c3135e ("RDMA/mlx5: Return ECE data after modify QP")
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/hw/mlx5/qpc.c |  8 ++++++++
>  include/linux/mlx5/mlx5_ifc.h    | 10 ++++++----
>  2 files changed, 14 insertions(+), 4 deletions(-)

Applied to for-rc, thanks

Jason

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

end of thread, other threads:[~2020-06-18 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 10:45 [PATCH rdma-rc] RDMA/mlx5: Fix missed RST2INIT and INIT2INIT steps during ECE handshake Leon Romanovsky
2020-06-18 13:01 ` 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.