netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Kubecek <mkubecek@suse.cz>
To: Danielle Ratson <danieller@nvidia.com>
Cc: Jiri Pirko <jiri@resnulli.us>, Andrew Lunn <andrew@lunn.ch>,
	Jakub Kicinski <kuba@kernel.org>,
	Ido Schimmel <idosch@idosch.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Jiri Pirko <jiri@nvidia.com>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	mlxsw <mlxsw@nvidia.com>, Ido Schimmel <idosch@nvidia.com>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>
Subject: Re: [PATCH net-next 1/6] ethtool: Extend link modes settings uAPI with lanes
Date: Tue, 24 Nov 2020 23:12:25 +0100	[thread overview]
Message-ID: <20201124221225.6ae444gcl7npoazh@lion.mk-sys.cz> (raw)
In-Reply-To: <DM6PR12MB45163DF0113510194127C0ABD8FC0@DM6PR12MB4516.namprd12.prod.outlook.com>

On Mon, Nov 23, 2020 at 09:47:53AM +0000, Danielle Ratson wrote:
> 
> 
> > -----Original Message-----
> > From: Michal Kubecek <mkubecek@suse.cz>
> > Sent: Thursday, October 22, 2020 7:28 PM
> > To: Danielle Ratson <danieller@nvidia.com>
> > Cc: Jiri Pirko <jiri@resnulli.us>; Andrew Lunn <andrew@lunn.ch>; Jakub Kicinski <kuba@kernel.org>; Ido Schimmel
> > <idosch@idosch.org>; netdev@vger.kernel.org; davem@davemloft.net; Jiri Pirko <jiri@nvidia.com>; f.fainelli@gmail.com; mlxsw
> > <mlxsw@nvidia.com>; Ido Schimmel <idosch@nvidia.com>; johannes@sipsolutions.net
> > Subject: Re: [PATCH net-next 1/6] ethtool: Extend link modes settings uAPI with lanes
> > 
> > On Thu, Oct 22, 2020 at 06:15:48AM +0000, Danielle Ratson wrote:
> > > > -----Original Message-----
> > > > From: Michal Kubecek <mkubecek@suse.cz>
> > > > Sent: Wednesday, October 21, 2020 11:48 AM
> > > >
> > > > Ah, right, it does. But as you extend struct ethtool_link_ksettings
> > > > and drivers will need to be updated to provide this information,
> > > > wouldn't it be more useful to let the driver provide link mode in
> > > > use instead (and derive number of lanes from it)?
> > >
> > > This is the way it is done with the speed parameter, so I have aligned
> > > it to it. Why the lanes should be done differently comparing to the
> > > speed?
> > 
> > Speed and duplex have worked this way since ages and the interface was probably introduced back in times when combination of
> > speed and duplex was sufficient to identify the link mode. This is no longer the case and even adding number of lanes wouldn't make
> > the combination unique. So if we are going to extend the interface now and update drivers to provide extra information, I believe it
> > would be more useful to provide full information.
> > 
> > Michal
> 
> Hi Michal,
> 
> 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:
> 
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index afae2beacbc3..dd946c88daa3 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -127,6 +127,7 @@ struct ethtool_link_ksettings {
>                 __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
>                 __ETHTOOL_DECLARE_LINK_MODE_MASK(advertising);
>                 __ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising);
> +               __ETHTOOL_DECLARE_LINK_MODE_MASK(chosen);
>         } link_modes;
>         u32     lanes;
>  };
> 
> Do you have perhaps a better suggestion?

Not sure if it's better but as we know there is only one mode, we could
simply pass the index. We would still need to reserve a special value
for none/unknown but getting an index would make lookup easier.

> And the speed and duplex parameters should be removed from being
> passed like as well, right?

We cannot remove them from struct ethtool_link_settings and the ioctl
and netlink messages as those are part of UAPI and we have to preserve
backward compatibility. But drivers which provide link mode would not
need to fill speed and duplex in their ->get_link_ksettings() as the
common code could do that for them.

Michal

  reply	other threads:[~2020-11-24 22:12 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-10 15:41 [PATCH net-next 0/6] Support setting lanes via ethtool Ido Schimmel
2020-10-10 15:41 ` [PATCH net-next 1/6] ethtool: Extend link modes settings uAPI with lanes Ido Schimmel
2020-10-11 22:37   ` Jakub Kicinski
2020-10-12 15:33     ` Danielle Ratson
2020-10-12 15:58       ` Jakub Kicinski
2020-10-13 14:29         ` Danielle Ratson
2020-10-13 15:43           ` Jakub Kicinski
2020-10-16 22:15           ` Andrew Lunn
2020-10-19  7:19             ` Danielle Ratson
2020-10-19 11:04               ` Michal Kubecek
2020-10-19 12:26                 ` Jiri Pirko
2020-10-19 13:24                   ` Michal Kubecek
2020-10-20  7:39                     ` Danielle Ratson
2020-10-21  7:08                       ` Michal Kubecek
2020-10-21  7:20                         ` Danielle Ratson
2020-10-21  8:47                           ` Michal Kubecek
2020-10-22  6:15                             ` Danielle Ratson
2020-10-22 16:27                               ` Michal Kubecek
2020-11-23  9:47                                 ` Danielle Ratson
2020-11-24 22:12                                   ` Michal Kubecek [this message]
2020-11-25 10:35                                     ` Danielle Ratson
2020-11-26 21:07                                       ` Michal Kubecek
2020-12-01 17:22                                         ` Danielle Ratson
2020-12-02  0:52                                           ` Edwin Peer
2020-12-02  1:17                                           ` Edwin Peer
2020-10-19 12:24             ` Jiri Pirko
2020-10-19 12:38               ` Andrew Lunn
2020-10-12 16:40       ` Michal Kubecek
2020-10-12 19:10     ` Johannes Berg
2020-10-12 20:08       ` Jakub Kicinski
2020-10-12 17:03   ` Michal Kubecek
2020-11-19 20:38   ` Edwin Peer
2020-11-23  9:40     ` Jiri Pirko
2020-11-30 17:01       ` Edwin Peer
2020-11-30 17:14         ` Jiri Pirko
2020-11-30 18:00           ` Edwin Peer
2020-12-01 11:22             ` Jiri Pirko
2020-12-02  0:32               ` Edwin Peer
2020-12-02 10:09                 ` Jiri Pirko
2020-12-02 17:53                   ` Edwin Peer
2020-10-10 15:41 ` [PATCH net-next 2/6] ethtool: Expose the number of lanes in use Ido Schimmel
2020-10-10 15:41 ` [PATCH net-next 3/6] mlxsw: ethtool: Remove max lanes filtering Ido Schimmel
2020-10-10 15:41 ` [PATCH net-next 4/6] mlxsw: ethtool: Add support for setting lanes when autoneg is off Ido Schimmel
2020-10-10 15:41 ` [PATCH net-next 5/6] mlxsw: ethtool: Expose the number of lanes in use Ido Schimmel
2020-10-10 15:41 ` [PATCH net-next 6/6] net: selftests: Add lanes setting test Ido Schimmel

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=20201124221225.6ae444gcl7npoazh@lion.mk-sys.cz \
    --to=mkubecek@suse.cz \
    --cc=andrew@lunn.ch \
    --cc=danieller@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@idosch.org \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=jiri@resnulli.us \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=mlxsw@nvidia.com \
    --cc=netdev@vger.kernel.org \
    /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).