From: Jeff Garzik <jeff@garzik.org>
To: Ben Hutchings <bhutchings@solarflare.com>, chavey@google.com
Cc: davem@davemloft.net, netdev@vger.kernel.org, therbert@google.com
Subject: Re: [PATCH 1/1] add ethtool loopback support
Date: Thu, 08 Apr 2010 15:51:37 -0400 [thread overview]
Message-ID: <4BBE33C9.5000507@garzik.org> (raw)
In-Reply-To: <1270751373.5055.22.camel@achroite.uk.solarflarecom.com>
On 04/08/2010 02:29 PM, Ben Hutchings wrote:
> On Thu, 2010-04-08 at 10:35 -0700, chavey@google.com wrote:
>> From: Ranjit Manomohan<ranjitm@google.com>
>> Date: Wed, 7 Apr 2010 15:19:48 -0700
>>
>> Add an ethtool option to use internal loopback mode for testing.
>> This feature is used for component and driver test coverage by putting
>> the device in hardware loopback mode and sending / receiving network
>> traffic from a user application to test the hardware and driver
>> transmit / receive paths.
>>
>> Signed-off-by: laurent chavey<chavey@google.com>
>> ---
>> include/linux/ethtool.h | 16 ++++++++++++++++
>> net/core/ethtool.c | 40 ++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 56 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
>> index b33f316..df1dcc7 100644
>> --- a/include/linux/ethtool.h
>> +++ b/include/linux/ethtool.h
>> @@ -292,6 +292,18 @@ struct ethtool_stats {
>> __u64 data[0];
>> };
>>
>> +/* for setting the NIC into loopback mode */
>> +struct ethtool_loopback {
>> + u32 cmd; /* ETHTOOL_SLOOPBACK */
>> + u32 type; /* ethtool_loopback_type */
>> +};
>> +
>> +enum ethtool_loopback_type {
>> + ETH_MAC = 0x00000001,
>> + ETH_PHY_INT = 0x00000002,
>> + ETH_PHY_EXT = 0x00000004
>> +};
> [...]
>
> There are many different places you can loop back within a MAC or PHY,
> not to mention bypassing the MAC altogether. See
> drivers/net/sfc/mcdi_pcol.h, starting from the line
> '#define MC_CMD_LOOPBACK_NONE 0'. I believe we implement all of those
> loopback modes on at least one board.
>
> Also are these supposed to be an enumeration or flags? In theory you
> could use wire-side and host-side loopback at the same time if they
> don't overlap, but it's probably too much trouble to bother with. Any
> other combination is meaningless.
Additionally, ethtool is intended as an interface that exports
capabilities generally useful to users. Is this feature really
something that users will make use of? It seems more in the realm of
design validation
The existing ETHTOOL_TEST ioctl was intended as a coarse-grained method
of verifying that the NIC is working, because fine-grained tests are
inevitably both NIC-specific, and too involved for all but the most
sophisticated users (read: the designers who built the NIC).
So, consider this a _weak_ objection. Sure we could implement this, but
will it really be useful to most users?
Jeff
next prev parent reply other threads:[~2010-04-08 19:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 17:35 [PATCH 1/1] add ethtool loopback support chavey
2010-04-08 18:29 ` Ben Hutchings
2010-04-08 19:17 ` Laurent Chavey
2010-04-08 19:35 ` Ben Hutchings
2010-04-08 22:43 ` Laurent Chavey
2010-04-09 0:46 ` Jeff Garzik
2010-04-09 16:43 ` Laurent Chavey
2010-04-09 16:55 ` Ben Hutchings
2010-04-09 17:01 ` Jeff Garzik
2010-04-09 18:09 ` Laurent Chavey
2010-04-08 19:51 ` Jeff Garzik [this message]
2010-04-08 20:03 ` Rick Jones
2010-04-08 21:18 ` Laurent Chavey
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=4BBE33C9.5000507@garzik.org \
--to=jeff@garzik.org \
--cc=bhutchings@solarflare.com \
--cc=chavey@google.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.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.