Linux Documentation
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH net-next v6 2/3] ethtool: include errored frames in PHY receive byte counts
Date: Mon, 16 Nov 2026 14:12:54 +0100	[thread overview]
Message-ID: <avsBVtVgsluPNpVY@pengutronix.de> (raw)
In-Reply-To: <20261116-submit-acx00-phy-stats-v1-v6-2-8feef8e76cd5@gmail.com>

On Mon, Nov 16, 2026 at 01:59:58AM -0700, James Hilliard wrote:
> Some PHYs count bytes in all received frames, including frames with
> errors. A successful-byte count cannot be derived by subtracting a frame
> error count because the lengths of damaged frames are not available
> separately.
>
> No in-tree PHY driver currently reports rx_bytes. Define this existing
> counter to include bytes in frames with errors so drivers can report
> their hardware byte count through it.

I do not think we should change rx_bytes.

Comparing PHY and MAC counters, for example to find frames lost between
PHY and MAC, only works if both count the same kind of frames.
rx_packets counts good frames only ("Total successfully received
frames"), and so do the 802.3 MAC counters aFramesReceivedOK and
aOctetsReceivedOK (30.3.1.1.5, 30.3.1.1.14). With this patch, rx_bytes
would also count bad frames, so two counters in the same group describe
different frames. A PHY without a CRC checker cannot fill either of
them. A PHY that has one, like ACx00, should keep them consistent.

A separate counter for bad frames, as in v5, does not solve this either,
because "bad frame" is not one thing. 802.3 counts symbol errors at the
PHY (30.3.2.1.5) and FCS, alignment, length and frame-too-long errors at
the MAC (30.3.1.1.6, .7, .23 to .25). A symbol error points at this
link. A frame with a bad CRC can also come from the link partner.
rx_errors already means different things: mxl-gpy reports its RXERR
counter, qcom-phy-lib and dp83tg720 report CRC errors.

Strict definitions would need a counter for each combination, "include
everything" would make the counters useless for diagnosis, and moving a
counter between fields breaks existing users. Also, few people have the
hardware to confirm what a counter really counts.

I suggest metadata for the existing counters instead, similar to how
ETHTOOL_MSG_MSE_GET reports the scale of its values next to them. Old
user space can ignore it, new user space can use it, and it lists only
what is confirmed for a PHY. Andrew should agree to this direction
first.

For this series: keep rx_bytes as it is, report rx_packets and rx_errors
as you do, and keep the byte total driver-private for now.

@Andrew?

Oleksij

  reply	other threads:[~2026-11-16 13:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16  8:59 [PATCH net-next v6 0/3] net: phy: report ACx00 receive statistics James Hilliard
2026-11-16  8:59 ` [PATCH net-next v6 1/3] docs: networking: correct the PHY statistics group name James Hilliard
2026-11-16  8:59 ` [PATCH net-next v6 2/3] ethtool: include errored frames in PHY receive byte counts James Hilliard
2026-11-16 13:12   ` Oleksij Rempel [this message]
2026-11-16 13:23     ` Andrew Lunn
2026-11-16  8:59 ` [PATCH net-next v6 3/3] net: phy: acx00: report receive statistics James Hilliard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=avsBVtVgsluPNpVY@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=andrew@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=james.hilliard1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox