lkml.org 
[lkml]   [2023]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH net-next v2 05/10] net: ethtool: Allow passing a phy index for some commands
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

\
 
 \ /
  Last update: 2023-11-23 14:37    [W:1.017 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site