diff mbox series

[ethtool,v2,2/5] netlink: settings: Add netlink support for lanes parameter

Message ID 20210202182513.325864-3-danieller@nvidia.com (mailing list archive)
State Superseded
Delegated to: Michal Kubecek
Headers show
Series Extend uAPI with lanes parameter | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Danielle Ratson Feb. 2, 2021, 6:25 p.m. UTC
Add support for "ethtool -s <dev> lanes N ..." for setting a specific
number of lanes.

Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
---
 ethtool.c          | 1 +
 netlink/settings.c | 8 ++++++++
 2 files changed, 9 insertions(+)

Comments

Michal Kubecek Feb. 9, 2021, 7:42 p.m. UTC | #1
On Tue, Feb 02, 2021 at 08:25:10PM +0200, Danielle Ratson wrote:
> Add support for "ethtool -s <dev> lanes N ..." for setting a specific
> number of lanes.
> 
> Signed-off-by: Danielle Ratson <danieller@nvidia.com>
> Reviewed-by: Jiri Pirko <jiri@nvidia.com>
> ---
>  ethtool.c          | 1 +
>  netlink/settings.c | 8 ++++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/ethtool.c b/ethtool.c
> index 585aafa..fcb09f7 100644
> --- a/ethtool.c
> +++ b/ethtool.c
> @@ -5620,6 +5620,7 @@ static const struct option args[] = {
>  		.nlfunc	= nl_sset,
>  		.help	= "Change generic options",
>  		.xhelp	= "		[ speed %d ]\n"
> +			  "		[ lanes %d ]\n"
>  			  "		[ duplex half|full ]\n"
>  			  "		[ port tp|aui|bnc|mii|fibre|da ]\n"
>  			  "		[ mdix auto|on|off ]\n"
> diff --git a/netlink/settings.c b/netlink/settings.c
> index 90c28b1..6cb5d5b 100644
> --- a/netlink/settings.c
> +++ b/netlink/settings.c
> @@ -20,6 +20,7 @@
>  struct link_mode_info {
>  	enum link_mode_class	class;
>  	u32			speed;
> +	u32			lanes;
>  	u8			duplex;
>  };
>  

This structure member is not used anywhere in this patch and, AFAICS,
not even in the rest of your series. Perhaps a leftover from an older
version?

Michal

> @@ -1067,6 +1068,13 @@ static const struct param_parser sset_params[] = {
>  		.handler	= nl_parse_direct_u32,
>  		.min_argc	= 1,
>  	},
> +	{
> +		.arg		= "lanes",
> +		.group		= ETHTOOL_MSG_LINKMODES_SET,
> +		.type		= ETHTOOL_A_LINKMODES_LANES,
> +		.handler	= nl_parse_direct_u32,
> +		.min_argc	= 1,
> +	},
>  	{
>  		.arg		= "duplex",
>  		.group		= ETHTOOL_MSG_LINKMODES_SET,
> -- 
> 2.26.2
>
diff mbox series

Patch

diff --git a/ethtool.c b/ethtool.c
index 585aafa..fcb09f7 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -5620,6 +5620,7 @@  static const struct option args[] = {
 		.nlfunc	= nl_sset,
 		.help	= "Change generic options",
 		.xhelp	= "		[ speed %d ]\n"
+			  "		[ lanes %d ]\n"
 			  "		[ duplex half|full ]\n"
 			  "		[ port tp|aui|bnc|mii|fibre|da ]\n"
 			  "		[ mdix auto|on|off ]\n"
diff --git a/netlink/settings.c b/netlink/settings.c
index 90c28b1..6cb5d5b 100644
--- a/netlink/settings.c
+++ b/netlink/settings.c
@@ -20,6 +20,7 @@ 
 struct link_mode_info {
 	enum link_mode_class	class;
 	u32			speed;
+	u32			lanes;
 	u8			duplex;
 };
 
@@ -1067,6 +1068,13 @@  static const struct param_parser sset_params[] = {
 		.handler	= nl_parse_direct_u32,
 		.min_argc	= 1,
 	},
+	{
+		.arg		= "lanes",
+		.group		= ETHTOOL_MSG_LINKMODES_SET,
+		.type		= ETHTOOL_A_LINKMODES_LANES,
+		.handler	= nl_parse_direct_u32,
+		.min_argc	= 1,
+	},
 	{
 		.arg		= "duplex",
 		.group		= ETHTOOL_MSG_LINKMODES_SET,