From: Ben Hutchings <bhutchings@solarflare.com>
To: Rick Jones <rick.jones2@hp.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
Olaf Hering <olaf@aepfle.de>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: use a special value of -2 for virtual devices to report indeterminate speed?
Date: Fri, 18 Nov 2011 19:13:19 +0000 [thread overview]
Message-ID: <1321643599.2883.42.camel@bwh-desktop> (raw)
In-Reply-To: <4EC6AAF3.6080803@hp.com>
On Fri, 2011-11-18 at 10:58 -0800, Rick Jones wrote:
> On 11/18/2011 10:46 AM, Jeremy Fitzhardinge wrote:
> > On 11/18/2011 10:44 AM, Rick Jones wrote:
> >> It could I suppose, decide
> >> based on the physical NIC to which it is attached, so long as folks
> >> using the virtual NIC don't expect its attributes to be the same from
> >> system to system.
> >
> > And assuming there's a physical NIC at all.
>
> It sounds like we need a way to specify "Indeterminate" for link speed?
> Or some verbiage to that effect. Right now 0 and -1 cause ethtool to
> report "Unknown!"
>
> if (speed == 0 || speed == (u16)(-1) || speed == (u32)(-1))
> fprintf(stdout, "Unknown!\n");
> else
> fprintf(stdout, "%uMb/s\n", speed);
>
>
> How about -2 for the u32 cast value of speed returning "Indeterminate"
> or something like that? Not in "proper" patch format:
>
> if (speed == 0 || speed == (u16)(-1) || speed == (u32)(-1))
> fprintf(stdout, "Unknown!\n");
> else if (speed == (u32)(-2))
> fprintf(stdout, "Indeterminate.");
> else
> fprintf(stdout, "%uMb/s\n", speed);
I'm open to something like this, but the problem with assigning new
magic numbers is that older versions of ethtool won't know to report
them as special.
We should also consider stacked drivers like bonding (and presumably
team) that expect real numbers when the link is up.
Ben.
--
Ben Hutchings, Staff 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.
next prev parent reply other threads:[~2011-11-18 19:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-18 16:48 [PATCH] xen-netfront: report link speed to ethtool Olaf Hering
2011-11-18 17:46 ` Ben Hutchings
2011-11-18 18:43 ` Olaf Hering
2011-11-18 19:10 ` Ben Hutchings
2011-11-18 19:17 ` Olaf Hering
2011-11-18 18:44 ` Rick Jones
2011-11-18 18:46 ` Jeremy Fitzhardinge
2011-11-18 18:58 ` use a special value of -2 for virtual devices to report indeterminate speed? Rick Jones
2011-11-18 19:13 ` Ben Hutchings [this message]
2011-11-18 19:11 ` [PATCH] xen-netfront: report link speed to ethtool David Miller
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=1321643599.2883.42.camel@bwh-desktop \
--to=bhutchings@solarflare.com \
--cc=jeremy@goop.org \
--cc=konrad.wilk@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=rick.jones2@hp.com \
--cc=xen-devel@lists.xensource.com \
/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).