]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 04:45:21 +0000 (23:45 -0500)
BugLink: https://bugs.launchpad.net/bugs/1859712
[ Upstream commit 647522a5ef6401dcdb8ec417421e43fb21910167 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index def2f6385ab6083611f2642d91137dc34fd25f26..edf16ca2f535d28afabbda7d22143956959983b4 100644 (file)
@@ -1605,6 +1605,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;
                }
        }