From: Chiqijun chiqijun@huawei.com
driver inclusion category: bugfix bugzilla: 4472
-----------------------------------------------------------------------
Print the PI/CI information of the tx queue in the tx timeout interface, which is used to debug whether it is a chip problem or a software problem.
Signed-off-by: Chiqijun chiqijun@huawei.com Reviewed-by: Zengweiliang zengweiliang.zengweiliang@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/huawei/hinic/hinic_main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c index 46a7800..55717e8 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c @@ -34,6 +34,7 @@ #include "ossl_knl.h" #include "hinic_hw_mgmt.h" #include "hinic_hw.h" +#include "hinic_dbg.h" #include "hinic_nic_cfg.h" #include "hinic_nic_dev.h" #include "hinic_tx.h" @@ -1298,9 +1299,22 @@ static struct net_device_stats *hinic_get_stats(struct net_device *netdev) static void hinic_tx_timeout(struct net_device *netdev) { struct hinic_nic_dev *nic_dev = netdev_priv(netdev); + u8 q_id;
HINIC_NIC_STATS_INC(nic_dev, netdev_tx_timeout); nicif_err(nic_dev, drv, netdev, "Tx timeout\n"); + + for (q_id = 0; q_id < nic_dev->num_qps; q_id++) { + if (!netif_xmit_stopped(netdev_get_tx_queue(netdev, q_id))) + continue; + + nicif_info(nic_dev, drv, netdev, + "txq%d: sw_pi: %d, hw_ci: %d, sw_ci: %d, napi->state: 0x%lx\n", + q_id, hinic_dbg_get_sq_pi(nic_dev->hwdev, q_id), + hinic_get_sq_hw_ci(nic_dev->hwdev, q_id), + hinic_get_sq_local_ci(nic_dev->hwdev, q_id), + nic_dev->irq_cfg[q_id].napi.state); + } }
static int hinic_change_mtu(struct net_device *netdev, int new_mtu)