From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 0A8CAA31 for ; Tue, 12 Sep 2023 16:15:55 +0000 (UTC) Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6297510EB; Tue, 12 Sep 2023 09:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=MbmemHOiL4503k1+q5Q+aOQe0n7WNLQEFpWZxb7eX5U=; b=Mz/tA2oaV/HlU/K+25MTg9vPTv a4MhTGzlxZ5alz7eH+NwcujVZQ9Kf67K1zS3sJA1MUSWJzHg2KnE2oLGVrMqQIFzSA1mP2q1w3Dp6 5Ef2WRXtWEy79knIQ2tzI9sul9ogJ/B4JIs7NwBxgFM66WveEptYgGwA/5+cdEUwPpOA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qg63M-006FNp-MK; Tue, 12 Sep 2023 18:15:52 +0200 Date: Tue, 12 Sep 2023 18:15:52 +0200 From: Andrew Lunn To: Maxime Chevallier Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski , Eric Dumazet , Paolo Abeni , Florian Fainelli , Heiner Kallweit , Russell King , Vladimir Oltean , Oleksij Rempel , =?iso-8859-1?Q?Nicol=F2?= Veronese , thomas.petazzoni@bootlin.com, Christophe Leroy Subject: Re: [RFC PATCH net-next 1/7] net: phy: introduce phy numbering and phy namespaces Message-ID: <63bd3a9c-dacd-47e3-a34c-6e2e6a304d6c@lunn.ch> References: <20230907092407.647139-1-maxime.chevallier@bootlin.com> <20230907092407.647139-2-maxime.chevallier@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230907092407.647139-2-maxime.chevallier@bootlin.com> On Thu, Sep 07, 2023 at 11:23:59AM +0200, Maxime Chevallier wrote: > Link topologies containing multiple network PHYs attached to the same > net_device can be found when using a PHY as a media converter for use > with an SFP connector, on which an SFP transceiver containing a PHY can > be used. > > With the current model, the transceiver's PHY can't be used for > operations such as cable testing, timestamping, macsec offload, etc. > > The reason being that most of the logic for these configuration, coming > from either ethtool netlink or ioctls tend to use netdev->phydev, which > in multi-phy systems will reference the PHY closest to the MAC. > > Introduce a numbering scheme allowing to enumerate PHY devices that > belong to any netdev, which can in turn allow userspace to take more > precise decisions with regard to each PHY's configuration. I think we need more than a number. Topology needs to be a core concept here, otherwise how is the user supposed to know which PHY to use cable test on, etc. However, it is not a simple problem. An SFP PHY should be the last in a chain. So you can infer something from that. When we start adding MII muxes, they will need to be part of the modal. Andrew