Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2141402rdb; Tue, 3 Oct 2023 11:26:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDMC2+YZpC5/aM891jg/g51uMs/IVYWn+h57prEEsQHyxMQD5chiVWVyd7rUeg2J0gu+/o X-Received: by 2002:a05:6a20:1453:b0:14e:b4d5:782d with SMTP id a19-20020a056a20145300b0014eb4d5782dmr296645pzi.2.1696357586043; Tue, 03 Oct 2023 11:26:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696357586; cv=none; d=google.com; s=arc-20160816; b=Ec5jdW7Vf9YsfAogQiZHwGuNs8wPT1IQcfWwfbVIZ04dXkd92y9XaNsQUeokeduppf okC5AFWr9n0ZgsrwYBvCmvXqrjXxxiiMpQjw4hEjcT3GR8i/KerkALkt2vGzv1yPZUL3 7BoezEUCE6aFVXLme5/6SC/3uiIQ2WERa8FR1OmAo6BbOh9/0a8mgRxnAvMg2F2sxYFG roEc4mQ/5Zbjk0MvQOBp6ko/5UHBCPcfm1hs1KKBCATXCJp53hxE/RiiZXqtAAKiPQfI umyN99EWPM8gu9FxCPZm0wrAOI4935p/cLgGwR2GGfB44YkAEbtXLvF71uNK2lrI2R+C LmqQ== 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=8kSMH9mFqlEMXMzJocJNXqDhfdneaQ4QxIN0eEXIpF4=; fh=TcGre2mB5HKBH0ejK6lXULaQ8gOitHDbKvYZ4EHV/fw=; b=lpiq26OigjN6kLRjG5fXX2T6F1Gd38HD7x7a7VBr/oDvYS3DSBqOU4lviYx2o7fR7D 8YW2A063/khiV8wC8wlSwMOVzlDvLm7Mb+jFT0CFq7I5TcT9Kjt0ZWo0Zp40xvbKgYgI 0N1zdjEdR4YvdXrMCAG3sOXpDfeRh+slx5heyeB4uiZ/kM/fSjU+WckVwJbDMFNVJy8O 9JCa9psCs7DidZqm9BaRtLz2zLw0Z6DUDMq0W3Boqvc23URGq+RfCuN3Hh/5MpfUf6cN ivXpP5iazEIO0BhjYSY7Dt7UjJ2yIxTT7rdfkEtimZNGR79ShCTjYRsUod9LqurvIBIr o6AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=iWYRx9uj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i1-20020a170902c94100b001bba7713547si2115310pla.151.2023.10.03.11.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 11:26:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=iWYRx9uj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 23DB981A1EB6; Tue, 3 Oct 2023 11:26:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237825AbjJCS0P (ORCPT + 99 others); Tue, 3 Oct 2023 14:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231592AbjJCS0N (ORCPT ); Tue, 3 Oct 2023 14:26:13 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EBD983; Tue, 3 Oct 2023 11:26:09 -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=8kSMH9mFqlEMXMzJocJNXqDhfdneaQ4QxIN0eEXIpF4=; b=iWYRx9ujoGpS1M3bid/rdR2a74 laVYS2fLJAupCJS4QXe4dPW/AVtfuKeAb/V3sgOeD5MwYWAK1HVGT1v6oNhIt6dwz07zZ7ARAZcMy ul60nlEbBP3OODvmQgr2HeM3hJVBax6iAt/vF/k7ycEiZ+R71wVNaR6knoFXd2QRgbA0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qnk5p-00899E-74; Tue, 03 Oct 2023 20:26:01 +0200 Date: Tue, 3 Oct 2023 20:26:01 +0200 From: Andrew Lunn To: Jakub Kicinski Cc: Maxime Chevallier , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, 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 6/7] net: ethtool: add a netlink command to get PHY information Message-ID: References: <20230907092407.647139-1-maxime.chevallier@bootlin.com> <20230907092407.647139-7-maxime.chevallier@bootlin.com> <20230908084606.5707e1b1@kernel.org> <20230914113613.54fe125c@fedora> <20231003065535.34a3a4e0@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003065535.34a3a4e0@kernel.org> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 03 Oct 2023 11:26:25 -0700 (PDT) On Tue, Oct 03, 2023 at 06:55:35AM -0700, Jakub Kicinski wrote: > On Thu, 14 Sep 2023 11:36:13 +0200 Maxime Chevallier wrote: > > I'm currently implementing this, and I was wondering if it could be > > worth it to include a pointer to struct phy_device directly in > > ethnl_req_info. > > > > This would share the logic for all netlink commands that target a > > phy_device : > > > > - plca > > - pse-pd > > - cabletest > > - other future commands > > > > Do you see this as acceptable ? we would grab the phy_device that > > matches the passed phy_index in the request, and if none is specified, > > we default to dev->phydev. > > You may need to be careful with that. It could work in practice but > the req_info is parsed without holding any locks, IIRC. And there > may also be some interplay between PHY state and ethnl_ops_begin(). We also need to ensure it is totally optional. There are MAC drivers which reinvent the wheel in firmware. They can have multiple PHYs, or PHY and SFP in parallel etc. All the typologies which you are considering for phylink. Ideally we want the uAPI to work for everybody, not just phylink. Its not our problem how said firmware actually works, and what additional wheels they need to re-implement, but we should try not to block them. Andrew