From patchwork Thu Dec 14 14:11:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jijie Shao X-Patchwork-Id: 13493125 X-Patchwork-Delegate: kuba@kernel.org Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2BE9115; Thu, 14 Dec 2023 06:16:09 -0800 (PST) Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4SrZC73RXgzZdKL; Thu, 14 Dec 2023 22:16:03 +0800 (CST) Received: from kwepemm000007.china.huawei.com (unknown [7.193.23.189]) by mail.maildlp.com (Postfix) with ESMTPS id 09EB8140486; Thu, 14 Dec 2023 22:16:08 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemm000007.china.huawei.com (7.193.23.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Thu, 14 Dec 2023 22:16:07 +0800 From: Jijie Shao To: , , , , , CC: , , , , , , , Subject: [PATCH V2 net-next 3/3] net: hns3: support dump pfc frame statistics in tx timeout log Date: Thu, 14 Dec 2023 22:11:35 +0800 Message-ID: <20231214141135.613485-4-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231214141135.613485-1-shaojijie@huawei.com> References: <20231214141135.613485-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm000007.china.huawei.com (7.193.23.189) X-Patchwork-Delegate: kuba@kernel.org Continuous pfc frames may cause tx timeout. Therefore, pfc frame statistics are added to logs. Signed-off-by: Jijie Shao Reviewed-by: Simon Horman --- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 ++++-- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index ff475b0eac22..bf1e386617bc 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -209,6 +209,8 @@ struct hnae3_queue { struct hns3_mac_stats { u64 tx_pause_cnt; u64 rx_pause_cnt; + u64 tx_pfc_cnt; + u64 rx_pfc_cnt; }; /* hnae3 loop mode */ diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index b618797a7e8d..8e237f0f4fc9 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -2871,8 +2871,10 @@ static bool hns3_get_tx_timeo_queue_info(struct net_device *ndev) struct hns3_mac_stats mac_stats; h->ae_algo->ops->get_mac_stats(h, &mac_stats); - netdev_info(ndev, "tx_pause_cnt: %llu, rx_pause_cnt: %llu\n", - mac_stats.tx_pause_cnt, mac_stats.rx_pause_cnt); + netdev_info(ndev, + "tx_pause_cnt: %llu, rx_pause_cnt: %llu, tx_pfc_cnt: %llu, rx_pfc_cnt: %llu\n", + mac_stats.tx_pause_cnt, mac_stats.rx_pause_cnt, + mac_stats.tx_pfc_cnt, mac_stats.rx_pfc_cnt); } hns3_dump_queue_reg(ndev, tx_ring); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 8c2562ae3c69..999a8ca205a2 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -775,6 +775,8 @@ static void hclge_get_mac_stat(struct hnae3_handle *handle, mac_stats->tx_pause_cnt = hdev->mac_stats.mac_tx_mac_pause_num; mac_stats->rx_pause_cnt = hdev->mac_stats.mac_rx_mac_pause_num; + mac_stats->tx_pfc_cnt = hdev->mac_stats.mac_tx_pfc_pause_pkt_num; + mac_stats->rx_pfc_cnt = hdev->mac_stats.mac_rx_pfc_pause_pkt_num; } static int hclge_parse_func_status(struct hclge_dev *hdev,