netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make possible speeds known to ethtool
@ 2009-01-08  2:03 Rick Jones
  2009-01-08  3:14 ` Ben Hutchings
  0 siblings, 1 reply; 27+ messages in thread
From: Rick Jones @ 2009-01-08  2:03 UTC (permalink / raw)
  To: davem, jgarzik, netdev


Certain Broadcom 10Gb Ethernet solutions (e.g. the 57711E) can have a
10Gb port split into multiple virtual NICs each with an instance of
the bnx2x driver.  These virtual NICs can be configured for any speed
which is an integer multiple of 100 Mb/s from 100 to 10,000 Mbit/s
inclusive.  Since this is "normal" for such systems an "Unknown!" is
not indicated.

Signed-off-by: Rick Jones <rick.jones2@hp.com>

---

Rather than make a wholesale change to the existing "speed vetting"
code, it seemed least invasive to escape-out to a new routine in the
default case.  Should other "unfamiliar" speeds surface in the future
the checks can be put there.

Where the original would say this:

	Speed: Unknown! (1600)

for a FlexNIC link set to 1600 Mbit/s the changed version will
say:

	Speed: 1600Mb/s

There is presently no way to alter this speed setting from within the
host, so there is no need/point to altering the ethtool "set" path.

--- ethtool.c.orig	2008-11-17 11:53:40.000000000 -0800
+++ ethtool.c	2008-11-17 13:14:55.000000000 -0800
@@ -806,6 +806,14 @@ static void dump_advertised(struct ethto
 		fprintf(stdout, "No\n");
 }
 
+static void vet_unfamiliar_speed(struct ethtool_cmd *ep)
+{
+	if ((!ep->speed) || (ep->speed % 100))
+		fprintf(stdout, "Unknown! (%i)\n", ep->speed);
+	else
+		fprintf(stdout,"%dMb/s\n",ep->speed); 
+}
+
 static int dump_ecmd(struct ethtool_cmd *ep)
 {
 	dump_supported(ep);
@@ -829,7 +837,7 @@ static int dump_ecmd(struct ethtool_cmd 
 		fprintf(stdout, "10000Mb/s\n");
 		break;
 	default:
-		fprintf(stdout, "Unknown! (%i)\n", ep->speed);
+		vet_unfamiliar_speed(ep);
 		break;
 	};
 

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: [PATCH] Make possible speeds known to ethtool
@ 2009-01-09  3:48 Herbert Xu
  2009-01-09  3:58 ` Jeff Garzik
  0 siblings, 1 reply; 27+ messages in thread
From: Herbert Xu @ 2009-01-09  3:48 UTC (permalink / raw)
  To: jgarzik; +Cc: herbert, bhutchings, rick.jones2, davem, netdev

Jeff Garzik <jgarzik@pobox.com> wrote:
> 
> The person who added this should have used the new flags interface, and 
> added ETH_FLAG_GRO right next to the pre-existing ETH_FLAG_LRO.
> 
> It is incorrect to add new ioctls just to toggle a boolean value.

Well you missed my earlier explanation.  GRO is a stack flag,
it's not something we want the device drivers to touch at all.

The generic flags interface appears to be designed for flags
that the device driver directly controls, such as LRO.  That's
why it is inappropriate for GRO, which like GSO is entirely done
in software.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: [PATCH] Make possible speeds known to ethtool
@ 2009-01-09  4:19 Herbert Xu
  2009-01-09  5:00 ` David Miller
  2009-01-09  5:03 ` Jeff Garzik
  0 siblings, 2 replies; 27+ messages in thread
From: Herbert Xu @ 2009-01-09  4:19 UTC (permalink / raw)
  To: jgarzik; +Cc: bhutchings, rick.jones2, davem, netdev

Jeff Garzik <jgarzik@pobox.com> wrote:
>
> For generic net stack flags outside the driver's control, that can 
> easily be added to ethtool_{get,set}_flags() overriding or ignoring 
> whatever the driver may have done.

To use the flags interface as is, you'd have to go through every
single driver to get them to call ethtool_op_set_flags.  I'm sorry
but I'm sticking with the current interface.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

end of thread, other threads:[~2009-03-06 13:52 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-08  2:03 [PATCH] Make possible speeds known to ethtool Rick Jones
2009-01-08  3:14 ` Ben Hutchings
2009-01-08  3:12   ` Jeff Garzik
2009-01-08 19:11     ` Rick Jones
2009-01-08 19:25       ` Ben Hutchings
2009-01-08 19:50         ` Rick Jones
2009-01-09 13:16           ` [PATCH] ethtool: Support arbitrary speeds Ben Hutchings
2009-01-09 17:55             ` Rick Jones
2009-01-09 18:24               ` Ben Hutchings
2009-01-09 18:40                 ` Rick Jones
2009-03-06 11:20             ` Jeff Garzik
2009-03-06 12:27             ` Jeff Garzik
2009-01-09  2:52     ` [PATCH] Make possible speeds known to ethtool Herbert Xu
2009-01-09  3:20       ` Jeff Garzik
2009-03-06 11:19       ` Jeff Garzik
2009-03-06 13:52         ` Herbert Xu
  -- strict thread matches above, loose matches on Subject: below --
2009-01-09  3:48 Herbert Xu
2009-01-09  3:58 ` Jeff Garzik
2009-01-09  4:19 Herbert Xu
2009-01-09  5:00 ` David Miller
2009-01-09  5:05   ` Jeff Garzik
2009-01-09  5:03 ` Jeff Garzik
2009-01-09  5:15   ` Herbert Xu
2009-01-09  5:30     ` Jeff Garzik
2009-01-09  5:35       ` Herbert Xu
2009-01-09  6:28         ` Jeff Garzik
2009-01-09  6:30           ` Herbert Xu

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