Re: [PATCH V4 net-next 4/4] net: hns3: support dump pfc frame statistics in tx timeout log

From: Jijie Shao
Date: Tue Jan 09 2024 - 03:20:05 EST



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.