Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2815581rdb; Tue, 12 Sep 2023 13:00:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2l4xRw698khNOSehi7RZlTqV9HGTr3IA2PSmD8h9rKv2HRmc5YzGa0sEPUX36MyATd0F7 X-Received: by 2002:a05:6871:1d0:b0:1d1:3a58:14a5 with SMTP id q16-20020a05687101d000b001d13a5814a5mr542630oad.25.1694548833292; Tue, 12 Sep 2023 13:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694548833; cv=none; d=google.com; s=arc-20160816; b=z444okiJ/JKgGpn9vHrWr9ENVs1TruobPr63MMkibUDzxSs8TXGDkh95a8dAiSvANr lvGLY+TkadWiIHpE1mhxM5rOTmE6qVHnJxA5R3kHB1ezH5BqNmwkzHQnRTfZaOYflA0N JgaBQBHw+V8AnG1sAucufzQ0BfSghTKVN49Po9EcUcR9N77OGMLnHvRf5wwFY09m6EHg CCSM//YXlaR1j/6flQCJsRdN70WfMDy3JBQ1cp18SH6llvVBN8VHliddckZZZETKJ5QG 8TTyb+13yrCcPSW3WkOAL4IQq4mYwU+anGpRIqmOGwxbh3YW2AwDZ5x1g4WMkO0A+Uws nbsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MbmemHOiL4503k1+q5Q+aOQe0n7WNLQEFpWZxb7eX5U=; fh=Da7/RkrGd3SlMacWT+qRMzIdj1SR6OdmoKOA/UCduCU=; b=y/XLEK+eRg195asXa9qrxAArETAFXNLKDL0+b3p+H2gm1b4EBbCY/A7oDNopQNpDER hZuW/kVSj2ehDoF0JjRBWNV51Zt3O2V3hCCJTWYBIc/rt7dFRXnqx+I9sByT5D5JGqe/ 3zFQ5oCo9DNAhev68D/Tgqumanft6oXIRJaIxVi6TjBHDc9GJ34ZQzbwJR4cKptD2Rk4 5Tndd2mdUi/MdUuise7g0EkjQZ7rkoy1R2KnvXAWwtD/LY/Zxcm3Le8h/2PZHCxj93e7 GbaELIHCSfEm3R/kzwxlwvtTk8JgPKf3MYb9X9MFTfK23RYDxjqHyjzCb1fXislLVcad nMUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="Mz/tA2oa"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id e124-20020a636982000000b005702257f32esi8168143pgc.185.2023.09.12.13.00.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 13:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="Mz/tA2oa"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 506E2819BB5D; Tue, 12 Sep 2023 09:16:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234544AbjILQQA (ORCPT + 99 others); Tue, 12 Sep 2023 12:16:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233918AbjILQP7 (ORCPT ); Tue, 12 Sep 2023 12:15:59 -0400 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230907092407.647139-2-maxime.chevallier@bootlin.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 12 Sep 2023 09:16:06 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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