Article View: linux.kernel.netdev
Article #19133Re: [PATCH net-next v6 2/3] ethtool: include errored frames in PHY receive byte counts
From: netdev-bot+sashiko
Date: Thu, 19 Nov 2026 12:00
Date: Thu, 19 Nov 2026 12:00
100 lines
12224 bytes
12224 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The commit message says the patch defines rx_bytes in two ways:
it includes bytes in frames with errors, and it counts reception at…
- [Low] After this patch, the counters in the ETHTOOL_STATS_PHY
("phydev") group no longer count the same set of frames, and nothing…
--
ethtool: include errored frames in PHY receive byte counts
This commit changes the kerneldoc for rx_bytes in struct ethtool_phy_stats
from "Total successfully received bytes" to "Total received bytes". The
commit message says the goal is to let PHY drivers report a hardware byte
count that includes frames with errors.
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index c3a41fbd5426d..9c3f079d9573e 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -481,7 +481,7 @@ struct ethtool_eth_phy_stats {
> /**
> * struct ethtool_phy_stats - PHY-level statistics counters
> * @rx_packets: Total successfully received frames
> - * @rx_bytes: Total successfully received bytes
> + * @rx_bytes: Total received bytes
[Severity: Low]
The commit message says:
Define this existing counter to include bytes in frames with errors so
drivers can report their hardware byte count through it. The counter
describes reception at the PHY, independently of MAC or host filtering.
Does the new kerneldoc line say either of these things? "Total received
bytes" does not say that errored frames are included. It also says nothing
about counting before MAC or host filtering.
Nothing else in the tree documents the new meaning either. The uAPI comment
covering ETHTOOL_A_STATS_PHY_RX_BYTES in include/uapi/linux/ethtool_netlink.h
only says:
/* Basic packet counters if PHY has separate counters from the MAC */
The group table in ethtool-netlink.rst only says "Additional PHY
statistics, not defined by IEEE".
Neither of these changes by the end of the series (after "net: phy: acx00:
report receive statistics"). The definition therefore exists only in this
commit message.
Could the line state it directly, for example "Total bytes in all frames
received by the PHY, including frames with errors"?
> * @rx_errors: Total received frames with errors (e.g., CRC errors)
> * @tx_packets: Total successfully transmitted frames
> * @tx_bytes: Total successfully transmitted bytes
[Severity: Low]
After this change, @rx_packets and @tx_bytes still say "successfully", but
@rx_bytes is meant to include errored frames. Should the doc say that the
two RX counters now cover different sets of frames?
stats_put_phydev_stats() in net/ethtool/stats.c sends them to userspace
together as the RxFrames/RxOctets pair:
if (stat_put(skb, ETHTOOL_A_STATS_PHY_RX_PKTS,
data->phydev_stats.rx_packets) ||
stat_put(skb, ETHTOOL_A_STATS_PHY_RX_BYTES,
data->phydev_stats.rx_bytes) ||
The first user is acx00_ephy_get_phy_stats(), added later in this series
by "net: phy: acx00: report receive statistics". It relies on this split.
It reports rx_packets without CRC-errored frames, and rx_bytes as the raw
hardware total that includes them:
stats->rx_packets = priv->stats[ACX00_STAT_RX_PACKETS];
stats->rx_errors = priv->stats[ACX00_STAT_RX_CRC_ERRORS];
stats->rx_bytes = priv->stats[ACX00_STAT_RX_BYTES];
Userspace that computes RxOctets / RxFrames (average frame size) would get
inflated numbers. So would userspace that compares the RX pair with the TX
pair. Nothing in the uAPI header, ethtool-netlink.rst or the kerneldoc
explains the difference.
The commit message explains why rx_bytes has to include errored frames. It
does not say why the difference between the two RX counters is left
undocumented.
Could the doc say something like "including frames with errors (unlike
@rx_packets)"? Alternatively, the pair could stay consistent, with a
separate attribute added for bytes in all frames.
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-submit-acx00-phy-stats-v1-v6-0-8feef8e76cd5%40gmail.com
Technical Details
Message-ID:
<179508961824.3136.4655138931772662232@kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366991-linux-kernel-netdev=dewy.ruReferences:
<20261116-submit-acx00-phy-stats-v1-v6-2-8feef8e76cd5@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366991-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v6 2/3] ethtool: include errored frames in PHY receive byte counts Date: Thu, 19 Nov 2026 12:00:18 +0000 Organization: Usenet Network Message-ID: <179508961824.3136.4655138931772662232@kernel.org> References: <20261116-submit-acx00-phy-stats-v1-v6-2-8feef8e76cd5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2864938"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:mRJCMtkwgQVno86FsmMaFuB1vlc= sha256:95EsBzKvBdz3I2v55nA6O7HPlJgcYextZ0H23BH7rxA= sha1:0uFTPdOAzWvsR6gMRCd0YTttJkM= sha256:mApiGkV8OQIJIK5XgRIGtPZi0wcUz7ZybHGasdngZHo= 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 7B4A1115611; Thu, 19 Nov 2026 15:00:42 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.4 X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org 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 aEof0WH0Q8IZ; Thu, 19 Nov 2026 15:00:38 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-366991-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id CC9DF1155FD; Thu, 19 Nov 2026 15:00:29 +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 526F886CE3; Thu, 19 Nov 2026 12:00:24 +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=1795089620; b=lfEIsuphEekIrRqDWBg3rm3/7q9Om+IDHQoyF0esI1J+8ucQAT34+iEdM7Q/paFJl6AV zmhKJQTr/jsp+D/otynhen/UMEa4VebUu3hccI7da7WGwal5bvq3gAM31UW4QYHuLP5zY T3sRHVhSRDbx3KHaK3lGXwSoyAi6vZ37DMPHvxqPv85LIU6BnnXBc6dNeoqsyNsK/ogLA 5AnZ/3FZ2oUQP3ghnpVXfYeJyypmqz4SPPpeh5xM782uf/00YSS9dENo/FqoVR9M6dOCj JPZCgNydUh9NS2vOvv6aM3Eq2TWVIND+5I76Oz6+1cRdtI9dKtS45CFU8g2uPDkZYnQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795089620; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=uNHLapStU2qi51kAgssvchPzLBaG6WLEuOPeOcyPnW0=; b=LkFT7EC+FjbXA+u7kDR7pTep97JVf+RPdUG9ns/k1W6QUxGZ9JdUzK2qlFzrxxjLDWXQ PJKZGYL6N5YnA9hg0aH1tfgHnuPf2wIwPlahoMJfTLBjRqo0ojYsbN6AjfIBH0Cc7z7ha GBiqdpOpg+5NgtSBaVJ9qNZF8LmP5mACfgAZU0x+yiIb/2+OXKS4Jjn1yduVfrziAHAhN qSi9YRUzv6RHJ6CvBNkd3wGFRJM/gaXGoB08C4HXiOFQJrKbFmlT7MxiT1HqObZEBJzwi hW3UiwGFjCFv7bDhdJkZbkmvPfDnu5MiPgfkP8HiMxBtaEd9qczXW1ZDqrXQfVSd/pQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=d+ZNtXY7; 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 C476660A2609; Thu, 19 Nov 2026 12:00:20 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=d+ZNtXY7 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795089620; b=kGkDNCAPuagivZysv6ySSllTAMUSnCP+3mY61PNZF4IuyqnU72yxgkzj7emzdIlX8bRd VWcI8g7s8zfLSG7gWiIZaBKHT9p/nfL8QPJmY6x1a6vcsiavpT0vM8yCtQIamzyveU9RU rcxSVoA6AnJpGWd0gzql8iMpK1d+Z3VSREv8N3ApsiAQiHzMO0EpLvQCtK3EUwL+Mo+Lm +pqW6jHmO0QMY4SCC+pPGsWmeKFViu0ArWBkCk3ZmSR0eW2l4grEqnBydOP1AZOL4doTY lyLaw76f4TG8Adp8c/TnxshlAyCe21Jd+NWNYReO/Z2aJayZB75gmY/Xef5mmevSXEw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795089620; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=uNHLapStU2qi51kAgssvchPzLBaG6WLEuOPeOcyPnW0=; b=IC/OJFqdNOAHwAN0kCscB9EMvRJZkcWwnGCw0fvmBoOC62DTzXKnCacJZq/nD84s44h6 ZgwZEYfKhw2EPDC2iktcTFvM88rbPECaqRjj7KgatdT0/KaTneSYjIvh0GnJn48oZG5E0 VTcj2uilRJtuuQD5XmRelZ6Nte3krS50Y3KqwNLMRExzX9Bi/C/i6K2NPqFVpLo5ovN3u gu8aMls+y27ElT7SZ42e7k0g3ZrvbiMXINNdXb1p06KnHH69J7a/cKws3UXf8BuHQpT3k VN1se1Ve7qx+iV+6YGufRYS98AJp0BHSZjupY0IwTNe4mYrRwHJIDM03rJkPSWAljfg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=d+ZNtXY7; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6CE2606A33E; Thu, 19 Nov 2026 12:00:19 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEC981F000C4; Thu, 19 Nov 2026 12:00:18 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795089619; bh=uNHLapStU2qi51kAgssvchPzLBaG6WLEuOPeOcyPnW0=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=d+ZNtXY7iBQ4FqSRzyYP/Bb/iox2XJjQpqmLU0q6kMgQDLPNfQ9gJfms9NCMIhbkt +HbyHigwJiGxCD9RnpA/3+9oqE4mjZHJi2kzS9U3aavXyDh3rvI2FGcKmv2Z87MQHz kh/H03dqlaSMzewjXpdif0B3IBddG4dZw86K0bBGbKC3cgfChSO7JxxoQZpTLXQd2h 1Ob7HdqH+GI4tGxuDTxexj3HFzQvFlQJY7vJ0swHE6alvSGA8Ki3Y+XrF5OVAYplb+ c7U1AMsTV1S+78E7rLSzvdRvuZnrMB/riY+rbbarSmO3Mt0fY1yiYyOuNXHNzuzvw8 duFqcUza0ztGw== X-Cc: andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, corbet@lwn.net, skhan@linuxfoundation.org, rdunlap@infradead.org, o.rempel@pengutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org X-In-Reply-To: <20261116-submit-acx00-phy-stats-v1-v6-2-8feef8e76cd5@gmail.com> X-sashiko-severity: Low 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