netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Running single tests via ethtool
@ 2008-05-30 22:08 Ben Hutchings
  2008-06-02 17:00 ` Ingo Oeser
  2008-06-02 17:46 ` Jeff Garzik
  0 siblings, 2 replies; 4+ messages in thread
From: Ben Hutchings @ 2008-05-30 22:08 UTC (permalink / raw)
  To: netdev; +Cc: linux-net-drivers

We have had a customer request to be able to run individual self-tests in
a future version of our driver.  Now we could do this any way we want in
an out-of-tree driver, but I'd rather find some way of doing this that
will also be acceptable in-tree.  I think that would mean extending the
ethtool self-test API in some way.

One possibility might be to add a new flag and to assign the reserved field
as a test index:

--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -235,13 +235,14 @@ struct ethtool_gstrings {
 enum ethtool_test_flags {
 	ETH_TEST_FL_OFFLINE	= (1 << 0),	/* online / offline */
 	ETH_TEST_FL_FAILED	= (1 << 1),	/* test passed / failed */
+	ETH_TEST_FL_SINGLE	= (1 << 2),	/* run single test */
 };
 
 /* for requesting NIC test and getting results*/
 struct ethtool_test {
 	__u32	cmd;		/* ETHTOOL_TEST */
 	__u32	flags;		/* ETH_TEST_FL_xxx */
-	__u32	reserved;
+	__u32	index;		/* test index if ETH_TEST_FL_SINGLE */
 	__u32	len;		/* result length, in number of u64 elements */
 	__u64	data[0];
 };

Clients would need to check len on return since the ethtool core and driver
ethtool functions ignore unknown flags.  I am assuming that running all
online self-tests instead of a single self-test will be harmless.

Ideally the ethtool core would allocate only the necessary memory for the
results of the selected test set or single test, but it would need to know
whether the driver also supports this extension.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

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

* Re: [RFC] Running single tests via ethtool
  2008-05-30 22:08 [RFC] Running single tests via ethtool Ben Hutchings
@ 2008-06-02 17:00 ` Ingo Oeser
  2008-06-02 17:46 ` Jeff Garzik
  1 sibling, 0 replies; 4+ messages in thread
From: Ingo Oeser @ 2008-06-02 17:00 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, linux-net-drivers

Hello Ben,

Ben Hutchings schrieb:
> We have had a customer request to be able to run individual self-tests in
> a future version of our driver.  Now we could do this any way we want in
> an out-of-tree driver, but I'd rather find some way of doing this that
> will also be acceptable in-tree.  I think that would mean extending the
> ethtool self-test API in some way.
> 
> One possibility might be to add a new flag and to assign the reserved field
> as a test index:
> 
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -235,13 +235,14 @@ struct ethtool_gstrings {
>  enum ethtool_test_flags {
>  	ETH_TEST_FL_OFFLINE	= (1 << 0),	/* online / offline */
>  	ETH_TEST_FL_FAILED	= (1 << 1),	/* test passed / failed */
> +	ETH_TEST_FL_SINGLE	= (1 << 2),	/* run single test */
>  };
>  
>  /* for requesting NIC test and getting results*/
>  struct ethtool_test {
>  	__u32	cmd;		/* ETHTOOL_TEST */
>  	__u32	flags;		/* ETH_TEST_FL_xxx */
> -	__u32	reserved;
> +	__u32	index;		/* test index if ETH_TEST_FL_SINGLE */
>  	__u32	len;		/* result length, in number of u64 elements */
>  	__u64	data[0];
>  };

2^32 possible tests are really an extensive test suite :-)

Maybe limit it to 16 bits, so we have some reserved space left for further
extensions.


Best Regards

Ingo Oeser

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

* Re: [RFC] Running single tests via ethtool
  2008-05-30 22:08 [RFC] Running single tests via ethtool Ben Hutchings
  2008-06-02 17:00 ` Ingo Oeser
@ 2008-06-02 17:46 ` Jeff Garzik
  2008-06-04 14:13   ` Ben Hutchings
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2008-06-02 17:46 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: netdev, linux-net-drivers

Ben Hutchings wrote:
> We have had a customer request to be able to run individual self-tests in
> a future version of our driver.  Now we could do this any way we want in
> an out-of-tree driver, but I'd rather find some way of doing this that
> will also be acceptable in-tree.  I think that would mean extending the
> ethtool self-test API in some way.
> 
> One possibility might be to add a new flag and to assign the reserved field
> as a test index:
> 
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -235,13 +235,14 @@ struct ethtool_gstrings {
>  enum ethtool_test_flags {
>  	ETH_TEST_FL_OFFLINE	= (1 << 0),	/* online / offline */
>  	ETH_TEST_FL_FAILED	= (1 << 1),	/* test passed / failed */
> +	ETH_TEST_FL_SINGLE	= (1 << 2),	/* run single test */
>  };
>  
>  /* for requesting NIC test and getting results*/
>  struct ethtool_test {
>  	__u32	cmd;		/* ETHTOOL_TEST */
>  	__u32	flags;		/* ETH_TEST_FL_xxx */
> -	__u32	reserved;
> +	__u32	index;		/* test index if ETH_TEST_FL_SINGLE */
>  	__u32	len;		/* result length, in number of u64 elements */
>  	__u64	data[0];
>  };
> 
> Clients would need to check len on return since the ethtool core and driver
> ethtool functions ignore unknown flags.  I am assuming that running all
> online self-tests instead of a single self-test will be harmless.
> 
> Ideally the ethtool core would allocate only the necessary memory for the
> results of the selected test set or single test, but it would need to know
> whether the driver also supports this extension.

Well it really becomes of question of whether or not you want to be 
importing a huge test suite into a kernel driver.  The ethtool stuff was 
not meant to cover exhaustive tests, just a way to run "it works" 
self-checks and diagnostics.

	Jeff





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

* Re: [RFC] Running single tests via ethtool
  2008-06-02 17:46 ` Jeff Garzik
@ 2008-06-04 14:13   ` Ben Hutchings
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2008-06-04 14:13 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, linux-net-drivers

Jeff Garzik wrote:
[...]
> Well it really becomes of question of whether or not you want to be 
> importing a huge test suite into a kernel driver.  The ethtool stuff was 
> not meant to cover exhaustive tests, just a way to run "it works" 
> self-checks and diagnostics.

We're not intending to expand the tests massively, though there are a few
that should be added.  We just want to pick which to run.  I'm not entirely
clear why the customer wants this, but I can imagine wanting to run a single
test repeatedly if some aspect of a board is suspected to be intermittently
faulty.  Since there is no firmware in our current controller, the
initialisation is fairly complex and we wouldn't want to duplicate it outside
the driver in a standalone diagnostic program.  Besides which, unloading a
driver and keeping it unloaded seems to be increasingly tricky.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.

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

end of thread, other threads:[~2008-06-04 14:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-30 22:08 [RFC] Running single tests via ethtool Ben Hutchings
2008-06-02 17:00 ` Ingo Oeser
2008-06-02 17:46 ` Jeff Garzik
2008-06-04 14:13   ` 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).