netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Danielle Ratson <danieller@nvidia.com>
Cc: Danielle Ratson <danieller@mellanox.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	Jiri Pirko <jiri@nvidia.com>, "andrew@lunn.ch" <andrew@lunn.ch>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"mkubecek@suse.cz" <mkubecek@suse.cz>, mlxsw <mlxsw@nvidia.com>,
	Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net-next repost v2 1/7] ethtool: Extend link modes settings uAPI with lanes
Date: Mon, 11 Jan 2021 09:57:04 -0800	[thread overview]
Message-ID: <20210111095704.2f8622c6@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <DM6PR12MB451691B3A3E6EE51B87AD75FD8AB0@DM6PR12MB4516.namprd12.prod.outlook.com>

On Mon, 11 Jan 2021 14:00:20 +0000 Danielle Ratson wrote:
> > > @@ -420,6 +423,7 @@ struct ethtool_pause_stats {
> > >   * of the generic netdev features interface.
> > >   */
> > >  struct ethtool_ops {
> > > +	u32     capabilities;  
> > 
> > An appropriately named bitfield seems better. Alternatively maybe let the driver specify which lane counts it can accept?  
> 
> Not sure what did you mean, can you please explain?

-	u32     capabilities;  
+	u32	cap_link_lanes_supported:1;

or

-	u32     capabilities;  
+	u8	max_link_lanes;

		if (!lsettings->autoneg &&
-		    !(dev->ethtool_ops->capabilities & ETHTOOL_CAP_LINK_LANES_SUPPORTED)) {
+		    dev->ethtool_ops->max_link_lanes < req_lanes) {
			NL_SET_ERR_MSG_ATTR(info->extack,
					    tb[ETHTOOL_A_LINKMODES_LANES],
+					    dev->ethtool_ops->max_link_lanes ?
+					    "device does not support this many lanes" :
					    "lanes configuration not supported by device");
			return -EOPNOTSUPP;

  reply	other threads:[~2021-01-11 17:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 13:06 [PATCH net-next repost v2 0/7] Support setting lanes via ethtool Danielle Ratson
2021-01-06 13:06 ` [PATCH net-next repost v2 1/7] ethtool: Extend link modes settings uAPI with lanes Danielle Ratson
2021-01-08  0:35   ` Jakub Kicinski
2021-01-11 14:00     ` Danielle Ratson
2021-01-11 17:57       ` Jakub Kicinski [this message]
2021-01-06 13:06 ` [PATCH net-next repost v2 2/7] ethtool: Get link mode in use instead of speed and duplex parameters Danielle Ratson
2021-01-08  0:42   ` Jakub Kicinski
2021-01-08  1:11     ` Andrew Lunn
2021-01-06 13:06 ` [PATCH net-next repost v2 3/7] ethtool: Expose the number of lanes in use Danielle Ratson
2021-01-06 13:06 ` [PATCH net-next repost v2 4/7] mlxsw: ethtool: Remove max lanes filtering Danielle Ratson
2021-01-06 13:06 ` [PATCH net-next repost v2 5/7] mlxsw: ethtool: Add support for setting lanes when autoneg is off Danielle Ratson
2021-01-06 13:06 ` [PATCH net-next repost v2 6/7] mlxsw: ethtool: Pass link mode in use to ethtool Danielle Ratson
2021-01-06 13:06 ` [PATCH net-next repost v2 7/7] net: selftests: Add lanes setting test Danielle Ratson
2021-01-08  0:45   ` Jakub Kicinski
2021-01-10 12:35     ` Danielle Ratson
2021-01-07 17:36 ` [PATCH net-next repost v2 0/7] Support setting lanes via ethtool Edwin Peer

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=20210111095704.2f8622c6@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=danieller@mellanox.com \
    --cc=danieller@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@nvidia.com \
    --cc=jiri@nvidia.com \
    --cc=mkubecek@suse.cz \
    --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).