> Subject: Re: [PATCH net-next 05/13] net: enetc: add debugfs interface to dump > MAC filter > > On Fri, Jan 03, 2025 at 02:06:01PM +0800, Wei Fang wrote: > > ENETC's MAC filter consists of hash MAC filter and exact MAC filter. Hash > > MAC filter is a 64-entry hash table consisting of two 32-bit registers. > > Exact MAC filter is implemented by configuring MAC address filter table > > through command BD ring. The table is stored in ENETC's internal memory > > and needs to be read through command BD ring. In order to facilitate > > debugging, added a debugfs interface to get the relevant information > > about MAC filter. > > How do other drivers do this?
I don't know about other vendor's hardware, but IMO, if the configuration is done through registers, we only need to debug through some tools that read and write registers, such as devmem2. I also saw some drivers added debugfs interface, such as Intel, Huawei, Marvell, etc. I think they also added it to facilitate obtaining some debugging information. > > You should only use debugfs if there is no standard way to accomplish > something. And if there is no standard way, you should be thinking is > this a common feature other drivers will need, and if so, add a > standard mechanism. > > You will get pushback for using debugfs as a bumping ground without > adding some justification that debugfs is the only possible solution. > IMO, standard methods are only suitable for extracting common information, but each vendor's implementation is not uniform, and the specific details are also different. It is impossible to obtain every detail information through standard methods. The purpose of adding debugfs is just to facilitate debugging, so we need to obtain all the detailed information, so I think the debugfs interface is good, which allows us to obtain every specific information in all NETC tables.