Article View: linux.kernel.netdev
Article #16680Re: [PATCH net-next v5 2/3] ethtool: add a PHY receive byte total
From: Andrew Lunn
Date: Sun, 15 Nov 2026 15:25
Date: Sun, 15 Nov 2026 15:25
32 lines
9864 bytes
9864 bytes
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
Technical Details
Message-ID:
<37e4b9b8-d381-448f-a2b3-b92d7bd9033d@lunn.ch>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363737-linux-kernel-netdev=dewy.ruReferences:
<20261115-submit-acx00-phy-stats-v1-v5-0-ed81a7f54373@gmail.com> <20261115-submit-acx00-phy-stats-v1-v5-2-ed81a7f54373@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363737-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v5 2/3] ethtool: add a PHY receive byte total Date: Sun, 15 Nov 2026 16:25:41 +0100 Organization: Usenet Network Message-ID: <37e4b9b8-d381-448f-a2b3-b92d7bd9033d@lunn.ch> References: <20261115-submit-acx00-phy-stats-v1-v5-0-ed81a7f54373@gmail.com> <20261115-submit-acx00-phy-stats-v1-v5-2-ed81a7f54373@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1837069"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:dsg1gQcefDFxvddIJmqYSGNCmSA= sha256:jZe0v+IURaW5YfLNuAgkY4wIK2Ty/3fn8tLV2H3P40Q= sha1:39jKa2nX16sduwHnY5viqi5XoEE= sha256:wbtCgIzeIddmD486F14hlczG8RF1xIdq+H2NAxvgnKg= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 8810D1149F3; Sun, 15 Nov 2026 18:26:12 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id djhfCGVrWzK8; Sun, 15 Nov 2026 18:26:07 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-363737-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 3B0381149E1; Sun, 15 Nov 2026 18:25:59 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 2520E31789; Sun, 15 Nov 2026 15:25:57 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794756353; b=iWWmdbrwGvjc/18UhgbRWBg0hMWeWx269YI0uPRvNXHvaTsVbKDAggcwUQYRZgv3PtYU vWPbDMZc9Ea7Oy24AARU/XnFz/rW9Z6uFvzCeGXE0xswCv4xGvFHHMebyT3tvu5vNqhxw 7g4g5JtdemAVwxWuPbDITLtuulXQsv6ao15nUDa06zhBomuK67CH9xBQ5si01fZZ8QiwR pdR+k1PHeLJzyEERHiUHltogEDquFo6ahKxv7NlC/dfATHA0PDatJSIE6nLaYYYjb5kJp 7oWj2oO7EKwhgGUUVd9PTyXFQWIsqqi2l3t9LknTODYnshH4hn/SD8u9deXz7kWlCMw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794756353; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=Y6z3pT2mfMpUAyOstamDkN7k+wTTsLHL0mdr1VkgXOM=; b=JwGz1dhu8iRyJlFpO8JJKsjihUrt2SIK6e28HUpxg9KSDyTBMDvE455UfzqoGEmXCwVn j2dDEpE038SIQh2cZt6RzZP/t5FnXWwbXkK8hP7HDsFLj9pOY8pkTXXi92Fti4qxKi+bj 2Fg9rqkkKURhHosOEwQhd4dr2WRj8vGkAkYSSoPINNKUAcu1l3flcYbJeLZjh3tI2CJsV 9NhjqhFWPdMgI3+MgXBDWhWNLpX8xzhRr0GBNm9PywA998bsogGSnSQ8BLPo426yS9JCJ 9YWTduAz8R+sJ2zjukE67+etFT6pbqaS1DNH/1kqDLO2PueGfMzJQJ0EML/vSbarKJQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=lrRCbPRl; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4152606A33B; Sun, 15 Nov 2026 15:25:52 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=lrRCbPRl X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794756352; b=uZrAyTG+1bYZq0/suK9DNkGZm4SSeuJYRJ/ilbrlt9PP+3dvTW2sh5KwYScF66p782hZ RDrCOUNdUsTSVNShDk9jlF983m7zsYlvfm8cuD7l82O3MVeW1gFYpo47vY84l04SIdDA9 O3rwuv4kfAJcpFxpVA7zErpqWuvbVyHh/c6gQ3XSkvSg74Hwa+yBWjoBqIJ4jmGoO38jq Kh9R7E3tFAlz+fH3cF+mUU0Pl6ZWynPptAxtkJJvyYkUZayCnAHABKykkix+XOaS9wG6q oNbxxT4iieucjCuOCjC3JmgnXYdPGvPsk4vHzzndt6f0Dww0B1iqBmdMF6UfDmGiEtQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794756352; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=Y6z3pT2mfMpUAyOstamDkN7k+wTTsLHL0mdr1VkgXOM=; b=xY7050o8C5nmEncdboQYlAsKXw0y6nBrhmGcdE6wEGgCLqH3s2GxwAE49RW1fq0WEU+Z nVuYW8xh9OrQtr2ZRf/hqNauBtBgX/0vpvONulOBGkHx9U97J+0bhvvlHdzKxEANcPMcy 9E0yRy7M36EdML8yTtkY0JswJw7G+23+ITtbmRMGe2cwEGZq4crohBJOKT+56shwp2YlX mtLmSM3xdj9X+i7ZgrPAD3DKExq+Bn8AON1rP4gnGa+cqZ7MDBfmTpPOv5XYREFQUeqwt stMxp37wnSWS3c+Opit589mNDeZW6n40QQ428FJGUh0mR/uG1QqIfUmKl1URvjjjeEg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=lrRCbPRl; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC3F9606A31F; Sun, 15 Nov 2026 15:25:51 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BC3F9606A31F X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Y6z3pT2mfMpUAyOstamDkN7k+wTTsLHL0mdr1VkgXOM=; b=lrRCbPRljZCKr0VZrEvo2TJ64H SNRqAV6LFPlZFqWvRyi3xN9efFWlE90RIhEqFHBL6MZEMYIfMeu6otgXSoXWhUWoOcjqukrD5wOsT /oC3QSoLQ2ATDchRs363GaAQpCA1Rj4HAJeDJ0OPXK5PSopMBxD2mFK/ZEHBH+zTHciQ=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xSc6v-00GdLG-Az; Sun, 15 Nov 2026 16:25:41 +0100 X-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 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261115-submit-acx00-phy-stats-v1-v5-2-ed81a7f54373@gmail.com>