summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon
diff options
context:
space:
mode:
authorJian Shen <shenjian15@huawei.com>2019-04-19 11:05:40 +0800
committerDavid S. Miller <davem@davemloft.net>2019-04-19 18:43:15 -0700
commitbeab694aa32afb7c785c55f075628d9a21ed8011 (patch)
tree9c032109fbb9faff0a9dcdbf972f86071ef9afa0 /drivers/net/ethernet/hisilicon
parentfbf3cd3fc11ce80270a80e65a75e4e32a56a5a7d (diff)
downloadlinux-beab694aa32afb7c785c55f075628d9a21ed8011.tar.bz2
net: hns3: refine tx timeout count handle
In current codes, tx_timeout_cnt is used before increased, then we can see the tx_timeout_count is still 0 from the print when tx timeout happens, e.g. "hns3 0000:7d:00.3 eth3: tx_timeout count: 0, queue id: 0, SW_NTU: 0xa6, SW_NTC: 0xa4, HW_HEAD: 0xa4, HW_TAIL: 0xa6, INT: 0x1" The tx_timeout_cnt should be updated before used. Signed-off-by: Jian Shen <shenjian15@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_enet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 923343858f51..193994cf7899 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -1655,6 +1655,8 @@ static bool hns3_get_tx_timeo_queue_info(struct net_device *ndev)
return false;
}
+ priv->tx_timeout_count++;
+
tx_ring = priv->ring_data[timeout_queue].ring;
hw_head = readl_relaxed(tx_ring->tqp->io_base +
@@ -1682,8 +1684,6 @@ static void hns3_nic_net_timeout(struct net_device *ndev)
if (!hns3_get_tx_timeo_queue_info(ndev))
return;
- priv->tx_timeout_count++;
-
/* request the reset, and let the hclge to determine
* which reset level should be done
*/