Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp90864rdf; Mon, 20 Nov 2023 17:36:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPclT4u4FAwRJyyY0q7/ti7OAWeBge8Oi8kSUjlQXd1uS40N2oWaOrwhkl3JN4aEL9kRbu X-Received: by 2002:a05:6808:d4d:b0:3ad:f5b3:844c with SMTP id w13-20020a0568080d4d00b003adf5b3844cmr11456183oik.18.1700530605537; Mon, 20 Nov 2023 17:36:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700530605; cv=none; d=google.com; s=arc-20160816; b=oY8jGZgum7EC1gIQrJMdkywaP8G+VLHFWRz2yBXHE0z1B4EytMp+rIShT6hH8jOx9D dO0/5Rn6mDC6Ig8bCigN8CgylzBYoYUcrr4mZNVSTlUjo7xgfM6b1L+Df4r7A3FBmZ/3 0vrKSMqrahsNNHIaROoOmVW8ZigHqDrQ4msBaqPDHbfH0EpKHdKbZID6IOG5hQStIJfw DLbaOIBct1mLnn+yH3get3a0u85+bvSWWHdZu6JbA8CNv4hTSYUe4n0mQUdMRDpPREsO jGfEuDBteZC4jx3LGef8S7n3ZMlRyjv1bqLy9S6PRxyH6QpiDI0zRMvQ5rsUsfmwu7VT kDiw== 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=Am/1to/V8gkq755Qh9tO2gkpYjOcdKhlEYTmnGsC1fw=; fh=C0TfBJhgfV5KqzbS/KnZmKykOYUXFy9xkb3FDuNAbrk=; b=yJpvCpDezOJFxCg4nuh+vCOPOuAYAZFpf6Vo/sHy5KrYVc9aNzq6NpN3Ga9Oo6W1Vt u2V6pALVn47ddZhYnsWUQk9cXAU096EDvsKrCQPZHpUmagJI7++sjxH1gWivxPM+Yi8j CeEu5WosPDZCLAWd/zn2SH4xwgEnENTzZsX1XkbRhEQwhEi5HbE7IbRgbIiYJHiasaXu UgSOrVLJNNmi5Xno6H2EYIBbufHbURSgpjPLcrE4wlHYeTxvhwqocR9qngn5hJgeRrI7 zYf+lcYxHtNRJ136R0KlDg5AyuJdXanu1ehZiIgZ/UO5D4q3s1HqP6phkLV2Pcv9/9Ho 0+VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=ynCgLiPM; 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 f17-20020a631f11000000b005c14fc66ccasi8853238pgf.370.2023.11.20.17.36.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 17:36:45 -0800 (PST) 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=ynCgLiPM; 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 9CE4A80873A8; Mon, 20 Nov 2023 17:35:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233094AbjKUBfR (ORCPT + 99 others); Mon, 20 Nov 2023 20:35:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233060AbjKUBfM (ORCPT ); Mon, 20 Nov 2023 20:35:12 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF6FD10CE; Mon, 20 Nov 2023 17:34:53 -0800 (PST) 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=Am/1to/V8gkq755Qh9tO2gkpYjOcdKhlEYTmnGsC1fw=; b=ynCgLiPMN+NFUNWiq84dU/mY51 2JQeUI/TsS98fJ3QddRjeKyF5NQpjXlYkJhHw8LZHPnHnJt311d6eVQawVRZlQ4u/G+A40iXdFy5B ToH5wvAyxJQm3oSf7EN38KERrYFpeP4syJJa2R5e7bUznCnEa9KuRaQPprbj+QjjiGJU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r5Ff6-000i5g-W8; Tue, 21 Nov 2023 02:34:49 +0100 Date: Tue, 21 Nov 2023 02:34:48 +0100 From: Andrew Lunn To: Maxime Chevallier Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Jakub Kicinski , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?iso-8859-1?Q?K=F6ry?= Maincent , Jesse Brandeburg Subject: Re: [RFC PATCH net-next v2 06/10] net: ethtool: Introduce a command to list PHYs on an interface Message-ID: References: <20231117162323.626979-1-maxime.chevallier@bootlin.com> <20231117162323.626979-7-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231117162323.626979-7-maxime.chevallier@bootlin.com> 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 17:35:58 -0800 (PST) > diff --git a/Documentation/networking/ethtool-netlink.rst b/Documentation/networking/ethtool-netlink.rst > index 2540c70952ff..29ef675f45c0 100644 > --- a/Documentation/networking/ethtool-netlink.rst > +++ b/Documentation/networking/ethtool-netlink.rst > @@ -57,6 +57,7 @@ Structure of this header is > ``ETHTOOL_A_HEADER_DEV_INDEX`` u32 device ifindex > ``ETHTOOL_A_HEADER_DEV_NAME`` string device name > ``ETHTOOL_A_HEADER_FLAGS`` u32 flags common for all requests > + ``ETHTOOL_A_HEADER_PHY_INDEX`` u32 phy device index > ============================== ====== ============================= > > ``ETHTOOL_A_HEADER_DEV_INDEX`` and ``ETHTOOL_A_HEADER_DEV_NAME`` identify the > @@ -81,6 +82,12 @@ the behaviour is backward compatible, i.e. requests from old clients not aware > of the flag should be interpreted the way the client expects. A client must > not set flags it does not understand. > > +``ETHTOOL_A_HEADER_PHY_INDEX`` identify the ethernet PHY the message relates to. > +As there are numerous commands that are related to PHY configuration, and because > +we can have more than one PHY on the link, the PHY index can be passed in the > +request for the commands that needs it. It is however not mandatory, and if it > +is not passed for commands that target a PHY, the net_device.phydev pointer > +is used, as a fallback that keeps the legacy behaviour. O.K, you did document it :-) But i would make this part of the previous patch. > +Kernel response contents: > + > + ================================= ====== ========================== > + ``ETHTOOL_A_PHY_HEADER`` nested request header > + ``ETHTOOL_A_PHY_INDEX`` u32 the phy's unique index, that can > + be used for phy-specific requests > + ``ETHTOOL_A_PHY_DRVNAME`` string the phy driver name > + ``ETHTOOL_A_PHY_NAME`` string the phy device name > + ``ETHTOOL_A_PHY_UPSTREAM_TYPE`` u32 the type of device this phy is > + connected to > + ``ETHTOOL_A_PHY_UPSTREAM_PHY`` nested if the phy is connected to another > + phy, this nest contains info on > + that connection > + ``ETHTOOL_A_PHY_DOWNSTREAM_SFP_NAME`` string if the phy controls an sfp bus, > + the name of the sfp bus > + ``ETHTOOL_A_PHY_ID`` u32 the phy id if the phy is C22 Maybe a future extension. We could make phy_bus_match() set phydev->phy_id to the ID it matched to the driver when doing C45. We would then always have a value here. > --- a/include/linux/ethtool_netlink.h > +++ b/include/linux/ethtool_netlink.h > @@ -118,5 +118,10 @@ static inline bool ethtool_dev_mm_supported(struct net_device *dev) > return false; > } > > +int ethnl_phy_dumpit(struct sk_buff *skb, struct netlink_callback *cb) > +{ > + return -EOPNOTSUPP; > +} This is a header file, so should probably be static inline. Andrew