Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp80165rdf; Mon, 20 Nov 2023 17:08:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IF3Sk+lCjKRiU+C54en8PZ7iSpgiOPigr20HQWUtZ7cEmvV6VC3GwAgT8chOWZYisB0aj04 X-Received: by 2002:a17:90b:3e85:b0:280:25ce:58f with SMTP id rj5-20020a17090b3e8500b0028025ce058fmr6968240pjb.43.1700528933154; Mon, 20 Nov 2023 17:08:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700528933; cv=none; d=google.com; s=arc-20160816; b=FhRzCvfmh3aNxlMu36oJGFlDSDkJZT8oq33uo1wBxbktwkyDAQURrXbrTegbRvk324 oBGWOzUFPZ81kAQbfp1FpOab6CEFVWKoXydiQg+wipFqoziPH7Iy9e0kq2niFQQkCTN2 obmhpTJhyO25oSBY/jvfer7JIJau6XQhrujxELBKSs/NElQeNMh8RZ6/jCI8QBF1I207 Bstu0pI9pYp6gKx+kbiOs+Hp1++VGO618fLj43vejkJxC4p4KPxIcd6t8GQ6XaqtVA6d sPkRa0+jp1g16M71VVDMyf1RBGCzkM2iGBMwFSd0Wua45X02XxZwH0VICi8nlu0KIhNM H+Mg== 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=Yf3IvbJ2ih8PxkhZnuDKG2nQzUN38q5GqA8aWK1dmiQ=; fh=C0TfBJhgfV5KqzbS/KnZmKykOYUXFy9xkb3FDuNAbrk=; b=v7IPhfYjJ1inCfSDpE1TIJjzZFv4xoSjjgoGEg51QQRchchI/8DybzPVkzzk1MrRJL imkvk4DMWxFQiYTg6R1qjzKS+8UayMAgWf/nOCk0tX8HYsX36Q6ZrZ7WSXUx5ClsBeke 3lAa2qbzh3ck46AiTul7JXx7pJsYX5Ev2gb00yrVCrueFwkhgggGugfvNhO5/K7lXsDQ Xyk85bP6f/Th46rQpv2S1C4P1TuQsVgI3juyPvFnFaftf4L0vn4Ea1TmgNU7i5+sqzzF cVGffKO8lxvBmxl5sWe+h9UdiAMQ4QtLWbSRMtkEVa3YKxSW+VLQrBqzPmbMBlEcNqyW WP6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=5MIvc56r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id nb17-20020a17090b35d100b0028514b41c88si5536728pjb.70.2023.11.20.17.08.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 17:08:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=5MIvc56r; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 8984880A43A5; Mon, 20 Nov 2023 17:08:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232792AbjKUBIp (ORCPT + 99 others); Mon, 20 Nov 2023 20:08:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbjKUBIn (ORCPT ); Mon, 20 Nov 2023 20:08:43 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E73CA2; Mon, 20 Nov 2023 17:08:40 -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=Yf3IvbJ2ih8PxkhZnuDKG2nQzUN38q5GqA8aWK1dmiQ=; b=5MIvc56rLJB6n1nEGpuodLC0uD AYXlzVaLRXcvoGTaNesRuW7cx2Lcpi3zLkE5uCJr+l0kiyF+PSmZM/8cbFbU+dXcbgOna4Lm8deWD L7A+jM5z5Mbr/SHCQatyJKkpcht9VSJsWijvRniFjzb/4G+KP3Gqz82wE078TF3cAzFc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r5FFl-000i0l-Gt; Tue, 21 Nov 2023 02:08:37 +0100 Date: Tue, 21 Nov 2023 02:08:37 +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 05/10] net: ethtool: Allow passing a phy index for some commands Message-ID: References: <20231117162323.626979-1-maxime.chevallier@bootlin.com> <20231117162323.626979-6-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231117162323.626979-6-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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 20 Nov 2023 17:08:50 -0800 (PST) > + if (dev) { > + if (tb[ETHTOOL_A_HEADER_PHY_INDEX]) { > + u32 phy_index = nla_get_u32(tb[ETHTOOL_A_HEADER_PHY_INDEX]); > + > + phydev = link_topo_get_phy(&dev->link_topo, phy_index); struct phy_device *link_topo_get_phy(struct link_topology *lt, int phyindex) We have u32 vs int here for phyindex. It would be good to have the same type everywhere. > + if (!phydev) { > + NL_SET_ERR_MSG_ATTR(extack, header, "no phy matches phy index"); > + return -EINVAL; > + } > + } else { > + /* If we need a PHY but no phy index is specified, fallback > + * to dev->phydev > + */ > + phydev = dev->phydev; > + } > + } > + > + req_info->phydev = phydev; Don't forget to update Documentation/networking/ethtool-netlink.rst. Andrew