Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1317202yba; Thu, 18 Apr 2019 20:09:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzehSNRluol1hljWQqmkIWFDa1JxAfilaYZIKsBzjljh290AqkPXbIlu8MCEsJQOd7LOb2n X-Received: by 2002:a62:a513:: with SMTP id v19mr1345204pfm.212.1555643360217; Thu, 18 Apr 2019 20:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555643360; cv=none; d=google.com; s=arc-20160816; b=tTM9vm8r03ElD/dkJyX5ytGQnzPF6dcY2m9OLf5jRrTsilgbc0t3xtX2COjP4Xx1Aq MMyFxXw8oFfyClMW7fR4SgT5uRvZ2TkboXRJOT8WQjvW0He+deyHdL3GmJGoaI5fFsxH 7AwFDfIeeEmUor7tSO1bNExspNVCX5wcLvxPIcVYAskQ64IL8y4CalC568ra9kkI2GyL ozi+RjYxmDbD/bH7TsUbr8kYhDeDtaEZEv22rU6L5YP6Q0h389sJSzW0tBphtYec9YZy bviHLGMaP/Famuo7uI7QI3pqnmghC5aenPL7bNQhCwkgBEORF9d4xQPpl1YjaOM5ziNe zPsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=y0xPq5x9gBu64LznynEDOLdyJIxLZqC+DjAypMi2EEI=; b=MElLAQiMlL8F7NzFRhrdTzrW1fbVEdnrdlc/WrtoYiuiqlPdb2EOo4jU3mMoYkAeHd nNCIbNDMfniByK2GpxpmxjMJ7UrFppk0wzHEkL8VTb44XBGI4vszSxTYyrB1bMZGhtUs EHidiLvoSCWVehm3XkJNb6F0OzYpQK8BPj+mi+opBhS2ZD25+FuWMvIQAquZjtUaoAaY khnR6kYloowpRorNXL4n0y0bVfjAiNJVLZrEdC++PeD9UHPUE74TCWNweJ3vuPiRXJ4U ors6Vs7pee69MTSdR//dibaAKTXirnPBrZe14IIMGWBsQBsWagSGJGH59/j3WRQe1fgN 70iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay8si3804450plb.202.2019.04.18.20.09.05; Thu, 18 Apr 2019 20:09:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727308AbfDSDHK (ORCPT + 99 others); Thu, 18 Apr 2019 23:07:10 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:55084 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727215AbfDSDHH (ORCPT ); Thu, 18 Apr 2019 23:07:07 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B51C543980F7887919E1; Fri, 19 Apr 2019 11:07:04 +0800 (CST) Received: from localhost.localdomain (10.67.212.132) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.408.0; Fri, 19 Apr 2019 11:06:58 +0800 From: Huazhong Tan To: CC: , , , , , , Jian Shen , Peng Li , Huazhong Tan Subject: [PATCH net-next 05/12] net: hns3: refine tx timeout count handle Date: Fri, 19 Apr 2019 11:05:40 +0800 Message-ID: <1555643147-52407-6-git-send-email-tanhuazhong@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555643147-52407-1-git-send-email-tanhuazhong@huawei.com> References: <1555643147-52407-1-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.132] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen 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 Signed-off-by: Peng Li Signed-off-by: Huazhong Tan --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 ++-- 1 file 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 9233438..193994c 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 */ -- 2.7.4