[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d7090506-68f9-4935-a0e9-b3143362b838@lunn.ch>
Date: Tue, 21 Nov 2023 02:08:37 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, thomas.petazzoni@...tlin.com,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
Russell King <linux@...linux.org.uk>,
linux-arm-kernel@...ts.infradead.org,
Christophe Leroy <christophe.leroy@...roup.eu>,
Herve Codina <herve.codina@...tlin.com>,
Florian Fainelli <f.fainelli@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Köry Maincent <kory.maincent@...tlin.com>,
Jesse Brandeburg <jesse.brandeburg@...el.com>
Subject: Re: [RFC PATCH net-next v2 05/10] net: ethtool: Allow passing a phy
index for some commands
> + 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
Powered by blists - more mailing lists