On Sun, Nov 15, 2026 at 9:39 PM Andrew Lunn [off-list ref] wrote:
On Sun, Nov 15, 2026 at 09:12:35PM -0700, James Hilliard wrote:
quoted
On Sun, Nov 15, 2026 at 8:25 AM Andrew Lunn [off-list ref] wrote:
quoted
On Sun, Nov 15, 2026 at 12:45:46AM -0700, James Hilliard wrote:
quoted
The generic PHY receive-byte counter describes successfully received
traffic. Some PHYs instead count bytes in all received frames,
including frames with errors.
That restriction comes from the current kernel-doc definition of
ethtool_phy_stats.rx_bytes: "Total successfully received bytes".
Yes, i found this.
quoted
Should we instead clarify the existing rx_bytes definition to include
errored traffic and use it for ACx00, dropping rx_bytes_total? That
would leave the existing packet counters unchanged.
What do you mean by errored traffic?
Specifically, frames with an invalid Ethernet FCS. ACx00 has a
PHY-resident CRC-error counter, and its received-byte counter includes
bytes from those frames.
We checked this using PHY loopback with MAC FCS insertion disabled.
Frames with a software-generated valid FCS did not increment the PHY
CRC-error counter; flipping one FCS bit did. These observations came
from the PHY registers read over MDIO, not from MAC statistics.
Think about it.
If you don't have a MAC, you don't have FCS.
There are existing mainline PHY drivers exposing this functionality.
The QCA807x/QCA808x drivers use qcom_phy_counter_config() to enable
CRC checking, and qcom_phy_get_stats() reports the RX CRC-error count
through ethtool_phy_stats.rx_errors [0]. The IP101G driver also exposes
a phy_crc_errors counter separately from phy_symbol_errors [1].
This demonstrates frame-aware diagnostic functionality within these
PHYs, rather than something every PHY necessarily implements.
The generic byte counter need not require that functionality. My
question was whether rx_bytes should count received bytes without
conditioning the count on FCS validity. ACx00 could then report its
hardware byte total through that field, including bytes from frames
which its separate CRC checker identifies as bad.
[0] https://github.com/torvalds/linux/blob/v7.4-rc3/drivers/net/phy/qcom/qcom-phy-lib.c
[1] https://github.com/torvalds/linux/blob/v7.4-rc3/drivers/net/phy/icplus.c
Andrew