From patchwork Fri Dec 20 13:08:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 13916724 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 40929215F4E for ; Fri, 20 Dec 2024 13:09:07 +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=1734700149; cv=none; b=LUVr/mKhjFQuSoLfHY/1YFrKve/O/D0fR8CX+d+dJG3+QkauNBmz19gQ+eW7S432nq3HGVs9nfvAEowqOEiaKw8BxMF760bsL0fAO2kOv4f7TwH1uagzARUOM/0z8dN45Nr2vxG4xhkCPYs2CDxE2Hq0ShZ7vJEGvCBdsGxqhfY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734700149; c=relaxed/simple; bh=jbrWJi/Ozx7YWY6sI5FVsxAwBkIdvKjr6sFzshCz8A4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=H33NZAmIEECgPKZek4kT1btuR6zSlEMAghW2+4yKCYOYIzNmwUiI+/f+35AIgnrGdcM2f5IBwdCskqxbBFBwqHxY7ROqoRBh9j2zJR9s9yZ2m2b5BXrvicpR0avLfKfWgnhEwk6OvjOzcEOhgXVgiMbgrFj/AkYeclQ4Y/TY9tY= 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 1tOckA-0004Du-4I; Fri, 20 Dec 2024 14:08:38 +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 1tOck7-004NZg-3D; Fri, 20 Dec 2024 14:08:36 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1tOck8-008MjO-2D; Fri, 20 Dec 2024 14:08:36 +0100 From: Oleksij Rempel To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Jonathan Corbet Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Simon Horman , Russell King , Maxime Chevallier , linux-doc@vger.kernel.org Subject: [PATCH net-next v3 0/8] Introduce unified and structured PHY Date: Fri, 20 Dec 2024 14:08:27 +0100 Message-Id: <20241220130836.1993966-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch set introduces a unified and well-structured interface for reporting PHY statistics. Instead of relying on arbitrary strings in PHY drivers, this interface provides a consistent and structured way to expose PHY statistics to userspace via ethtool. The initial groundwork for this effort was laid by Jakub Kicinski, who contributed patches to plumb PHY statistics to drivers and added support for structured statistics in ethtool. Building on Jakub's work, I tested the implementation with several PHYs, addressed a few issues, and added support for statistics in two specific PHY drivers. changes are tracked in separate patches. Jakub Kicinski (2): net: ethtool: plumb PHY stats to PHY drivers net: ethtool: add support for structured PHY statistics Oleksij Rempel (6): ethtool: linkstate: migrate linkstate functions to support multi-PHY setups Documentation: networking: update PHY error counter diagnostics in twisted pair guide net: phy: introduce optional polling interface for PHY statistics ethtool: add helper to prevent invalid statistics exposure to userspace net: phy: dp83td510: add statistics support net: phy: dp83tg720: add statistics support .../twisted_pair_layer1_diagnostics.rst | 39 +++-- Documentation/networking/ethtool-netlink.rst | 1 + drivers/net/phy/dp83td510.c | 112 ++++++++++++ drivers/net/phy/dp83tg720.c | 161 ++++++++++++++++++ drivers/net/phy/phy.c | 20 +++ include/linux/ethtool.h | 39 +++++ include/linux/phy.h | 100 +++++++++++ include/uapi/linux/ethtool.h | 2 + include/uapi/linux/ethtool_netlink.h | 14 ++ net/ethtool/linkstate.c | 25 ++- net/ethtool/netlink.h | 1 + net/ethtool/stats.c | 54 ++++++ net/ethtool/strset.c | 5 + 13 files changed, 553 insertions(+), 20 deletions(-) --- 2.39.5