Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp217101rdb; Fri, 5 Jan 2024 07:40:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnMv0Pniyjzep+ZQw8wMwjEINbXB5vO+0klLr1iN3GJ7eeueuyYPBBIUPzBkBk96i5rXuz X-Received: by 2002:a05:6a00:1d10:b0:6d9:ac48:1ed4 with SMTP id a16-20020a056a001d1000b006d9ac481ed4mr2147688pfx.46.1704469208894; Fri, 05 Jan 2024 07:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704469208; cv=none; d=google.com; s=arc-20160816; b=x1VAIv3Wspcbr4SRvEbjBDA9Oz7C9RWOJU3sFL8dDz32anCbd0JdJMD8a0WgsqqJEJ mNBT1lz4PIUfwmjz4sFZDgL3ld6nQGTPeCi1qtjXjkBxLKXg5Z4CoKMtuWuv7Mn7AjJj WN2poEgx9ynj6vIDxJ1XDsFnXmc0d4y5+85ELE0C5F8ZTFi86PY1yLC6+/03gMBL0IWQ PjT0PkmkkRE7m9PvokTuAFD0eA32E32f3IdsBSydTyMEmB1fOTPNR9aL6hetKK12YpIU kJwH5kluwfck3aC9AKujqyNs3RnWXBF0FEQfsmS9RE6gJWnhkQ0KQirK3fBymwUuuIUU wcuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=yMQyEij3QDudwTZmNqBC8qWRNEVHkLzrIdrZZ1w/Olk=; fh=LC2oG+6w0geia0TeWcvO+8OTNxqJKljWfNfweFKsL20=; b=Oq9g/cmftMk0S91FNO2IHkbAXCqAULRKW7TWCFraXsLQaKDFE/Kt//dRRoqWCgPpjT CYTVwI6BzjfhZpnBe6cgBYlNlaxH/sYZ6lihvATTsB77LkYiTmxkgpw0rUTDoSUTmDGM jBE6iM/25SMzV4izh7JTD2dcIOfWuCs+af+iuLYScxL9y83Yx1vwJ30tyD0eoAPDII3Q 6XLicg/uQ80mcPRMt7CQrsP9/uwjApjemv6k3mg/xugt0i3SsEucP3llRXvwTupxNFpp DmYhAlmq5OPiEgngRbmV4954h17lyrQmCZHDeLA03ja1PyRPx+yGfPcxhlD8aX7lpnLG cHCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jrhu6jAu; spf=pass (google.com: domain of linux-kernel+bounces-18003-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18003-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n40-20020a056a000d6800b006d9b09dd050si1458564pfv.266.2024.01.05.07.40.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 07:40:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18003-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jrhu6jAu; spf=pass (google.com: domain of linux-kernel+bounces-18003-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18003-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 49F6C282A4F for ; Fri, 5 Jan 2024 15:39:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D16342E65A; Fri, 5 Jan 2024 15:39:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jrhu6jAu" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C8902E63A; Fri, 5 Jan 2024 15:39:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B461C433C8; Fri, 5 Jan 2024 15:39:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704469185; bh=Fd9R1t7XEMCEHJZB7WawIlb8aaIzMwLL0iD9yFevkzk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Jrhu6jAub+POaFLe7c9KTb6YFKz04dIwf3OvlE17GXqA9kPJawkiC4YX4hsIJMCR9 STdE147ItVPDswOTs3fe1gi40PP2u/UAQNn179K9mJJ2FjJwnh0BeVn9sO8LiMCBts nY9DZKgqk9R9XHgnS4cXbWOnwwWTK6kncWmCPHReOOpdCYQ+zBRwORflga8MtpqcCM Kz3x85pQcxeqahhfPp1ML/f+QgoC7qz+bZhlDnVruA/nX4DZiLPJgrRtaHF/svyFgV H3h8UsDzQFGI6hmMvui3se514N7mmdMs/yfUvL5/FNmNVQXy804B0b+bVfK6UGJXC/ Y5+P6fZefy1PQ== Date: Fri, 5 Jan 2024 07:39:43 -0800 From: Jakub Kicinski To: Maxime Chevallier Cc: davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?B?S8O2cnk=?= Maincent , Jesse Brandeburg , Jonathan Corbet , Marek =?UTF-8?B?QmVow7pu?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese , Simon Horman Subject: Re: [PATCH net-next v5 07/13] net: ethtool: Introduce a command to list PHYs on an interface Message-ID: <20240105073943.43fc2720@kernel.org> In-Reply-To: <20240105104311.03a35622@device-28.home> References: <20231221180047.1924733-1-maxime.chevallier@bootlin.com> <20231221180047.1924733-8-maxime.chevallier@bootlin.com> <20240104153401.08ff9809@kernel.org> <20240105104311.03a35622@device-28.home> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 5 Jan 2024 10:43:11 +0100 Maxime Chevallier wrote: > > > +static int ethnl_phy_parse_request(struct ethnl_req_info *req_base, > > > + struct nlattr **tb) > > > +{ > > > + struct phy_link_topology *topo = &req_base->dev->link_topo; > > > + struct phy_req_info *req_info = PHY_REQINFO(req_base); > > > + struct phy_device_node *pdn; > > > + > > > + if (!req_base->phydev) > > > + return 0; > > > > The PHY INDEX should probably be a required attr, with > > GENL_REQ_ATTR_CHECK()? Without phydev being specified > > what's the point? > > We can still have a phydev without passing a PHY INDEX, this would > report information on the netdev->phydev device, that can be helpful > for users to know which PHY is targeted by commands such as "ethtool > --cable-test eth0" when no PHY index is passed But req_base->phydev will be netdev->phydev if user didn't specify the index. Are you saying this is for commands which can operate on netdevs as well as on PHYs (e.g. "integrated NICs" which don't user phylib?)