net/mlx5: fix Tx recovery
PATCH 1/1 net/mlx5: fix Tx recovery
When an error occurs in Tx, and it is moved to ERROR state, it is not recoverable, during recovery it's state cannot be modified to INIT. to modify state from RESET to INIT, the port must be passed in modify attributes, and in case of ERROR to READY modification path, it was not provided.
Provide port number when changing state from RESET to INIT.
--- drivers/net/mlx5/linux/mlx5_verbs.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/mlx5/linux/mlx5_verbs.c +1 -4
@@ -94,7 +94,6 @@ mlx5_ibv_modify_qp(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type, .qp_state = IBV_QPS_RESET, .port_num = dev_port, }; -int attr_mask = (IBV_QP_STATE |IBV_QP_PORT );int ret;if (type !=MLX5_TXQ_MOD_RST2RDY ) {
@@ -108,10 +107,8 @@ mlx5_ibv_modify_qp(struct mlx5_txq_obj *obj, enum mlx5_txq_modify_type type,if (type ==MLX5_TXQ_MOD_RDY2RST )return 0 ; } -if (type ==MLX5_TXQ_MOD_ERR2RDY ) - attr_mask =IBV_QP_STATE ; mod.qp_state =IBV_QPS_INIT ; - ret = mlx5_glue->modify_qp (obj->qp, &mod, attr_mask); + ret = mlx5_glue->modify_qp (obj->qp, &mod,IBV_QP_STATE |IBV_QP_PORT );if (ret) {DRV_LOG (ERR ,"Cannot change Tx QP state to INIT %s" ,strerror (errno));
Signature · 1 line
2.21.0
Hi,
Quoted 13 lines
-----Original Message-----
From: Raja Zidane <[email protected]>
Sent: Wednesday, May 18, 2022 12:43 PM
To: [email protected]
Cc: Matan Azrad <[email protected]>; [email protected]; Dmitry Kozlyuk <[email protected]>
Subject: [PATCH] net/mlx5: fix Tx recoveryWhen an error occurs in Tx, and it is moved to ERROR state, it is not recoverable, during recovery it's state cannot be modified to INIT. to modify state from RESET to INIT, the port must be passed in modify attributes, and in case of ERROR to READY modification path, it was not provided.
Quoted 8 lines
Provide port number when changing state from RESET to INIT.
Fixes 3a87b964edd3 ("net/mlx5: create Tx queues with DevX")Signed-off-by Raja Zidane <[email protected]>Acked-by Matan Azrad <[email protected]>Acked-by Dmitry Kozlyuk <[email protected]>
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh