From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D390EC3ABC3 for ; Mon, 12 May 2025 09:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kaiEC+PufeTUFVHYk/7+WnDcWgVB2rCo/IXTSdg1Hds=; b=IG42QEp/Vk967KQjr/izZUf4y+ yO6o7d6HCO+C/CWGm1lAVVZBCmNI58R/744Vto7QdFQs+c0h6xPMXXN0ScYrwyTWtLE++7vV1QcK5 6XcgJ4DAkcvtPeEkSg5+v4mPD0mTKNhksFWYOY3jtnUQS2wBnHVfn7MiszJclFO+aX7XtiNvDq3FN YT5u7GAJ7g9qm4C0k1Y/vPRFs5dqFetc1CCOSwwydtCOaxcLJv5C4kjuK77Hi9w8/GB2P3nqA0e14 KcE9LUkUig2RCySzx+3CbPmv57GfvjTn/7O786soiGBHvyTbOTd4Dc+QCJQzgwwOrb1imRNJReCj6 xDDhviiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uEPQy-00000008vVS-2a6k; Mon, 12 May 2025 09:26:52 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uEPMT-00000008u2s-36nU for linux-arm-kernel@lists.infradead.org; Mon, 12 May 2025 09:22:15 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id B96A642E7E; Mon, 12 May 2025 09:22:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1747041731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kaiEC+PufeTUFVHYk/7+WnDcWgVB2rCo/IXTSdg1Hds=; b=myroYSToz66ns5AWaEKJJvPJUQ2gNhiviSmOpp/J2y/Y8GROMCYAYuwQj8YyoGQq0ioQrw I0vja15KBTuai/J5zuSpLfuqRQvQiR3kb2j3hHKZ3BcBsRXrmg2YnmRQwaBSuy+vx6s/pB 1D83Xhz/+9fcJksBAxbL9E0q4tvY8TteyaYaLEtxufK51sq7VmWbCEC0WvYDFGFBsGYCfS 36kYPxE4KFGfMPeCaWLFJrogT8glen7n3s2DRBE3lNQkyNFvGFTXHHfKS3QK691LwDekZV tRzViTTgIV7ihzkV75uqQhgc0VRSa4JY6wdpJoo/hOJVrOvqkI9jfVbYQFE5RA== From: Romain Gantois To: davem@davemloft.net, Maxime Chevallier Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?B?S8O2cnk=?= Maincent , Marek =?UTF-8?B?QmVow7pu?= , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese , Simon Horman , mwojtas@chromium.org, Antoine Tenart , devicetree@vger.kernel.org, Conor Dooley , Krzysztof Kozlowski , Rob Herring , Daniel Golle , Dimitri Fedrau Subject: Re: [PATCH net-next v6 14/14] Documentation: networking: Document the phy_port infrastructure Date: Mon, 12 May 2025 11:22:04 +0200 Message-ID: <873525603.0ifERbkFSE@fw-rgant> In-Reply-To: <20250507135331.76021-15-maxime.chevallier@bootlin.com> References: <20250507135331.76021-1-maxime.chevallier@bootlin.com> <20250507135331.76021-15-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5568568.Sb9uPGUboI"; micalg="pgp-sha256"; protocol="application/pgp-signature" X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeftddtkeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhggtgesghdtreertddtjeenucfhrhhomheptfhomhgrihhnucfirghnthhoihhsuceorhhomhgrihhnrdhgrghnthhoihhssegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpefhvdelkeevgfeijedtudeiheefffejhfelgeduuefhleetudeiudektdeiheelgfenucffohhmrghinhepsghoohhtlhhinhdrtghomhenucfkphepledtrdekledrudeifedruddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeltddrkeelrdduieefrdduvdejpdhhvghlohepfhifqdhrghgrnhhtrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpehrohhmrghinhdrghgrnhhtohhishessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepfedtpdhrtghpthhtohepuggrvhgvmhesuggrvhgvmhhlohhfthdrnhgvthdprhgtphhtthhopehmrgigihhmvgdrtghhvghvrghllhhivghrsegsohhothhlihhnrdgtohhmpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrk hgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqrghrmhdqmhhsmhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomhdprhgtphhtthhopegrnhgurhgvfieslhhunhhnrdgthhdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhg X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250512_022213_927309_032D2907 X-CRM114-Status: GOOD ( 31.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --nextPart5568568.Sb9uPGUboI Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Romain Gantois Date: Mon, 12 May 2025 11:22:04 +0200 Message-ID: <873525603.0ifERbkFSE@fw-rgant> In-Reply-To: <20250507135331.76021-15-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Hi Maxime, On Wednesday, 7 May 2025 15:53:30 CEST Maxime Chevallier wrote: > This documentation aims at describing the main goal of the phy_port > infrastructure. > > Signed-off-by: Maxime Chevallier > --- > Documentation/networking/index.rst | 1 + > Documentation/networking/phy-port.rst | 111 ++++++++++++++++++++++++++ > MAINTAINERS | 1 + > 3 files changed, 113 insertions(+) > create mode 100644 Documentation/networking/phy-port.rst > > diff --git a/Documentation/networking/index.rst > b/Documentation/networking/index.rst index ac90b82f3ce9..f60acc06e3f7 > 100644 > --- a/Documentation/networking/index.rst > +++ b/Documentation/networking/index.rst > @@ -96,6 +96,7 @@ Contents: > packet_mmap > phonet > phy-link-topology > + phy-port > pktgen > plip > ppp_generic > diff --git a/Documentation/networking/phy-port.rst > b/Documentation/networking/phy-port.rst new file mode 100644 > index 000000000000..6d9d46ebe438 > --- /dev/null > +++ b/Documentation/networking/phy-port.rst > @@ -0,0 +1,111 @@ > +.. SPDX-License-Identifier: GPL-2.0 > +.. _phy_port: > + > +================= > +Ethernet ports > +================= > + > +This document is a basic description of the phy_port infrastructure, > +introduced to represent physical interfaces of Ethernet devices. > + > +Without phy_port, we already have quite a lot of information about what the > +media-facing interface of a NIC can do and looks like, through the I'd replace "and looks like" by "and what it looks like". > +:c:type:`struct ethtool_link_ksettings ` > attributes, +which includes : > + > + - What the NIC can do through the :c:member:`supported` field > + - What the Link Partner advertises through :c:member:`lp_advertising` > + - Which features we're advertising through :c:member:`advertising` > + > +We also have info about the number of lanes and the PORT type. These > settings +are built by aggregating together information reported by various > devices that +are sitting on the link : > + > + - The NIC itself, through the :c:member:`get_link_ksettings` callback > + - Precise information from the MAC and PCS by using phylink in the MAC > driver + - Information reported by the PHY device > + - Information reported by an SFP module (which can itself include a PHY) > + > +This model however starts showing its limitations when we consider devices > that +have more than one media interface. In such a case, only information > about the +actively used interface is reported, and it's not possible to > know what the +other interfaces can do. In fact, we have very few > information about whether or +not there are any other media interfaces. maybe "hints" instead of "information"? > + > +The goal of the phy_port representation is to provide a way of representing > a +physical interface of a NIC, regardless of what is driving the port (NIC > through +a firmware, SFP module, Ethernet PHY). > + > +Multi-port interfaces examples > +============================== > + > +Several cases of multi-interface NICs have been observed so far : > + > +Internal MII Mux:: > + > + +------------------+ > + | SoC | > + | +-----+ | +-----+ > + | +-----+ | |-------------| PHY | > + | | MAC |--| Mux | | +-----+ +-----+ > + | +-----+ | |-----| SFP | > + | +-----+ | +-----+ > + +------------------+ > + > +Internal Mux with internal PHY:: > + > + +------------------------+ > + | SoC | > + | +-----+ +-----+ > + | +-----+ | |-| PHY | > + | | MAC |--| Mux | +-----+ +-----+ > + | +-----+ | |-----------| SFP | > + | +-----+ | +-----+ > + +------------------------+ > + > +External Mux:: > + > + +---------+ > + | SoC | +-----+ +-----+ > + | | | |--| PHY | > + | +-----+ | | | +-----+ > + | | MAC |----| Mux | +-----+ > + | +-----+ | | |--| PHY | > + | | +-----+ +-----+ > + | | | > + | GPIO-------+ > + +---------+ > + > +Double-port PHY:: > + > + +---------+ > + | SoC | +-----+ > + | | | |--- RJ45 > + | +-----+ | | | > + | | MAC |---| PHY | +-----+ > + | +-----+ | | |---| SFP | > + +---------+ +-----+ +-----+ > + > +phy_port aims at providing a path to support all the above topologies, by > +representing the media interfaces in a way that's agnostic to what's > driving +the interface. the struct phy_port object has its own set of s/the/The > callback ops, and +will eventually be able to report its own ksettings:: > + > + _____ +------+ > + ( )-----| Port | > + +-----+ ( ) +------+ > + | MAC |--( ??? ) > + +-----+ ( ) +------+ > + (_____)-----| Port | > + +------+ > + > +Next steps > +========== > + > +As of writing this documentation, only ports controlled by PHY devices are > +supported. The next steps will be to add the Netlink API to expose these > +to userspace and add support for raw ports (controlled by some firmware, > and directly +managed by the NIC driver). > + > +Another parallel task is the introduction of a MII muxing framework to I'd suggest "related" instead of "parallel". > allow the +control of non-PHY driver multi-port setups. > diff --git a/MAINTAINERS b/MAINTAINERS > index b155eec69552..211a6ba50166 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -8781,6 +8781,7 @@ > F: Documentation/devicetree/bindings/net/ethernet-connector.yaml > F: Documentation/devicetree/bindings/net/ethernet-phy.yaml > F: Documentation/devicetree/bindings/net/mdio* > F: Documentation/devicetree/bindings/net/qca,ar803x.yaml > +F: Documentation/networking/phy-port.rst > F: Documentation/networking/phy.rst > F: drivers/net/mdio/ > F: drivers/net/mdio/acpi_mdio.c Thanks! -- Romain Gantois, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --nextPart5568568.Sb9uPGUboI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEYFZBShRwOvLlRRy+3R9U/FLj284FAmghvbwACgkQ3R9U/FLj 2871DxAAn7+aUBy4seGGJo1GygKlbkXBHGDeR8bvU6xiVEX4iQCpM5/8/fSk413V VaVRwapjz/rEK7gx0fKzUw2EmEUSBkSSW4SPocPH7bEYREdo5y0f1xgTp7PXD1Yj osDFFsXo9S3rsDCvCBMDb73s60/EZsDp/gcw+xAdhZPBjDine0wArdRPTmWmJDsc OJTM9eMwHYxj03b0j+3ZytXWTQ8ku2I3zeT+RD1M/XWTguJ/h0QYJnn9O1OU6kLh uxgtP8lSrFAz/hPvIRa7u4TG73e4Dfm0/cP4liGgDFJEofnxVSU7BKuFT5K/PDW/ +H3aRHQAPfuNNrzE/j6Ek7KMYfFa3vGbM3kD0lnhMGoKD9s9vhLmOxG/b3+8fiQl KQX7UMQfKHEfmMz8HyTG3dX5vplbpR4MlQYDoub9Icu3AYJO/uRKw5X6NaJT89yT aIEeMjzxKTxrTryx7aQ8T8IWzQF58mj9IPao4qHXSm+nP0KWMbZMrNP3KkFvTNSI RPjPzPlBYD1DT5o7Nt4izr8c+b9GCJQDdFxkAfjmisjvxljVSL1yTaFVvpgcClSe 6FGRHENouJJrH+nadqpZKNmzkLDDoQoi1dfzq4Dx7KAxul3gqwh+lZ6QOBCwH/o0 Hax/Lqkzq0+JXynFI3fTL2/czWHZUzzkoZdkQbxQsS2CSXgHcC4= =G59j -----END PGP SIGNATURE----- --nextPart5568568.Sb9uPGUboI--