Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8039933rdb; Thu, 4 Jan 2024 17:06:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IHopgd/P0L3Dk+Ty63g0y3x5d6EDT2cHdvEA7q1hrfEAJzBGhCCe/D8aHrL6+0Gs0AVUpiT X-Received: by 2002:a05:6808:1a94:b0:3b9:d927:ddb7 with SMTP id bm20-20020a0568081a9400b003b9d927ddb7mr1030827oib.114.1704416799586; Thu, 04 Jan 2024 17:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704416799; cv=none; d=google.com; s=arc-20160816; b=PPL4DOe4+ON9SA4UgD4cRipdGzA8zSTnrfY7o88Dv1s+TLXsJABVc+hXltyXwIgIar 3SvtwhbHnHLQrOeru1xsZdhbfKxaeVc4Q0Vg/icAf7Piwpskff7WXc2Dbmjwne9l1xOf ZwXkKdfQTqYMqJ3u5sSIfu0eD9bulUKGklbfrcolXL9lGux2HO2wLoc3WBEw1c8q/K2z pJFUdbM/PGQpfCZCjnwWopuRHSzi3PrUQNrS3lV7eH81lxREwQHUQsjuU//WdLvW9TI1 XgqlHUBHUFrU44ER5nWPtItO3tEFI8yCzE4SW1Sk+Bzx+ylvx/ah1kc8icHqJQAml0yc 2PZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=6vkLnofLDF4EcMcQ6KtZnLZsAL1S6sQ1bGxkQQlf07E=; fh=M7leXPUciCCqCImYxRhU7DkYe8+qSiCoaoNbbn6XPTg=; b=FfZAt7nd7B706J8d0eI50OlPvdPGDMV6NweiRsdvaL6pImlgAq2CHKqQRhAgMEUbfj wGnaDxLOhYCN6fayYB3gFEG/FU+3JxlnoP8yi4ylT3Ep66bZ9qDkDLIZ/oJJVODOh0zA e0p1Ql7/Znn2CzZtolYyEZ42WXinAc+536Hi5nfVqJL/6Z7aUItbRIQ14eNmlr4ABpno N74vptP9ndSh4PcsymR1R3MyyLi+V9W9HHNXxhi584uccUiC4mRyt3MHkUBuzfnJcrP2 jFkywhqnDNQDNL6PVIAYdZ2zkB1tKH/e1ZO+kAGkmXJnnHQ1XRRrc1QG67KJMAZCEqP7 2WTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d26-20020a0caa1a000000b0067f099cb65bsi683825qvb.351.2024.01.04.17.06.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 17:06:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-17370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 54FCE1C21AF5 for ; Fri, 5 Jan 2024 01:06:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49CA34410; Fri, 5 Jan 2024 01:06:02 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6B6F1FB5; Fri, 5 Jan 2024 01:05:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.163]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4T5lXh2P0Gz1FHZB; Fri, 5 Jan 2024 09:01:56 +0800 (CST) Received: from kwepemm600007.china.huawei.com (unknown [7.193.23.208]) by mail.maildlp.com (Postfix) with ESMTPS id E1B69180021; Fri, 5 Jan 2024 09:05:56 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 5 Jan 2024 09:05:56 +0800 From: Jijie Shao To: , , , , , , CC: , , , , , , , Subject: [PATCH V4 net-next 4/4] net: hns3: support dump pfc frame statistics in tx timeout log Date: Fri, 5 Jan 2024 09:01:19 +0800 Message-ID: <20240105010119.2619873-5-shaojijie@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20240105010119.2619873-1-shaojijie@huawei.com> References: <20240105010119.2619873-1-shaojijie@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600007.china.huawei.com (7.193.23.208) 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 cf85ef55a0f4..f70a1159de40 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