Re: [PATCH net-next v1 2/3] net: dsa: ar9331: add support for pause stats

From: Oleksij Rempel
Date: Wed Jun 29 2022 - 03:08:19 EST


On Tue, Jun 28, 2022 at 09:10:27AM -0700, Jakub Kicinski wrote:
> On Tue, 28 Jun 2022 10:45:04 +0200 Oleksij Rempel wrote:
> > After I started investigating this topic, I was really frustrated. It is
> > has hard to find what is wrong: my patch is not working and flow
> > controller is not triggered? Or every HW/driver implements counters in
> > some own way. Same is about byte counts: for same packet with different
> > NICs i have at least 3 different results: 50, 64 and 68.
> > It makes testing and validation a nightmare.
>
> Yeah, I was gonna mention QA in my reply. The very practical reason I've
> gone no-CRC, no-flow control in the driver stats in the past was that it
> made it possible to test the counters are correct and the match far end.
> I mean SW matches HW, and they both match between sender/receiver
> (testing NIC-switch-NIC if either link does flow control the counters
> on NICs won't match).

Hm, may be it make sense to provide extra information on what the HW
counters do actually count? For example set flags, caps, for HW counting
pause frames in the main counter. I do not know if there are other use
cases where data is transferred but not counted except for FCS.

In case someone will hit a switch counting pause frames (like KSZ9477 do),
it will be better to know about it from user space. Instead of making
source code archeology.

Regards,
Oleksij
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |