> -----Original Message-----
> From: Michal Kubecek <mkube...@suse.cz>
> Sent: Thursday, November 26, 2020 11:08 PM
> To: Danielle Ratson <daniel...@nvidia.com>
> Cc: Jiri Pirko <j...@resnulli.us>; Andrew Lunn <and...@lunn.ch>; Jakub
> Kicinski <k...@kernel.org>; Ido Schimmel
> <ido...@idosch.org>; netdev@vger.kernel.org; da...@davemloft.net; Jiri Pirko
> <j...@nvidia.com>; f.faine...@gmail.com; mlxsw
> <ml...@nvidia.com>; Ido Schimmel <ido...@nvidia.com>;
> johan...@sipsolutions.net
> Subject: Re: [PATCH net-next 1/6] ethtool: Extend link modes settings uAPI
> with lanes
>
> On Wed, Nov 25, 2020 at 10:35:35AM +0000, Danielle Ratson wrote:
> > > > What do you think of passing the link modes you have suggested as
> > > > a bitmask, similar to "supported", that contains only one positive bit?
> > > > Something like that:
> >
> > Hi Michal,
> >
> > Thanks for your response.
> >
> > Actually what I said is not very accurate.
> > In ethtool, for speed 100G and 4 lanes for example, there are few link
> > modes that fits:
> > ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT
> > ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT
> > ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT
> > ETHTOOL_LINK_MODE_100000baseLR4_ER4_Full_BIT
> >
> > The difference is the media. And in the driver we shrink into one bit.
> > But maybe that makes passing a bitmask more sense, or am I missing
> > something?
>
> But as far as I understand, at any moment, only one of these will be actually
> in use so that's what the driver should report. Or is the
> problem that the driver cannot identify the media in use? (To be
> precise: by "cannot identify" I mean "it's not possible for the driver to
> find out", not "current code does not distinguish".)
>
> Michal
After more investigation, those are my conclusions:
We have two types of supported asics in the driver- one of them is able to
distinguish between the medias and the other one doesn't.
So in the first type I can send one bit as you requested from the driver to
ethtool but in the other one I can't.
The suggestions I have are:
1. Add a bit that for unknown media for each link (something like
ETHTOOL_LINK_MODE_100000unknown_Full_BIT). I am not sure it is even possible or
makes sense.
2. Pass the link mode as bitmap.
Do you see any other option?
Thanks.