net/mlx5e: Print delta since last transmit per SQ upon TX timeout
authorEran Ben Elisha <eranbe@mellanox.com>
Wed, 20 Dec 2017 09:31:28 +0000 (11:31 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 19 Jan 2018 20:41:33 +0000 (22:41 +0200)
When driver callback for TX timeout is being called, it handles all
stopped xmit queues (not only the ones which their timeout expired).
Add usecs since last transmit to TX timeout logs per send queue in order
to monitor if the queue timeout expired.

Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 8e380a8..12196d4 100644 (file)
@@ -3766,14 +3766,16 @@ static void mlx5e_tx_timeout(struct net_device *dev)
        netdev_err(dev, "TX timeout detected\n");
 
        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];
 
-               if (!netif_xmit_stopped(netdev_get_tx_queue(dev, i)))
+               if (!netif_xmit_stopped(dev_queue))
                        continue;
                sched_work = true;
                clear_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
-               netdev_err(dev, "TX timeout on queue: %d, SQ: 0x%x, CQ: 0x%x, SQ Cons: 0x%x SQ Prod: 0x%x\n",
-                          i, sq->sqn, sq->cq.mcq.cqn, sq->cc, sq->pc);
+               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 (sched_work && test_bit(MLX5E_STATE_OPENED, &priv->state))