Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp342699rdh; Thu, 23 Nov 2023 05:37:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IGDGxq77RSontJS7oBtZVlZlGwy/k1uWkBiygs852nGiXfd9O7NzU+Hg8D1YzSoZ/aJEzo4 X-Received: by 2002:a17:90b:3b51:b0:280:2c16:2186 with SMTP id ot17-20020a17090b3b5100b002802c162186mr5843738pjb.30.1700746655174; Thu, 23 Nov 2023 05:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700746655; cv=none; d=google.com; s=arc-20160816; b=MFnlpuWdKBGYvkBWAZHS7IgsrU50LGTWmM6DNVnGwZh5q+VXmKPelnTWeYu0nJStOn 8l+SuNRTQ06xkFxn8G8tmfzZCPHyyeRgmzB3UUzwJPnqX7ixhjpyAE42RxtMAZsYkG29 bvZG8HLK8E4zP2xr62KqEqHHaCyDOeD402fvzdirxneg77wb/L6WPWBSe3juJxyVs0yG yFa4EiO35Ld/CaHYFhJLtQlagm7dw63217ADVYYs5sbEmD4cTzvKsB0Pn3WaXiHvvWYP 4x8LniDsu9kqII3pfmrOe86IRNvy3G8XMnIMi/nqdzmShMW12i6Ydb5yngudApB2ZsWf hcsA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=faoI2KwHEPy1FqnMSXrUntxVGy1KjNLj5WWRWRO+gvQ=; fh=IMYGoU7jS3HaS5iEdQiyiDhnAR9nxxNosD4SnzXeWBc=; b=at2UG+HyqMYuxS3Xd5MH3sc2VAgXhK59xeAJmZeT9+zCJG1T5xhXShu/ofIn6nA+/G v87eFPgNX0g7GM5efspVKd2tibR9xD34hXELbKiEG0iXaDvJ/fLzvo2DJUM8kTzUytb6 LAVBLXwkzkScNByWCQrtiaCKwHmrMt7Pc9SI0RClByKkWs16loJl4WUVlGeUgBu3yHaH g5UVKU/zGKNjLDnSi2ruNDWb9Yr23m+IMVPIQLh5b0OBNz7KufEJRSMFUw5weOYr7Sfz XubSNrBQEROqUd9HUDG3nvAGL71ieKNMHck/4LEqijtXA7FaRti18+NH+sS429EnGxKz PpEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bPFoM0lz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id g7-20020a17090a4b0700b002851017a187si1286763pjh.162.2023.11.23.05.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 05:37:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bPFoM0lz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9E18A8087516; Thu, 23 Nov 2023 05:37:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345592AbjKWNg4 (ORCPT + 99 others); Thu, 23 Nov 2023 08:36:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345590AbjKWNgt (ORCPT ); Thu, 23 Nov 2023 08:36:49 -0500 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2392F10F8; Thu, 23 Nov 2023 05:36:49 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D1DD8FF818; Thu, 23 Nov 2023 13:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1700746608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=faoI2KwHEPy1FqnMSXrUntxVGy1KjNLj5WWRWRO+gvQ=; b=bPFoM0lzHYnDnXRN6XvN1sryMr7AxcewhuY4AabxZx0mJfSD8dwv6/t9Web+WJBAmy1ufL T3xtRy7zLsvtP2jsjmGLUPucmKJIcs2fQrNXQCAKHrmwQnbmpsXjkRXp+pyznwUO/6LF52 t7+HsdGVYm2mz734Iog2sMZ5AmxFk5Xkh2ArfBmwsPf5dstN7Yf8wf3rdHekvzP7BmRpvJ 7WPde8hR9Kmm3xfZAmY0OfXR6rfuJuyJH1R2R5gc0ijqTz4MSlFz26k8LQFLXzQ6FxY5kK WmKFiBSRGtNHYYiQ5bpoT+4R/lWt0nlp9xRif+4MzQ/PNkBbm0aqeFbmvgoCvQ== Date: Thu, 23 Nov 2023 14:36:45 +0100 From: Maxime Chevallier To: Andrew Lunn 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 , =?UTF-8?B?S8O2cnk=?= Maincent , Jesse Brandeburg Subject: Re: [RFC PATCH net-next v2 05/10] net: ethtool: Allow passing a phy index for some commands Message-ID: <20231123143645.0202d6b9@device.home> In-Reply-To: References: <20231117162323.626979-1-maxime.chevallier@bootlin.com> <20231117162323.626979-6-maxime.chevallier@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: 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 pete.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 (pete.vger.email [0.0.0.0]); Thu, 23 Nov 2023 05:37:32 -0800 (PST) On Tue, 21 Nov 2023 02:08:37 +0100 Andrew Lunn wrote: > > + 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. Indeed I messed-up the typing for that variable, shame as it's the core of that series :( I'll get it right for the next version. > > > + 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. Yep I'll squeeze the documentation bit here. Thanks for the review, Maxime > Andrew