mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: 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>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH net-next v5 2/3] ethtool: add a PHY receive byte total
Date: Sun, 15 Nov 2026 16:25:41 +0100	[thread overview]
Message-ID: <37e4b9b8-d381-448f-a2b3-b92d7bd9033d@lunn.ch> (raw)
In-Reply-To: <20261115-submit-acx00-phy-stats-v1-v5-2-ed81a7f54373@gmail.com>

On Sun, Nov 15, 2026 at 12:45:46AM -0700, James Hilliard wrote:

> The generic PHY receive-byte counter describes successfully received
> traffic. Some PHYs instead count bytes in all received frames,
> including frames with errors.

In the general case, that is wrong. A PHY basically does digital to
analogue conversion. It takes a stream of bit from the MAC and
converts them to analogue signals on the media. In the opposite
direction, it recovers the analogue signals, converts it to digital,
and passes it to the MAC.

Thinks about SGMII. When running to 10Mbps, the MAC has to duplicate
the bits 100 times. At 100Mbps, it duplicates the bits 10 times. The
PHY then puts the bits onto the wire, it has no need to understand the
duplication, the boundary between the MAC level bits, it is just a
dumb DAC/ADC.

In order to see frames, not a stream of bits, you need a MAC.

Now, some PHYs do in fact have MACs. Those that implement PTP for
example need to reassemble the bit stream into frames. Anything which
does MACSEC. Or rate adaptation.

But in the general case, its just a stream of bits. And the byte
counters should be for the general case. And for SGMII, the definition
is a bit more fuzzy, does it include the repetition or not?

If the PHY has a MAC, it can additionally fill in the frame counters.

       Andrew

  reply	other threads:[~2026-11-15 15:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-15  7:45 [PATCH net-next v5 0/3] net: phy: report ACx00 receive statistics James Hilliard
2026-11-15  7:45 ` [PATCH net-next v5 1/3] docs: networking: correct the PHY statistics group name James Hilliard
2026-11-15 15:01   ` Andrew Lunn
2026-11-15  7:45 ` [PATCH net-next v5 2/3] ethtool: add a PHY receive byte total James Hilliard
2026-11-15 15:25   ` Andrew Lunn [this message]
2026-11-15  7:45 ` [PATCH net-next v5 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=37e4b9b8-d381-448f-a2b3-b92d7bd9033d@lunn.ch \
    --to=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=o.rempel@pengutronix.de \
    --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

all inboxes | Powered by JetHome®