Commit d5596ded authored by Aya Levin's avatar Aya Levin Committed by Greg Kroah-Hartman

net/mlx5e: Fix return value from timeout recover function

[ Upstream commit 39825350 ]

Fix timeout recover function to return a meaningful return value.
When an interrupt was not sent by the FW, return IO error instead of
'true'.

Fixes: c7981bea ("net/mlx5e: Fix return status of TX reporter timeout recover")
Signed-off-by: default avatarAya Levin <ayal@mellanox.com>
Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2260ec46
...@@ -142,22 +142,20 @@ static int mlx5e_tx_reporter_timeout_recover(struct mlx5e_txqsq *sq) ...@@ -142,22 +142,20 @@ static int mlx5e_tx_reporter_timeout_recover(struct mlx5e_txqsq *sq)
{ {
struct mlx5_eq_comp *eq = sq->cq.mcq.eq; struct mlx5_eq_comp *eq = sq->cq.mcq.eq;
u32 eqe_count; u32 eqe_count;
int ret;
netdev_err(sq->channel->netdev, "EQ 0x%x: Cons = 0x%x, irqn = 0x%x\n", netdev_err(sq->channel->netdev, "EQ 0x%x: Cons = 0x%x, irqn = 0x%x\n",
eq->core.eqn, eq->core.cons_index, eq->core.irqn); eq->core.eqn, eq->core.cons_index, eq->core.irqn);
eqe_count = mlx5_eq_poll_irq_disabled(eq); eqe_count = mlx5_eq_poll_irq_disabled(eq);
ret = eqe_count ? false : true;
if (!eqe_count) { if (!eqe_count) {
clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state); clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
return ret; return -EIO;
} }
netdev_err(sq->channel->netdev, "Recover %d eqes on EQ 0x%x\n", netdev_err(sq->channel->netdev, "Recover %d eqes on EQ 0x%x\n",
eqe_count, eq->core.eqn); eqe_count, eq->core.eqn);
sq->channel->stats->eq_rearm++; sq->channel->stats->eq_rearm++;
return ret; return 0;
} }
int mlx5e_tx_reporter_timeout(struct mlx5e_txqsq *sq) int mlx5e_tx_reporter_timeout(struct mlx5e_txqsq *sq)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment