From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 207D213ACF; Tue, 9 Jan 2024 08:19:51 +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.105]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4T8P3G0dKYzsVs2; Tue, 9 Jan 2024 16:19:06 +0800 (CST) Received: from kwepemm600007.china.huawei.com (unknown [7.193.23.208]) by mail.maildlp.com (Postfix) with ESMTPS id 28AF8140136; Tue, 9 Jan 2024 16:19:49 +0800 (CST) Received: from [10.67.120.192] (10.67.120.192) 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; Tue, 9 Jan 2024 16:19:48 +0800 Message-ID: <00e5d6e2-168c-4887-8b6d-8498ebaafe6d@huawei.com> Date: Tue, 9 Jan 2024 16:19:48 +0800 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird CC: , , , , , , , , , , , , , , Subject: Re: [PATCH V4 net-next 4/4] net: hns3: support dump pfc frame statistics in tx timeout log To: Jiri Pirko References: <20240105010119.2619873-1-shaojijie@huawei.com> <20240105010119.2619873-5-shaojijie@huawei.com> From: Jijie Shao In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600007.china.huawei.com (7.193.23.208) on 2024/1/5 17:55, Jiri Pirko wrote: >> +++ 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); > Don't we have a better way to expose this? I mean, whenever there is a > patch that extends the amount of text written in dmesg, it smells. > We should rather reduce it. > In fact, we include this part of the statistics in the ethtool -S statistics. However, if tx timeout occurs,the driver performs a reset attempt to recover it. And the statistics are cleared after the reset. Therefore, pfc statistics are added to tx timeout log to determine the timeout cause.