Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2738795rdb; Tue, 12 Sep 2023 10:30:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFm9Jbb1B2neapPCnIWXdhXWJpUOhgI0QBrJGMhnZ+ed3r/EJ7jYezAERwvncK0G31zCN9c X-Received: by 2002:a05:6870:91cd:b0:1d5:9451:d50f with SMTP id c13-20020a05687091cd00b001d59451d50fmr167860oaf.31.1694539815371; Tue, 12 Sep 2023 10:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694539815; cv=none; d=google.com; s=arc-20160816; b=nljg9YnIZsZbIZPXg8ENbMQg373DDEdJXyzJLYibJE7VgDAUE4WtLdtvQzcUiWDqqp ZTUEsB6vV4aIDA0EaKR2aT1GvdeRCQAS67ELSeXTZZ0NaxxNHINtp24enklHw5QkC6YJ U8MAVpWxRDMTR529NCVcq3Rcecselvtcyy5NkzYJfCjCicJB7qOix6+GLhZhtmVY/ZO0 v7vlzKwefc6K2oLs6DB2fwlncpS7eDELIjiyHZgiw2zHb4xKQZqaLDG8bCg20Frnih/Q yfkRHNiFYreNn43z0Vp9zvxKR65eZ62FLUEOsR6Pzoanh58cjHA9bPIpOC+JH2Ln9hjj lyXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=+VOjAOePJcDHCndNePvN61Fv7OvE6NmezJq/v8uWj44=; fh=sihQZtyQ4qm49VELhgQyfkn/VHx/3nANz66eaR530Sg=; b=XJgD/5oSY9p1QKWAdaNNClnmIu5aXDawtCXzK3wWxhoVPeAfkbVzuEqPVFB1BEqRa8 hj/bSa+k9DQsrNTtJMixE6e2lkxTHWDaiM14H/Grwi+I1+zZ/lHkoAMdisfpuizXXoRi +JQz6LYVbKxnOmU/A/z/Zi5RRAAPRKwIRfoZofoSRbXMxYSh3I+Z30cQnmeCM02akfh5 uw/lUdoP3vdC/YfDSdIRcUgx8zM4t6x3D1+pDTG456mEtyQ3qZRzR9wZ8ECMWeqXSXmW 9oqcKpptfVM3ujG3DFyAKHwQ8BBSsapNznYiOoRs4aHmF5Rg1EnLNWemp0UE1g8YDnkJ QjEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jDlbsliq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id s5-20020a656905000000b0056bad7762c6si8358536pgq.226.2023.09.12.10.30.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 10:30:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=jDlbsliq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 9886A8056998; Tue, 12 Sep 2023 08:51:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231811AbjILPvr (ORCPT + 99 others); Tue, 12 Sep 2023 11:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230472AbjILPvq (ORCPT ); Tue, 12 Sep 2023 11:51:46 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B0DF10DE; Tue, 12 Sep 2023 08:51:42 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5D2B51BF20A; Tue, 12 Sep 2023 15:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1694533900; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+VOjAOePJcDHCndNePvN61Fv7OvE6NmezJq/v8uWj44=; b=jDlbsliqcYyLoi38muqLaHMIZVBfjXad48Y80sWmD5rJB3EOIy4nANTXOyrDJch05/Zy5T c29Cu3EoTcNkAkPUhT3M0+xjhh0Rnljd7Pf6xW52OVYSHmFhayofrMed1xdICQJQ1MkCPS XvjvNLns6S/2y7RJhcL2PVWa8/AZ0c0I7HlKG231LArVMuQv5qW1dIKg2HTTamEer9q9Oa 7WrymJafif/zGeWGfY5KJPd05IzM783IuH4iHVoOVEfhTgnHPaXw1hZrKP4YJr2ecE3/ae ov4NGoxA95XaP8QFnRdKm6AdOudDi4BZou+FX4MjRGtPkPCp0V5qSax6ZhdonQ== Date: Tue, 12 Sep 2023 17:51:38 +0200 From: Maxime Chevallier To: Andrew Lunn 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 , =?UTF-8?B?Tmljb2zDsg==?= Veronese , thomas.petazzoni@bootlin.com, Christophe Leroy Subject: Re: [RFC PATCH net-next 0/7] net: phy: introduce phy numbering Message-ID: <20230912175138.729ce011@fedora> In-Reply-To: References: <20230907092407.647139-1-maxime.chevallier@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: 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 (morse.vger.email [0.0.0.0]); Tue, 12 Sep 2023 08:51:48 -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 morse.vger.email Hello Andrew, On Tue, 12 Sep 2023 17:36:56 +0200 Andrew Lunn wrote: > > The PHY namespace is for now contained within struct net_device, meaning > > that PHYs that aren't related at all to any net_device wouldn't be > > numbered as of right now. The only case I identified is when a PHY sits > > between 2 DSA switches, but I don't know how relevant this is. > > It might be relevant for the CPU port of the switch. The SoC ethernet > with a PHY has its PHY associated to a netdev, and so it can be > managed. However, the CPU port does not have a netdev, so the PHY is a > bit homeless. Phylink gained the ability to manage PHYs which are not > associated to a netdev, so i think it can manage such a PHY. If not, > we assume the PHY is strapped to perform link up and autoneg on power > on, and otherwise leave it alone. I agree and my plan, although still a bit hazy, is to share the phy_ns between the netdev associated to the Ethernet MAC and the CPU dsa_port of the switch, as they are on the same link. We could grab infos on the PHYs connected to the port that way. Although the PHY isn't connected to the same MAC, it's part of the same link, so I think it would be OK to share the phy_ns. We already do something in that direction, which is the stats gathering on the CPU dsa port, which are reported alongside stats from the ethernet MAC. Would that be OK ? I haven't started the DSA part, I was waiting for review on the overall idea, but I tried to keep this into consideration hence the phy_ns notion :) Thanks, Maxime