Skip to content

Commit 2c493ae

Browse files
Eran Ben ElishaSaeed Mahameed
authored andcommitted
net/mlx5e: Re-add support for TX timeout when TX reporter is not valid
When TX reporter was introduced, it took ownership over TX timeout error handling. this introduced a regression in case TX reporter is not valid (NET_DEVLINK is not set, or devlink_health_reporter_create failure). Fix mlx5e_tx_reporter_timeout function so it can be called at all times. In addition, remove a warning print that indicates that a TX timeout won't be handled in case of no valid TX reporter. Fixes: 7d91126 ("net/mlx5e: Add tx timeout support for mlx5e tx reporter") Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent 772ac5e commit 2c493ae

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ static int mlx5e_tx_reporter_err_cqe_recover(struct mlx5e_txqsq *sq)
113113
return 0;
114114
}
115115

116+
static int mlx5_tx_health_report(struct devlink_health_reporter *tx_reporter,
117+
char *err_str,
118+
struct mlx5e_tx_err_ctx *err_ctx)
119+
{
120+
if (IS_ERR_OR_NULL(tx_reporter)) {
121+
netdev_err(err_ctx->sq->channel->netdev, err_str);
122+
return err_ctx->recover(err_ctx->sq);
123+
}
124+
125+
return devlink_health_report(tx_reporter, err_str, err_ctx);
126+
}
127+
116128
void mlx5e_tx_reporter_err_cqe(struct mlx5e_txqsq *sq)
117129
{
118130
char err_str[MLX5E_TX_REPORTER_PER_SQ_MAX_LEN];
@@ -122,7 +134,7 @@ void mlx5e_tx_reporter_err_cqe(struct mlx5e_txqsq *sq)
122134
err_ctx.recover = mlx5e_tx_reporter_err_cqe_recover;
123135
sprintf(err_str, "ERR CQE on SQ: 0x%x", sq->sqn);
124136

125-
devlink_health_report(sq->channel->priv->tx_reporter, err_str,
137+
mlx5_tx_health_report(sq->channel->priv->tx_reporter, err_str,
126138
&err_ctx);
127139
}
128140

@@ -160,7 +172,7 @@ int mlx5e_tx_reporter_timeout(struct mlx5e_txqsq *sq)
160172
sq->channel->ix, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc,
161173
jiffies_to_usecs(jiffies - sq->txq->trans_start));
162174

163-
return devlink_health_report(sq->channel->priv->tx_reporter, err_str,
175+
return mlx5_tx_health_report(sq->channel->priv->tx_reporter, err_str,
164176
&err_ctx);
165177
}
166178

drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4173,12 +4173,6 @@ static void mlx5e_tx_timeout(struct net_device *dev)
41734173
struct mlx5e_priv *priv = netdev_priv(dev);
41744174

41754175
netdev_err(dev, "TX timeout detected\n");
4176-
4177-
if (IS_ERR_OR_NULL(priv->tx_reporter)) {
4178-
netdev_err_once(priv->netdev, "tx timeout will not be handled, no valid tx reporter\n");
4179-
return;
4180-
}
4181-
41824176
queue_work(priv->wq, &priv->tx_timeout_work);
41834177
}
41844178

drivers/net/ethernet/mellanox/mlx5/core/en_tx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,8 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
519519
&sq->state)) {
520520
mlx5e_dump_error_cqe(sq,
521521
(struct mlx5_err_cqe *)cqe);
522-
if (!IS_ERR_OR_NULL(cq->channel->priv->tx_reporter))
523-
queue_work(cq->channel->priv->wq,
524-
&sq->recover_work);
522+
queue_work(cq->channel->priv->wq,
523+
&sq->recover_work);
525524
}
526525
stats->cqe_err++;
527526
}

0 commit comments

Comments
 (0)