[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3e268abd-620c-470b-ba3b-222a0c39cac5@bootlin.com>
Date: Fri, 17 Oct 2025 16:13:34 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Oleksij Rempel <o.rempel@...gutronix.de>, Andrew Lunn <andrew@...n.ch>,
Jakub Kicinski <kuba@...nel.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Donald Hunter <donald.hunter@...il.com>,
Jonathan Corbet <corbet@....net>, Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>,
Kory Maincent <kory.maincent@...tlin.com>, Nishanth Menon <nm@...com>
Cc: kernel@...gutronix.de, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org, UNGLinuxDriver@...rochip.com,
linux-doc@...r.kernel.org, Michal Kubecek <mkubecek@...e.cz>,
Roan van Dijk <roan@...tonic.nl>
Subject: Re: [PATCH net-next v6 1/5] ethtool: introduce core UAPI and driver
API for PHY MSE diagnostics
Hi Oleksij,
On 17/10/2025 12:47, Oleksij Rempel wrote:
> Add the base infrastructure for Mean Square Error (MSE) diagnostics,
> as proposed by the OPEN Alliance "Advanced diagnostic features for
> 100BASE-T1 automotive Ethernet PHYs" [1] specification.
>
> The OPEN Alliance spec defines only average MSE and average peak MSE
> over a fixed number of symbols. However, other PHYs, such as the
> KSZ9131, additionally expose a worst-peak MSE value latched since the
> last channel capture. This API accounts for such vendor extensions by
> adding a distinct capability bit and snapshot field.
>
> Channel-to-pair mapping is normally straightforward, but in some cases
> (e.g. 100BASE-TX with MDI-X resolution unknown) the mapping is ambiguous.
> If hardware does not expose MDI-X status, the exact pair cannot be
> determined. To avoid returning misleading per-channel data in this case,
> a LINK selector is defined for aggregate MSE measurements.
>
> All investigated devices differ in MSE capabilities, such
> as sample rate, number of analyzed symbols, and scaling factors.
> For example, the KSZ9131 uses different scaling for MSE and pMSE.
> To make this visible to userspace, scale limits and timing information
> are returned via get_mse_capability().
>
> Some PHYs sample very few symbols at high frequency (e.g. 2 us update
> rate). To cover such cases and allow for future high-speed PHYs with
> even shorter intervals, the refresh rate is reported as u64 in
> picoseconds.
>
> This patch defines new UAPI enums for MSE capability flags and channel
> selectors in ethtool_netlink (generated from YAML), kernel-side
> `struct phy_mse_capability` and `struct phy_mse_snapshot`, and new
> phy_driver ops:
>
> - get_mse_capability(): report supported capabilities, scaling, and
> sampling parameters for the current link mode
> - get_mse_snapshot(): retrieve a correlated set of MSE values from
> the latest measurement window
>
> These definitions form the core API; no driver implements them yet.
>
> Standardization notes:
> OPEN Alliance defines presence and interpretation of some metrics but does
> not fix numeric scales or sampling internals:
>
> - SQI (3-bit, 0..7) is mandatory; correlation to SNR/BER is informative
> (OA 100BASE-T1 v1.0 6.1.2; OA 1000BASE-T1 v2.2 6.1.2).
> - MSE is optional; OA recommends 2^16 symbols and scaling to 0..511,
> with a worst-case latch since last read (OA 100BASE-T1 v1.0 6.1.1; OA
> 1000BASE-T1 v2.2 6.1.1). Refresh is recommended (~0.8-2.0 ms for
> 100BASE-T1; ~80-200 us for 1000BASE-T1). Exact scaling/time windows
> are vendor-specific.
> - Peak MSE (pMSE) is defined only for 100BASE-T1 as optional, e.g.
> 128-symbol sliding window with 8-bit range and worst-case latch (OA
> 100BASE-T1 v1.0 6.1.3).
>
> Therefore this UAPI exposes which measures and selectors a PHY supports,
> and documents where behavior is standard-referenced vs vendor-specific.
>
> [1] <https://opensig.org/wp-content/uploads/2024/01/
> Advanced_PHY_features_for_automotive_Ethernet_V1.0.pdf>
>
> Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
This looks good to me,
Reviewed-by: Maxime Chevallier <maxime.chevallier@...tlin.com>
Maxime
Powered by blists - more mailing lists