netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ethtool: Add support for 20G link speed
@ 2011-05-23 13:38 Yaniv Rosner
  2011-06-01 22:15 ` Ben Hutchings
  0 siblings, 1 reply; 4+ messages in thread
From: Yaniv Rosner @ 2011-05-23 13:38 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev@vger.kernel.org, eilong

Add support for 20G link speed

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
---
 ethtool-copy.h |    5 +++++
 ethtool.c      |   18 +++++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/ethtool-copy.h b/ethtool-copy.h
index 22215e9..c02a98b 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -749,6 +749,8 @@ enum ethtool_sfeatures_retval_bits {
 #define SUPPORTED_10000baseKX4_Full	(1 << 18)
 #define SUPPORTED_10000baseKR_Full	(1 << 19)
 #define SUPPORTED_10000baseR_FEC	(1 << 20)
+#define SUPPORTED_20000baseMLD2_Full	(1 << 21)
+#define SUPPORTED_20000baseKR2_Full	(1 << 22)
 
 /* Indicates what features are advertised by the interface. */
 #define ADVERTISED_10baseT_Half		(1 << 0)
@@ -772,6 +774,9 @@ enum ethtool_sfeatures_retval_bits {
 #define ADVERTISED_10000baseKX4_Full	(1 << 18)
 #define ADVERTISED_10000baseKR_Full	(1 << 19)
 #define ADVERTISED_10000baseR_FEC	(1 << 20)
+#define ADVERTISED_20000baseMLD2_Full	(1 << 21)
+#define ADVERTISED_20000baseKR2_Full	(1 << 22)
+
 
 /* The following are all involved in forcing a particular link
  * mode for the device for setting things.  When getting the
diff --git a/ethtool.c b/ethtool.c
index cfdac65..a099a23 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -1238,6 +1238,20 @@ static void dump_supported(struct ethtool_cmd *ep)
 	if (mask & SUPPORTED_10000baseT_Full) {
 		did1++; fprintf(stdout, "10000baseT/Full ");
 	}
+	if (did1 && (mask & SUPPORTED_20000baseMLD2_Full)) {
+		fprintf(stdout, "\n");
+		fprintf(stdout, "	                        ");
+	}
+	if (mask & SUPPORTED_20000baseMLD2_Full) {
+		did1++; fprintf(stdout, "20000baseMLD2/Full ");
+	}
+	if (did1 && (mask & SUPPORTED_20000baseKR2_Full)) {
+		fprintf(stdout, "\n");
+		fprintf(stdout, "	                        ");
+	}
+	if (mask & SUPPORTED_20000baseKR2_Full) {
+		did1++; fprintf(stdout, "20000baseKR2/Full ");
+	}
 	fprintf(stdout, "\n");
 
 	fprintf(stdout, "	Supports auto-negotiation: ");
@@ -2581,7 +2595,9 @@ static int do_sset(int fd, struct ifreq *ifr)
 					 ADVERTISED_1000baseT_Half |
 					 ADVERTISED_1000baseT_Full |
 					 ADVERTISED_2500baseX_Full |
-					 ADVERTISED_10000baseT_Full);
+					 ADVERTISED_10000baseT_Full |
+					 ADVERTISED_20000baseMLD2_Full |
+					 ADVERTISED_20000baseKR2_Full);
 			} else if (advertising_wanted > 0) {
 				ecmd.advertising = advertising_wanted;
 			}
-- 
1.7.1






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ethtool: Add support for 20G link speed
  2011-05-23 13:38 Yaniv Rosner
@ 2011-06-01 22:15 ` Ben Hutchings
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2011-06-01 22:15 UTC (permalink / raw)
  To: Yaniv Rosner; +Cc: netdev@vger.kernel.org, eilong

On Mon, 2011-05-23 at 16:38 +0300, Yaniv Rosner wrote:
> Add support for 20G link speed
>
> Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
> ---
>  ethtool-copy.h |    5 +++++
>  ethtool.c      |   18 +++++++++++++++++-
>  2 files changed, 22 insertions(+), 1 deletions(-)
> 
> diff --git a/ethtool-copy.h b/ethtool-copy.h
> index 22215e9..c02a98b 100644
> --- a/ethtool-copy.h
> +++ b/ethtool-copy.h
> @@ -749,6 +749,8 @@ enum ethtool_sfeatures_retval_bits {
>  #define SUPPORTED_10000baseKX4_Full	(1 << 18)
>  #define SUPPORTED_10000baseKR_Full	(1 << 19)
>  #define SUPPORTED_10000baseR_FEC	(1 << 20)
> +#define SUPPORTED_20000baseMLD2_Full	(1 << 21)
> +#define SUPPORTED_20000baseKR2_Full	(1 << 22)
>  
>  /* Indicates what features are advertised by the interface. */
>  #define ADVERTISED_10baseT_Half		(1 << 0)
> @@ -772,6 +774,9 @@ enum ethtool_sfeatures_retval_bits {
>  #define ADVERTISED_10000baseKX4_Full	(1 << 18)
>  #define ADVERTISED_10000baseKR_Full	(1 << 19)
>  #define ADVERTISED_10000baseR_FEC	(1 << 20)
> +#define ADVERTISED_20000baseMLD2_Full	(1 << 21)
> +#define ADVERTISED_20000baseKR2_Full	(1 << 22)
> +
>  
>  /* The following are all involved in forcing a particular link
>   * mode for the device for setting things.  When getting the

You don't need to include this.  I've updated ethtool-copy.h from
today's net-next-2.6.

> diff --git a/ethtool.c b/ethtool.c
> index cfdac65..a099a23 100644
> --- a/ethtool.c
> +++ b/ethtool.c
> @@ -1238,6 +1238,20 @@ static void dump_supported(struct ethtool_cmd *ep)
>  	if (mask & SUPPORTED_10000baseT_Full) {
>  		did1++; fprintf(stdout, "10000baseT/Full ");
>  	}
> +	if (did1 && (mask & SUPPORTED_20000baseMLD2_Full)) {
> +		fprintf(stdout, "\n");
> +		fprintf(stdout, "	                        ");
> +	}
> +	if (mask & SUPPORTED_20000baseMLD2_Full) {
> +		did1++; fprintf(stdout, "20000baseMLD2/Full ");
> +	}
> +	if (did1 && (mask & SUPPORTED_20000baseKR2_Full)) {
> +		fprintf(stdout, "\n");
> +		fprintf(stdout, "	                        ");
> +	}
> +	if (mask & SUPPORTED_20000baseKR2_Full) {
> +		did1++; fprintf(stdout, "20000baseKR2/Full ");
> +	}
>  	fprintf(stdout, "\n");
>  
>  	fprintf(stdout, "	Supports auto-negotiation: ");

This doesn't cover the advertised mask.

But I think I'll just combine the code to dump supported vs advertised
flags - it's ridiculous to duplicate it as the flag definitions are
deliberately kept equal to each other.

> @@ -2581,7 +2595,9 @@ static int do_sset(int fd, struct ifreq *ifr)
>  					 ADVERTISED_1000baseT_Half |
>  					 ADVERTISED_1000baseT_Full |
>  					 ADVERTISED_2500baseX_Full |
> -					 ADVERTISED_10000baseT_Full);
> +					 ADVERTISED_10000baseT_Full |
> +					 ADVERTISED_20000baseMLD2_Full |
> +					 ADVERTISED_20000baseKR2_Full);
>  			} else if (advertising_wanted > 0) {
>  				ecmd.advertising = advertising_wanted;
>  			}

You also need to update the table in the manual page, including a note
that this these are not IEEE standard modes.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ethtool: Add support for 20G link speed
@ 2011-06-05 17:39 Yaniv Rosner
  2011-06-06 10:12 ` Ben Hutchings
  0 siblings, 1 reply; 4+ messages in thread
From: Yaniv Rosner @ 2011-06-05 17:39 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, eilong

Hi Ben,
I'm resubmitting the addition of 20G with your corrections to ethtool.

Thanks,
Yaniv

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
---
 ethtool.8.in |    2 ++
 ethtool.c    |   18 +++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/ethtool.8.in b/ethtool.8.in
index 7b1cdf5..2983b3e 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -499,6 +499,8 @@ lB	l	lB.
 0x020	1000 Full
 0x8000	2500 Full	(not supported by IEEE standards)
 0x1000	10000 Full
+0x20000	20000MLD2 Full	(not supported by IEEE standards)
+0x40000	20000KR2 Full	(not supported by IEEE standards)
 .TE
 .TP
 .BI phyad \ N
diff --git a/ethtool.c b/ethtool.c
index c189c78..35c3733 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -1244,6 +1244,20 @@ dump_link_caps(const char *prefix, const char *an_prefix, u32 mask)
 	if (mask & ADVERTISED_10000baseT_Full) {
 		did1++; fprintf(stdout, "10000baseT/Full ");
 	}
+	if (did1 && (mask & ADVERTISED_20000baseMLD2_Full)) {
+		fprintf(stdout, "\n");
+		fprintf(stdout, "	%*s", indent, "");
+	}
+	if (mask & ADVERTISED_20000baseMLD2_Full) {
+		did1++; fprintf(stdout, "20000baseMLD2/Full ");
+	}
+	if (did1 && (mask & ADVERTISED_20000baseKR2_Full)) {
+		fprintf(stdout, "\n");
+		fprintf(stdout, "	%*s", indent, "");
+	}
+	if (mask & ADVERTISED_20000baseKR2_Full) {
+		did1++; fprintf(stdout, "20000baseKR2/Full ");
+	}
 	if (did1 == 0)
 		 fprintf(stdout, "Not reported");
 	fprintf(stdout, "\n");
@@ -2474,7 +2488,9 @@ static int do_sset(int fd, struct ifreq *ifr)
 					 ADVERTISED_1000baseT_Half |
 					 ADVERTISED_1000baseT_Full |
 					 ADVERTISED_2500baseX_Full |
-					 ADVERTISED_10000baseT_Full);
+					 ADVERTISED_10000baseT_Full |
+					 ADVERTISED_20000baseMLD2_Full |
+					 ADVERTISED_20000baseKR2_Full);
 			} else if (advertising_wanted > 0) {
 				ecmd.advertising = advertising_wanted;
 			}
-- 
1.7.1





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ethtool: Add support for 20G link speed
  2011-06-05 17:39 [PATCH] ethtool: Add support for 20G link speed Yaniv Rosner
@ 2011-06-06 10:12 ` Ben Hutchings
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2011-06-06 10:12 UTC (permalink / raw)
  To: Yaniv Rosner; +Cc: netdev, eilong

On Sun, 2011-06-05 at 20:39 +0300, Yaniv Rosner wrote:
> Hi Ben,
> I'm resubmitting the addition of 20G with your corrections to ethtool.
> 
> Thanks,
> Yaniv

Applied, thanks.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-06 10:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-05 17:39 [PATCH] ethtool: Add support for 20G link speed Yaniv Rosner
2011-06-06 10:12 ` Ben Hutchings
  -- strict thread matches above, loose matches on Subject: below --
2011-05-23 13:38 Yaniv Rosner
2011-06-01 22:15 ` Ben Hutchings

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).