netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Russell King" <linux@armlinux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	"Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"Herve Codina" <herve.codina@bootlin.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	"Köry Maincent" <kory.maincent@bootlin.com>,
	"Jesse Brandeburg" <jesse.brandeburg@intel.com>
Subject: Re: [RFC PATCH net-next v2 05/10] net: ethtool: Allow passing a phy index for some commands
Date: Thu, 23 Nov 2023 14:36:45 +0100	[thread overview]
Message-ID: <20231123143645.0202d6b9@device.home> (raw)
In-Reply-To: <d7090506-68f9-4935-a0e9-b3143362b838@lunn.ch>

On Tue, 21 Nov 2023 02:08:37 +0100
Andrew Lunn <andrew@lunn.ch> 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


  reply	other threads:[~2023-11-23 13:36 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17 16:23 [RFC PATCH net-next v2 00/10] Introduce PHY listing and link_topology tracking Maxime Chevallier
2023-11-17 16:23 ` [RFC PATCH net-next v2 01/10] net: phy: Introduce ethernet link topology representation Maxime Chevallier
2023-11-21  0:24   ` Andrew Lunn
2023-11-23 13:34     ` Maxime Chevallier
2023-11-23 13:44     ` Maxime Chevallier
2023-11-17 16:23 ` [RFC PATCH net-next v2 02/10] net: sfp: pass the phy_device when disconnecting an sfp module's PHY Maxime Chevallier
2023-11-17 16:23 ` [RFC PATCH net-next v2 03/10] net: phy: add helpers to handle sfp phy connect/disconnect Maxime Chevallier
2023-11-21  0:57   ` Andrew Lunn
2023-11-21 10:08     ` Russell King (Oracle)
2023-11-21 14:35       ` Andrew Lunn
2023-11-17 16:23 ` [RFC PATCH net-next v2 04/10] net: sfp: Add helper to return the SFP bus name Maxime Chevallier
2023-11-21  1:00   ` Andrew Lunn
2023-11-21 10:20     ` Russell King (Oracle)
2023-11-23 13:35       ` Maxime Chevallier
2023-11-17 16:23 ` [RFC PATCH net-next v2 05/10] net: ethtool: Allow passing a phy index for some commands Maxime Chevallier
2023-11-21  1:08   ` Andrew Lunn
2023-11-23 13:36     ` Maxime Chevallier [this message]
2023-11-17 16:23 ` [RFC PATCH net-next v2 06/10] net: ethtool: Introduce a command to list PHYs on an interface Maxime Chevallier
2023-11-21  1:34   ` Andrew Lunn
2023-11-21  1:40   ` Andrew Lunn
2023-11-23 13:40     ` Maxime Chevallier
2023-11-17 16:23 ` [RFC PATCH net-next v2 07/10] net: ethtool: plca: Target the command to the requested PHY Maxime Chevallier
2023-11-17 16:23 ` [RFC PATCH net-next v2 08/10] net: ethtool: pse-pd: " Maxime Chevallier
2023-11-17 16:23 ` [RFC PATCH net-next v2 09/10] net: ethtool: cable-test: " Maxime Chevallier
2023-11-17 16:23 ` [RFC PATCH net-next v2 10/10] net: ethtool: strset: Allow querying phy stats by index Maxime Chevallier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231123143645.0202d6b9@device.home \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=christophe.leroy@csgroup.eu \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=herve.codina@bootlin.com \
    --cc=hkallweit1@gmail.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).