Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1975468rdb; Tue, 3 Oct 2023 06:56:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4M8/kvdlINi1Ji0sGuuJtqtQ1DMYV96Pfl9mBiY8zo99MtK6wY+RBAsKRSCB5N/Lobc67 X-Received: by 2002:a05:6808:181e:b0:3af:7908:7fa7 with SMTP id bh30-20020a056808181e00b003af79087fa7mr14469013oib.53.1696341368860; Tue, 03 Oct 2023 06:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696341368; cv=none; d=google.com; s=arc-20160816; b=mrWbxQnCmaGtkAdDv0++FsdevT+o13jAlE0wIoXvJzOUzbXbz7BGBH+w8GfyUZ0hq3 2WXn/AC33/wOl50Zv2+iDNIWJbfi5K7cJJSdJIYctePfW2BZQUZU4+HOw5qUM1xolYkg gOe8pCsvh2vHHa3rT3CCVOjUJ/7FG+bdAAz+M3H/R0Kv1aCSrPmrX4Hq9hIkrJlY7vAh 2SF5r0rsOno5hhB5GcynLmScsw3myEV7VIX1CcJNWIpYhhH1Hz0TMy/67uVtDMmNaufZ ApKCduHoj0Vtd2scRlLc7Ygs1cXk+MsDS/FlBi8divAxgGiWRtotPnhYRvQxm3lCuarM NqHw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XhMlBd7mz2pOcmln5t4WH7ofs/g7o/BdsUPg1i1A+Mg=; fh=1qoJiNuv7rW/+MVreLARwL+n0J+8hSH4W+HpyIk2D18=; b=ZLUTTMdkqkFVw45ZjPIPmCo5FxgEYx2TAQrobcPUAmbZAARFFTUAoMmZ4EHALfxOYT eCRo3PQgMi2o03yNfVr+wDUqAp2LgrCX9TWGsYxkEAsPYDy1khjbtWSwNGZ4yAhNZwgB GNeoH/603ZxpShDnEyu9gagkWl5LW49S1ydVmgdabr8z1lzv8z8f23cKK2f6ukULljSa TwOca5HcgCa6l2/nNIXAf2AG1XMz2nfkWYrmQfuE59leQ6JeFlOhzb+wnyP0nkISI3Hm 33nep1vyMP9Y7TQef7h26A0neTnRE1ecovg3ktdyC7+hQvp9TFFCVzhD0xtoW9q0KYXF KK8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KXpPCd6P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ie2-20020a17090b400200b0027660aac61asi9930765pjb.114.2023.10.03.06.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 06:56:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KXpPCd6P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 379D78148B9D; Tue, 3 Oct 2023 06:56:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236921AbjJCNzr (ORCPT + 99 others); Tue, 3 Oct 2023 09:55:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232068AbjJCNzq (ORCPT ); Tue, 3 Oct 2023 09:55:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06EF5B7 for ; Tue, 3 Oct 2023 06:55:43 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D4BCC433C9; Tue, 3 Oct 2023 13:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696341342; bh=RehqYHD6T9b4MqkacWDHh6XWfs2/J+zU49r0P9HOHb8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KXpPCd6PFi2WwOjKwlOgrSI7MBF5fd6TGaZIcrzCeCExQos1tKIg5hjcRx+z9rOu+ 7tOuJu2YCqW4ZHEUwCoSJyKDUyuk2eqdlU/qrHmSBx2bSJBiAkViz3ooZUKQFEbP6d kxEPB8YrkHzGm+DBjNVSwslBHxraQ7Uib6VjvUliQIwqwPTqCLcGgZGReHxMz5dUNR 79XWxmSmCRLQP/kosQh4SKpONj3URHPYbAkKXY1kw0gATD6ILvSNFLJT2uL/c8sHW3 fAG7WSzjJvUPF74EQ6hdCzbWL5ZNILVkqp/yz4yoqsD3bBN9bldBa8wRhbXxLsnG78 1QwGjzWuHZcWg== Date: Tue, 3 Oct 2023 06:55:35 -0700 From: Jakub Kicinski To: Maxime Chevallier Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , 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 6/7] net: ethtool: add a netlink command to get PHY information Message-ID: <20231003065535.34a3a4e0@kernel.org> In-Reply-To: <20230914113613.54fe125c@fedora> References: <20230907092407.647139-1-maxime.chevallier@bootlin.com> <20230907092407.647139-7-maxime.chevallier@bootlin.com> <20230908084606.5707e1b1@kernel.org> <20230914113613.54fe125c@fedora> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Tue, 03 Oct 2023 06:56:00 -0700 (PDT) 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. >=20 > This would share the logic for all netlink commands that target a > phy_device : >=20 > - plca > - pse-pd > - cabletest > - other future commands >=20 > 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=20 the req_info is parsed without holding any locks, IIRC. And there may also be some interplay between PHY state and ethnl_ops_begin(). =46rom netlink perspective putting the PHY info in the header nest makes perfect sense to me. Just not sure if you can actually get the object when the parsing happens or you'd need to just store the index and resolve it later? PHYLIB maintainers may be best at advising on the lifetime expectations for phys.. Sorry for the delayed response, #vacation.