Skip to content

Commit

Permalink
net/mlx5e: Add Event Queue meta data info for TX timeout logs
Browse files Browse the repository at this point in the history
When TX timeout occurs, EQ consumer index and irqn can help in debug for
understanding the SW state of EQ. Add them to the logger prints for the
relevant EQ only.

Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Eran Ben Elisha authored and Saeed Mahameed committed Jan 19, 2018
1 parent 8499094 commit 3a32b26
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3768,6 +3768,9 @@ static void mlx5e_tx_timeout(struct net_device *dev)
for (i = 0; i < priv->channels.num * priv->channels.params.num_tc; i++) {
struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, i);
struct mlx5e_txqsq *sq = priv->txq2sq[i];
struct mlx5_core_dev *mdev = priv->mdev;
int irqn_not_used, eqn;
struct mlx5_eq *eq;

if (!netif_xmit_stopped(dev_queue))
continue;
Expand All @@ -3776,6 +3779,15 @@ static void mlx5e_tx_timeout(struct net_device *dev)
netdev_err(dev, "TX timeout on queue: %d, SQ: 0x%x, CQ: 0x%x, SQ Cons: 0x%x SQ Prod: 0x%x, usecs since last trans: %u\n",
i, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc,
jiffies_to_usecs(jiffies - dev_queue->trans_start));

if (mlx5_vector2eqn(mdev, sq->cq.mcq.vector, &eqn,
&irqn_not_used))
continue;

eq = mlx5_eqn2eq(mdev, eqn);
if (!IS_ERR(eq))
netdev_err(dev, "EQ 0x%x: Cons = 0x%x, irqn = 0x%x\n",
eqn, eq->cons_index, eq->irqn);
}

if (sched_work && test_bit(MLX5E_STATE_OPENED, &priv->state))
Expand Down

0 comments on commit 3a32b26

Please sign in to comment.