Skip to content

Commit 3a32b26

Browse files
Eran Ben ElishaSaeed Mahameed
authored andcommitted
net/mlx5e: Add Event Queue meta data info for TX timeout logs
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 <[email protected]> Reviewed-by: Tariq Toukan <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 8499094 commit 3a32b26

File tree

1 file changed

+12
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3768,6 +3768,9 @@ static void mlx5e_tx_timeout(struct net_device *dev)
37683768
for (i = 0; i < priv->channels.num * priv->channels.params.num_tc; i++) {
37693769
struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, i);
37703770
struct mlx5e_txqsq *sq = priv->txq2sq[i];
3771+
struct mlx5_core_dev *mdev = priv->mdev;
3772+
int irqn_not_used, eqn;
3773+
struct mlx5_eq *eq;
37713774

37723775
if (!netif_xmit_stopped(dev_queue))
37733776
continue;
@@ -3776,6 +3779,15 @@ static void mlx5e_tx_timeout(struct net_device *dev)
37763779
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",
37773780
i, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc,
37783781
jiffies_to_usecs(jiffies - dev_queue->trans_start));
3782+
3783+
if (mlx5_vector2eqn(mdev, sq->cq.mcq.vector, &eqn,
3784+
&irqn_not_used))
3785+
continue;
3786+
3787+
eq = mlx5_eqn2eq(mdev, eqn);
3788+
if (!IS_ERR(eq))
3789+
netdev_err(dev, "EQ 0x%x: Cons = 0x%x, irqn = 0x%x\n",
3790+
eqn, eq->cons_index, eq->irqn);
37793791
}
37803792

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

0 commit comments

Comments
 (0)