Subject: Re: [PATCH V6 net-next 3/4] net: hns3: dump more reg info based on ras mod

From: Jakub Kicinski <[email-masked]>
Date: Mon, 1 Apr 2024 20:39:35 -0700

On Sat, 30 Mar 2024 10:35:51 +0800 Jijie Shao wrote:
> >> Generally, driver will reset to restore the normal state.
> >> After the reset, many registers are cleared. Therefore,
> >> it is difficult to analyze the reason of RAS.  
> > Perhaps I'm missing the significance of the reset when it comes
> > to counters reported via standard APIs. Are rtnl_link_stats64
> > going to behave differently across a reset than these debug entries?
> >  
> 1. These statistics are the same as rtnl_link_stats64. However, these are not updated in real time.
>     They are updated only when users query them or driver updates them every 5 minutes.
>     However, these are cleared after the reset, which makes debugging difficult.

This explanation is a bit hard to understand because you use 'these'
and 'they', and I'm not sure whether you're referring to rtnl stats
or the debugfs stats :S Please make the commit description more clear
when reposting.

> 2. Currently, only a few MIB statistics are required, not all.
> 3. Are you suggesting that we use rtnl_link_stats64 to provide MIB statistics?

Reporting via the standard APIs is the first step. You report pause
stats here, for instance, but do not implement
ethtool_ops::get_pause_stats.

If the semantics of the debugfs stats are useful for debug that's
fine. But (1) support the standard APIs first, (2) clearly describe
how the debugfs ones differ.