From: Rick Jones <rick.jones2@hp.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Ben Hutchings <bhutchings@solarflare.com>,
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: use a special value of -2 for virtual devices to report indeterminate speed?
Date: Fri, 18 Nov 2011 10:58:59 -0800 [thread overview]
Message-ID: <4EC6AAF3.6080803@hp.com> (raw)
In-Reply-To: <4EC6A802.9090805@goop.org>
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);
Signed-off-by: Rick Jones <rick.jones2@hp.com>
rick jones
next prev parent reply other threads:[~2011-11-18 18:59 UTC|newest]
Thread overview: 16+ 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 17:46 ` Ben Hutchings
2011-11-18 18:43 ` Olaf Hering
2011-11-18 19:10 ` Ben Hutchings
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 ` Rick Jones [this message]
2011-11-18 19:13 ` use a special value of -2 for virtual devices to report indeterminate speed? Ben Hutchings
2011-11-18 19:11 ` [PATCH] xen-netfront: report link speed to ethtool Pavel Matěja
2011-11-18 19:37 ` Pasi Kärkkäinen
2011-11-19 1:13 ` James Harper
2011-11-19 1:32 ` James Harper
2011-11-18 19:11 ` 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=4EC6AAF3.6080803@hp.com \
--to=rick.jones2@hp.com \
--cc=bhutchings@solarflare.com \
--cc=jeremy@goop.org \
--cc=konrad.wilk@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.