Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3715804rdb; Sun, 10 Dec 2023 18:30:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEE45L0Ipt6op5Qjbjjb9W/Y9ez/7+y1w/bZJUUq0sQ4687aiKHN3puQFcGl/FkKAMpoJE9 X-Received: by 2002:a05:6870:7008:b0:1fb:75a:6d1f with SMTP id u8-20020a056870700800b001fb075a6d1fmr4915550oae.70.1702261843923; Sun, 10 Dec 2023 18:30:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702261843; cv=none; d=google.com; s=arc-20160816; b=C3jVT79dxuRBvWvMIDLGcIeQjdfR0IGDK2MGp9s4ssVPK1r4jPoZHDQ/Dh/FVpgFpk K9gIMgmrZZJVWU3UVudt8huDLj5C919onyjV8N5T03Vi0dUKvU8z6XAdPv/oiYgBoXvS QKWpzbZ9kC4vL90B/1/0Sg8Pyj8Vu3ybbmGOR5uG0epBW/IzS8AUwQfSNJQohPbel2U4 NTUd/Cm1pe49c4xycVHsdtN/Tgwhl8rNcVY5/N7rKNZ7RLQWiVd5TDeJClnni7KozpUv w9IAaY1HSNhXJttUA+DhBD3oteYs7s4HO7OeaB65RaBJg+mMK7LGnLbaiJE5eyK66C29 Dlgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OGdQpL5h0dxqRu3EYwbX1gXwn3YXKoDSGl1o9Gugrh8=; fh=28Gsh8p/Rrgoh0ZJgxMb30MiNZzzGa/AucmCEg5DMJI=; b=cfAe63xYXSyWzCPB/Wy2a0qEcObbvPBeQLdmwTM777PH/+GTTeOklzpAZKRl+tdECd YiyaB6aeubsf4b4NVeE+8g5kvXZAifeP++5mhS9G1n0kuiID1aF84eUZQ1UMkvPLsPTt 1gL3ttukGP1CTQrnF75f4uqODaKH84PN2o/LYnT1HavgRl1CFYLpsTHAWLgZ4wY6IaNe KLv3qutfwTTe6JeSnTNyCxoYzXAIGv1vN1yHKVdFcftuwh5uk+WOSZePZHBg8QTDfBXj IDcoN81uG1aaSG4+iTFTn9CmVnrcfO6PcCMDQg33z7hkuC0Q7mKS9yHH1/9+A7ymUThk vcdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id 38-20020a630c66000000b005c203ad0e2csi4092073pgm.827.2023.12.10.18.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 18:30:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5FA46807D8D8; Sun, 10 Dec 2023 18:30:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232355AbjLKCaZ (ORCPT + 99 others); Sun, 10 Dec 2023 21:30:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbjLKCaY (ORCPT ); Sun, 10 Dec 2023 21:30:24 -0500 X-Greylist: delayed 1065 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 10 Dec 2023 18:30:26 PST Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E178CE3; Sun, 10 Dec 2023 18:30:26 -0800 (PST) Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4SpQHk4jtSz1wnVm; Mon, 11 Dec 2023 10:12:34 +0800 (CST) Received: from kwepemm000007.china.huawei.com (unknown [7.193.23.189]) by mail.maildlp.com (Postfix) with ESMTPS id 2CE621400CA; Mon, 11 Dec 2023 10:12:39 +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; Mon, 11 Dec 2023 10:12:38 +0800 From: Jijie Shao To: , , , , , CC: , , , , , Subject: [PATCH net-next 4/6] net: hns3: support dump pfc frame statistics in tx timeout log Date: Mon, 11 Dec 2023 10:08:14 +0800 Message-ID: <20231211020816.69434-5-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231211020816.69434-1-shaojijie@huawei.com> References: <20231211020816.69434-1-shaojijie@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm000007.china.huawei.com (7.193.23.189) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 10 Dec 2023 18:30:41 -0800 (PST) Continuous pfc frames may cause tx timeout. Therefore, pfc frame statistics are added to logs. Signed-off-by: Jijie Shao --- 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 94b27332cc3f..78dec34a8375 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, -- 2.30.0