mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>,
	Andrew Lunn <andrew@lunn.ch>, Jakub Kicinski <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Donald Hunter <donald.hunter@gmail.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	Kory Maincent <kory.maincent@bootlin.com>,
	Nishanth Menon <nm@ti.com>
Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, UNGLinuxDriver@microchip.com,
	linux-doc@vger.kernel.org, Michal Kubecek <mkubecek@suse.cz>,
	Roan van Dijk <roan@protonic.nl>
Subject: Re: [PATCH net-next v6 1/5] ethtool: introduce core UAPI and driver API for PHY MSE diagnostics
Date: Fri, 17 Oct 2025 16:13:34 +0200	[thread overview]
Message-ID: <3e268abd-620c-470b-ba3b-222a0c39cac5@bootlin.com> (raw)
In-Reply-To: <20251017104732.3575484-2-o.rempel@pengutronix.de>

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@pengutronix.de>

This looks good to me,

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime


  reply	other threads:[~2025-10-17 14:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 10:47 [PATCH net-next v6 0/5] ethtool: introduce PHY MSE diagnostics UAPI and drivers Oleksij Rempel
2025-10-17 10:47 ` [PATCH net-next v6 1/5] ethtool: introduce core UAPI and driver API for PHY MSE diagnostics Oleksij Rempel
2025-10-17 14:13   ` Maxime Chevallier [this message]
2025-10-17 10:47 ` [PATCH net-next v6 2/5] ethtool: netlink: add ETHTOOL_MSG_MSE_GET and wire up PHY MSE access Oleksij Rempel
2025-10-18 23:50   ` Jakub Kicinski
2025-10-17 10:47 ` [PATCH net-next v6 3/5] ethtool: netlink: add lightweight MSE reporting to LINKSTATE_GET Oleksij Rempel
2025-10-17 10:47 ` [PATCH net-next v6 4/5] net: phy: micrel: add MSE interface support for KSZ9477 family Oleksij Rempel
2025-10-17 14:27   ` Maxime Chevallier
2025-10-17 10:47 ` [PATCH net-next v6 5/5] net: phy: dp83td510: add MSE interface support for 10BASE-T1L Oleksij Rempel
2025-10-17 14:20   ` Maxime Chevallier

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=3e268abd-620c-470b-ba3b-222a0c39cac5@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=roan@protonic.nl \
    /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®