]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: hns3: add struct netdev_queue debug info for TX timeout
authorYunsheng Lin <linyunsheng@huawei.com>
Thu, 31 Oct 2019 11:23:17 +0000 (19:23 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Oct 2019 19:03:23 +0000 (12:03 -0700)
When there is a TX timeout, we can tell if the driver or stack
has stopped the queue by looking at state field, and when has
the last packet transmited by looking at trans_start field.

So this patch prints these two field in the
hns3_get_tx_timeo_queue_info().

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index 0fdd684a852497eabcc40883d154ddf52c0448a0..23bdfe8583da62a0f9aab3c166fde64936a69b61 100644 (file)
@@ -1792,6 +1792,9 @@ static bool hns3_get_tx_timeo_queue_info(struct net_device *ndev)
                    time_after(jiffies,
                               (trans_start + ndev->watchdog_timeo))) {
                        timeout_queue = i;
+                       netdev_info(ndev, "queue state: 0x%lx, delta msecs: %u\n",
+                                   q->state,
+                                   jiffies_to_msecs(jiffies - trans_start));
                        break;
                }
        }