Re: [PATCH net-next v5 2/3] ethtool: add a PHY receive byte total

From: Oleksij Rempel

Date: Thu Nov 19 2026 - 10:34:39 EST


On Tue, Nov 17, 2026 at 08:55:50AM -0700, James Hilliard wrote:
> This is Allwinner H616 EMAC1, using dwmac-sun8i/stmmac, connected to an
> AC200 PHY over RMII. The driver reports no MAC management counters.
> The CRC and length-error statistics in ethtool -S are software counters
> updated from RX descriptor status, not independent hardware counters.
[...]
> The tested length-field mismatches did produce descriptors and increment
> rx_length_errors. The accounting gap is specifically for frames discarded
> before an RX descriptor is returned, including those bad-FCS runts.

Thanks for checking this. On this board the PHY counters are the only
counters we know of that show these frames, and I see why you want them
to be as complete as possible.

With a MAC that does not count its own drops, it does not really matter
what exactly the PHY counters include. The difference between PHY and
MAC counts cannot be attributed anyway, and for debugging the deltas are
what matters, as Andrew said. So I will not insist on a particular
definition here.

For automated diagnostics, a tool would need to know what each counter
includes, on the PHY and on the MAC side. That would be nice to have,
but it is my dream for tomorrow, not something for this series.

Oleksij