From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8066BC61DF7 for ; Thu, 23 Nov 2023 13:37:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tUE2DB9/5GqyCWwNznrNeNtbh89HOiWVOJURn5k3VRY=; b=jEL9aIlL3kaLlk CQjoj7/uOn0jMFs5AaBWOyh4zlg6fwkhVUoLPvXVzXRrt5ov+kNe8H9gfhnN8zOw2mL9TwCtH74QR LhooEY0rQNdfMwAkeCou3/AbVFEOuGJL6UXTNb3hIINQU7ZH3D+eXWG/7UkWOMNv9QuRdf3VAU7mQ 0/zR8oDojiRTntUibIJD2YYjaWopDT1Gb9rjtqNL6J0ISf/VtAmMT46QBJREEnDqZ6Tv4QlOBvHEv pm3K6NJePn4fZfDxTSF77CLhtzUsX4ZsuTiezwuCetICaR15QeR5gd2DBqxlCksVktOon8FRBYOtp l5xT//rk1jsIAVvwDLXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r69t3-004u2I-0y; Thu, 23 Nov 2023 13:36:57 +0000 Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r69t0-004u1J-1L for linux-arm-kernel@lists.infradead.org; Thu, 23 Nov 2023 13:36:55 +0000 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 X-GND-Sasl: maxime.chevallier@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231123_053654_596879_211A6ECF X-CRM114-Status: GOOD ( 14.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel