Skip to contentSkip to conversation

RDMA/mlx5: Allow SQ modification

PATCH Applied Leon Romanovsky 2 participants 2 messages Jul 16, 2020 – Jul 24, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/mlx5: Allow SQ modification

From: Maor Gottlieb <[email protected]>

Currently SQ is set to ready state when the RAW QP is modified to init. When TIS is modified, e.g. to change the lag_tx_affinity, then SQs which are already in ready state will not be affected.

Open window to modify the SQ behavior by set the SQ as ready only when QP was modified to RTS.

---
 drivers/infiniband/hw/mlx5/qp.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
drivers/infiniband/hw/mlx5/qp.c +8 -10
index ef1587d01bfb..b3ed6fd9a4f0 100644
@@ -3552,7 +3552,7 @@ static int modify_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
 	switch (raw_qp_param->operation) {
 	case MLX5_CMD_OP_RST2INIT_QP:
 		rq_state = MLX5_RQC_STATE_RDY;
-		sq_state = MLX5_SQC_STATE_RDY;
+		sq_state = MLX5_SQC_STATE_RST;
 		break;
 	case MLX5_CMD_OP_2ERR_QP:
 		rq_state = MLX5_RQC_STATE_ERR;
@@ -3564,13 +3564,11 @@ static int modify_raw_packet_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp,
 		break;
 	case MLX5_CMD_OP_RTR2RTS_QP:
 	case MLX5_CMD_OP_RTS2RTS_QP:
-		if (raw_qp_param->set_mask ==
-		    MLX5_RAW_QP_RATE_LIMIT) {
-			modify_rq = 0;
-			sq_state = sq->state;
-		} else {
-			return raw_qp_param->set_mask ? -EINVAL : 0;
-		}
+		if (raw_qp_param->set_mask & ~MLX5_RAW_QP_RATE_LIMIT)
+			return -EINVAL;
+
+		modify_rq = 0;
+		sq_state = MLX5_SQC_STATE_RDY;
 		break;
 	case MLX5_CMD_OP_INIT2INIT_QP:
 	case MLX5_CMD_OP_INIT2RTR_QP:
@@ -4448,7 +4446,7 @@ static int sqrq_state_to_qp_state(u8 sq_state, u8 rq_state,
 			[MLX5_SQ_STATE_NA]	= IB_QPS_RESET,
 		},
 		[MLX5_RQC_STATE_RDY] = {
-			[MLX5_SQC_STATE_RST]	= MLX5_QP_STATE_BAD,
+			[MLX5_SQC_STATE_RST]	= MLX5_QP_STATE,
 			[MLX5_SQC_STATE_RDY]	= MLX5_QP_STATE,
 			[MLX5_SQC_STATE_ERR]	= IB_QPS_SQE,
 			[MLX5_SQ_STATE_NA]	= MLX5_QP_STATE,
@@ -4460,7 +4458,7 @@ static int sqrq_state_to_qp_state(u8 sq_state, u8 rq_state,
 			[MLX5_SQ_STATE_NA]	= IB_QPS_ERR,
 		},
 		[MLX5_RQ_STATE_NA] = {
-			[MLX5_SQC_STATE_RST]    = IB_QPS_RESET,
+			[MLX5_SQC_STATE_RST]    = MLX5_QP_STATE,
 			[MLX5_SQC_STATE_RDY]	= MLX5_QP_STATE,
 			[MLX5_SQC_STATE_ERR]	= MLX5_QP_STATE,
 			[MLX5_SQ_STATE_NA]	= MLX5_QP_STATE_BAD,
Signature · 1 line
2.26.2
maintainer Applied
#1 lore raw
Quoted 9 lines · Leon Romanovsky

From: Maor Gottlieb <[email protected]>

Currently SQ is set to ready state when the RAW QP is modified to init. When TIS is modified, e.g. to change the lag_tx_affinity, then SQs which are already in ready state will not be affected.

Open window to modify the SQ behavior by set the SQ as ready only when QP was modified to RTS.

Quoted 6 lines
---
 drivers/infiniband/hw/mlx5/qp.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

Applied to for-next, thanks

Jason