[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201012164006.fbigacnexy3dnvzq@lion.mk-sys.cz>
Date: Mon, 12 Oct 2020 18:40:06 +0200
From: Michal Kubecek <mkubecek@...e.cz>
To: Danielle Ratson <danieller@...dia.com>
Cc: Jakub Kicinski <kuba@...nel.org>, Ido Schimmel <idosch@...sch.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
Jiri Pirko <jiri@...dia.com>,
"andrew@...n.ch" <andrew@...n.ch>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
mlxsw <mlxsw@...dia.com>, Ido Schimmel <idosch@...dia.com>,
"johannes@...solutions.net" <johannes@...solutions.net>
Subject: Re: [PATCH net-next 1/6] ethtool: Extend link modes settings uAPI
with lanes
On Mon, Oct 12, 2020 at 03:33:45PM +0000, Danielle Ratson wrote:
> >
> > > +/* Lanes, 1, 2, 4 or 8. */
> > > +#define ETHTOOL_LANES_1 1
> > > +#define ETHTOOL_LANES_2 2
> > > +#define ETHTOOL_LANES_4 4
> > > +#define ETHTOOL_LANES_8 8
> >
> > Not an extremely useful set of defines, not sure Michal would agree.
I don't see much use for them either. Such defines or enums make sense
when the numbers represent some values which have symbolic names but
these values only represent number of lanes so a number is IMHO
sufficient.
> > > +#define ETHTOOL_LANES_UNKNOWN 0
> >
> > > struct link_mode_info {
> > > int speed;
> > > + int lanes;
> >
> > why signed?
>
> I have aligned it to the speed.
For speed, signed type was used mostly because SPEED_UNKNOWN is defined
as -1 (even if it's cast to u32 in most places), I don't think there is
a reason to use a signed type.
Michal
Powered by blists - more mailing lists