diff mbox series

[rdma-next] IB/mlx5: Add missing XRC options to QP optional params mask

Message ID 20190501053830.7186-1-leon@kernel.org (mailing list archive)
State Mainlined
Commit 8f4426aa19fcdb9326ac44154a117b1a3a5ae126
Delegated to: Jason Gunthorpe
Headers show
Series [rdma-next] IB/mlx5: Add missing XRC options to QP optional params mask | expand

Commit Message

Leon Romanovsky May 1, 2019, 5:38 a.m. UTC
From: Jack Morgenstein <jackm@dev.mellanox.co.il>

The QP transition optional parameters for the various transition
for XRC QPs are identical to those for RC QPs.

Many of the XRC QP transition optional parameter bits are
missing from the QP optional mask table.  These omissions caused
failures when doing XRC QP state transitions.

For example, when trying to change the response timer of an XRC
receive QP via the RTS2RTS transition, the new timer value was
ignored because MLX5_QP_OPTPAR_RNR_TIMEOUT bit was missing from
the optional params mask for XRC qps for the RTS2RTS transition.

Fix this by adding the missing XRC optional parameters for all QP
transitions to the opt_mask table.

Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Fixes: a4774e9095de ("IB/mlx5: Fix opt param mask according to firmware spec")
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/qp.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Jason Gunthorpe May 3, 2019, 10:49 p.m. UTC | #1
On Wed, May 01, 2019 at 08:38:30AM +0300, Leon Romanovsky wrote:
> From: Jack Morgenstein <jackm@dev.mellanox.co.il>
> 
> The QP transition optional parameters for the various transition
> for XRC QPs are identical to those for RC QPs.
> 
> Many of the XRC QP transition optional parameter bits are
> missing from the QP optional mask table.  These omissions caused
> failures when doing XRC QP state transitions.
> 
> For example, when trying to change the response timer of an XRC
> receive QP via the RTS2RTS transition, the new timer value was
> ignored because MLX5_QP_OPTPAR_RNR_TIMEOUT bit was missing from
> the optional params mask for XRC qps for the RTS2RTS transition.
> 
> Fix this by adding the missing XRC optional parameters for all QP
> transitions to the opt_mask table.
> 
> Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
> Fixes: a4774e9095de ("IB/mlx5: Fix opt param mask according to firmware spec")
> Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/hw/mlx5/qp.c | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)

Applied to for-next thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 29e3fcd66510..9dfb2680ddbc 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -3003,6 +3003,11 @@  static enum mlx5_qp_optpar opt_mask[MLX5_QP_NUM_STATE][MLX5_QP_NUM_STATE][MLX5_Q
 			[MLX5_QP_ST_UD] = MLX5_QP_OPTPAR_PKEY_INDEX	|
 					  MLX5_QP_OPTPAR_Q_KEY		|
 					  MLX5_QP_OPTPAR_PRI_PORT,
+			[MLX5_QP_ST_XRC] = MLX5_QP_OPTPAR_RRE		|
+					  MLX5_QP_OPTPAR_RAE		|
+					  MLX5_QP_OPTPAR_RWE		|
+					  MLX5_QP_OPTPAR_PKEY_INDEX	|
+					  MLX5_QP_OPTPAR_PRI_PORT,
 		},
 		[MLX5_QP_STATE_RTR] = {
 			[MLX5_QP_ST_RC] = MLX5_QP_OPTPAR_ALT_ADDR_PATH  |
@@ -3036,6 +3041,12 @@  static enum mlx5_qp_optpar opt_mask[MLX5_QP_NUM_STATE][MLX5_QP_NUM_STATE][MLX5_Q
 					  MLX5_QP_OPTPAR_RWE		|
 					  MLX5_QP_OPTPAR_PM_STATE,
 			[MLX5_QP_ST_UD] = MLX5_QP_OPTPAR_Q_KEY,
+			[MLX5_QP_ST_XRC] = MLX5_QP_OPTPAR_ALT_ADDR_PATH	|
+					  MLX5_QP_OPTPAR_RRE		|
+					  MLX5_QP_OPTPAR_RAE		|
+					  MLX5_QP_OPTPAR_RWE		|
+					  MLX5_QP_OPTPAR_PM_STATE	|
+					  MLX5_QP_OPTPAR_RNR_TIMEOUT,
 		},
 	},
 	[MLX5_QP_STATE_RTS] = {
@@ -3052,6 +3063,12 @@  static enum mlx5_qp_optpar opt_mask[MLX5_QP_NUM_STATE][MLX5_QP_NUM_STATE][MLX5_Q
 			[MLX5_QP_ST_UD] = MLX5_QP_OPTPAR_Q_KEY		|
 					  MLX5_QP_OPTPAR_SRQN		|
 					  MLX5_QP_OPTPAR_CQN_RCV,
+			[MLX5_QP_ST_XRC] = MLX5_QP_OPTPAR_RRE		|
+					  MLX5_QP_OPTPAR_RAE		|
+					  MLX5_QP_OPTPAR_RWE		|
+					  MLX5_QP_OPTPAR_RNR_TIMEOUT	|
+					  MLX5_QP_OPTPAR_PM_STATE	|
+					  MLX5_QP_OPTPAR_ALT_ADDR_PATH,
 		},
 	},
 	[MLX5_QP_STATE_SQER] = {
@@ -3063,6 +3080,10 @@  static enum mlx5_qp_optpar opt_mask[MLX5_QP_NUM_STATE][MLX5_QP_NUM_STATE][MLX5_Q
 					   MLX5_QP_OPTPAR_RWE		|
 					   MLX5_QP_OPTPAR_RAE		|
 					   MLX5_QP_OPTPAR_RRE,
+			[MLX5_QP_ST_XRC]  = MLX5_QP_OPTPAR_RNR_TIMEOUT	|
+					   MLX5_QP_OPTPAR_RWE		|
+					   MLX5_QP_OPTPAR_RAE		|
+					   MLX5_QP_OPTPAR_RRE,
 		},
 	},
 };