From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A6243101A5 for ; Mon, 27 Oct 2025 12:28:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761568122; cv=none; b=qcUgzrzPRGynBkiPEFhfq9jpzWvA0OlQZ85w7deWQVvdM4aeL++fg8/U+/qKtBRTBIVW3R+aTuSvgWx3ZVtj6YN5Yyxos8iB/P6t/RhTtQwRB2o2brZnGIUiXmt2SxYnFIpmB4fdracX9vFIxIsSbeeE47IlAipC58QX/8Hepdc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761568122; c=relaxed/simple; bh=asSCZ97O28svJQnAb6Beu2n1OE4U3rerw0j0Qjaw7sY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=BrVRgBsOHCnsVIOtT0C2jG2/d0rjZ5NNEzqTrHKKAbbTjvJt+mN0/rKW8iQLLVR4NZ9yto7ru10LchjZGV8L9XrAxMJ/QQJXfwGUMeGkZVpnhjGHfTbMYcmjnBFXv3dloCRCqugfBS/Qrz2u/z7Px25Lgp1UQYfIGDzWbqIbvhI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1vDMKX-0004fn-TB; Mon, 27 Oct 2025 13:28:09 +0100 Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vDMKV-005hdu-1C; Mon, 27 Oct 2025 13:28:07 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.98.2) (envelope-from ) id 1vDMKV-000000047Zh-1AZo; Mon, 27 Oct 2025 13:28:07 +0100 From: Oleksij Rempel To: Andrew Lunn , Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Donald Hunter , Jonathan Corbet , Heiner Kallweit , Russell King , Kory Maincent , Maxime Chevallier , Nishanth Menon Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, linux-doc@vger.kernel.org, Michal Kubecek , Roan van Dijk Subject: [PATCH net-next v8 0/4] ethtool: introduce PHY MSE diagnostics UAPI and drivers Date: Mon, 27 Oct 2025 13:27:57 +0100 Message-ID: <20251027122801.982364-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-doc@vger.kernel.org changes v8: - Drop capability bitfield support from UAPI - Drop channel selection support from user space - Kernel now returns all available channels automatically - Add OA Technical Committee numbers (TC1 / TC12) - Minor doc and type cleanups changes v7: - htmldoc fixes changes v6: - rework the code to use uint instead of u32/u64 - use bitset for flags - use nest for each separate channel changes v5: - add struct phy_mse_snapshot and phy_mse_config to the documentation changes v4: - remove -ENETDOWN as expected error value for get_mse_config() and get_mse_snapshot() - fix htmldocs builds - s/__ethtool-a-mse/--ethtool-a-mse changes v3: - add missing ETHTOOL_A_LINKSTATE_MSE_* yaml changes changes v2: - rebase on latest net-next This series introduces a generic kernel-userspace API for retrieving PHY Mean Square Error (MSE) diagnostics, together with netlink integration, a fast-path reporting hook in LINKSTATE_GET, and initial driver implementations for the KSZ9477 and DP83TD510E PHYs. MSE is defined by the OPEN Alliance "Advanced diagnostic features for 100BASE-T1 automotive Ethernet PHYs" specification [1] as a measure of slicer error rate, typically used internally to derive the Signal Quality Indicator (SQI). While SQI is useful as a normalized quality index, it hides raw measurement data, varies in scaling and thresholds between vendors, and may not indicate certain failure modes - for example, cases where autonegotiation would fail even though SQI reports a good link. In practice, such scenarios can only be investigated in fixed-link mode; here, MSE can provide an empirically estimated value indicating conditions under which autonegotiation would not succeed. Example output with current implementation: root@DistroKit:~ ethtool lan1 Settings for lan1: ... Speed: 1000Mb/s Duplex: Full ... Link detected: yes SQI: 5/7 MSE: 3/127 (channel: worst) root@DistroKit:~ ethtool --show-mse lan1 MSE diagnostics for lan1: MSE Configuration: Max Average MSE: 127 Refresh Rate: 2000000 ps Symbols per Sample: 250 Supported capabilities: average channel-a channel-b channel-c channel-d worst MSE Snapshot (Channel: a): Average MSE: 4 MSE Snapshot (Channel: b): Average MSE: 3 MSE Snapshot (Channel: c): Average MSE: 2 MSE Snapshot (Channel: d): Average MSE: 3 [1] https://opensig.org/wp-content/uploads/2024/01/Advanced_PHY_features_for_automotive_Ethernet_V1.0.pdf Oleksij R Oleksij Rempel (4): net: phy: introduce internal API for PHY MSE diagnostics ethtool: netlink: add ETHTOOL_MSG_MSE_GET and wire up PHY MSE access net: phy: micrel: add MSE interface support for KSZ9477 family net: phy: dp83td510: add MSE interface support for 10BASE-T1L Documentation/netlink/specs/ethtool.yaml | 86 +++++ Documentation/networking/ethtool-netlink.rst | 64 ++++ drivers/net/phy/dp83td510.c | 62 ++++ drivers/net/phy/micrel.c | 102 ++++++ include/linux/phy.h | 206 +++++++++++ .../uapi/linux/ethtool_netlink_generated.h | 35 ++ net/ethtool/Makefile | 2 +- net/ethtool/mse.c | 329 ++++++++++++++++++ net/ethtool/netlink.c | 10 + net/ethtool/netlink.h | 2 + 10 files changed, 897 insertions(+), 1 deletion(-) create mode 100644 net/ethtool/mse.c -- 2.47.3