[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZZ0LPlVUqkJrDr-x@nanopsycho>
Date: Tue, 9 Jan 2024 10:00:46 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jijie Shao <shaojijie@...wei.com>
Cc: yisen.zhuang@...wei.com, salil.mehta@...wei.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
horms@...nel.org, shenjian15@...wei.com, wangjie125@...wei.com,
liuyonglong@...wei.com, lanhao@...wei.com, wangpeiyang1@...wei.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V4 net-next 4/4] net: hns3: support dump pfc frame
statistics in tx timeout log
Tue, Jan 09, 2024 at 09:19:48AM CET, shaojijie@...wei.com wrote:
>
>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.
Does not sound correct at all. You are basically forcing user to check
the dmesg to understand the behaviour of stats he gets from ethtool. You
can expose "reset"/"recover" counter through ethtool to expose this fact
rather than dmesg print. Please don't add dmesg print.
>
>
Powered by blists - more mailing lists