netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ethtool 00/21] ethtool refactoring and misc changes
@ 2011-11-01 22:35 Ben Hutchings
  2011-11-01 23:13 ` [PATCH ethtool 01/21] Report pause frame autonegotiation result Ben Hutchings
                   ` (21 more replies)
  0 siblings, 22 replies; 24+ messages in thread
From: Ben Hutchings @ 2011-11-01 22:35 UTC (permalink / raw)
  To: netdev; +Cc: linux-net-drivers

As I looked into supporting features cleanly within the existing -k/-K
options, it became clear that ethtool was overdue for refactoring.  And
in order to be confident about doing that, I needed to add some tests.

So I intend to push the following changes:

1. Reporting of pause frame autonegotiation.  I don't believe this
   requires a new command in the kernel interface; it just needs drivers
   to fill out the AN flags.

2. Minor fixes to manual page and online help.

3. Cleanup of ethtool-bitops.h and ethtool-util.h.

4. Encapsulate shared command state into a structure passed into each
   sub-command function (and several others).

5. Test argument parsing.  Currently this just checks that each command
   line is accepted or rejected as expected.

6. For each sub-command (option), move all argument parsing into the
   function that implements it.  Move the associated static variables
   likewise.  Declare static constants as const, so that there are no
   static variables left (outside of the test wrapper).

7. Run the main ethtool code in the same process as the test code.
   This will allow for test cases that cover the ioctl requests and
   responses.

Ben.

Ben Hutchings (21):
  Report pause frame autonegotiation result
  ethtool.8: Fix initial blank line/page
  Combine ethtool-{bitops,util}.h into internal.h
  Fix type of bit-number parameter to set_bit() and clear_bit()
  ethtool.8: Change device name metavariable from 'ethX' to 'devname'
  ethtool.8: Allow line-break in description of parameters after -N
  Fix format of help text for -f option
  Use standard indentation for definition of struct option args
  Encapsulate command context in a structure
  Add test cases for command-line parsing
  Add more test cases for command-line parsing
  Move argument parsing to sub-command functions
  Support arbitrary numbers of option names for each mode
  Fix reference to cmdline_ring in do_schannels()
  Convert cmdline_msglvl into array of named flags; convert back at
    run-time
  Replace global devname variable with a field in struct cmd_context
  Change most static global variables into automatic variables
  rxclass: Replace global rmgr with automatic variable/parameter
  Declare static variables const as appropriate
  Run tests in-process
  Rearrange definitions and remove unnecessary forward declarations

 Makefile.am                  |    7 +-
 amd8111e.c                   |    2 +-
 at76c50x-usb.c               |    2 +-
 configure.ac                 |    1 +
 de2104x.c                    |    2 +-
 e100.c                       |    2 +-
 e1000.c                      |    2 +-
 ethtool-bitops.h             |   25 -
 ethtool.8.in                 |   70 +-
 ethtool.c                    | 2352 +++++++++++++++++++-----------------------
 fec_8xx.c                    |    2 +-
 ibm_emac.c                   |    2 +-
 igb.c                        |    2 +-
 ethtool-util.h => internal.h |   57 +-
 ixgb.c                       |    2 +-
 ixgbe.c                      |    2 +-
 marvell.c                    |    2 +-
 natsemi.c                    |    2 +-
 pcnet32.c                    |    2 +-
 realtek.c                    |    2 +-
 rxclass.c                    |  129 +--
 sfc.c                        |    2 +-
 smsc911x.c                   |    2 +-
 stmmac.c                     |    2 +-
 test-cmdline.c               |  240 +++++
 test-common.c                |  101 ++
 tg3.c                        |    2 +-
 vioc.c                       |    2 +-
 28 files changed, 1565 insertions(+), 1455 deletions(-)
 delete mode 100644 ethtool-bitops.h
 rename ethtool-util.h => internal.h (71%)
 create mode 100644 test-cmdline.c
 create mode 100644 test-common.c

-- 
1.7.4.4


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

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

end of thread, other threads:[~2011-11-03 19:17 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-01 22:35 [PATCH ethtool 00/21] ethtool refactoring and misc changes Ben Hutchings
2011-11-01 23:13 ` [PATCH ethtool 01/21] Report pause frame autonegotiation result Ben Hutchings
2011-11-01 23:13 ` [PATCH ethtool 02/21] ethtool.8: Fix initial blank line/page Ben Hutchings
2011-11-01 23:14 ` [PATCH ethtool 03/21] Combine ethtool-{bitops,util}.h into internal.h Ben Hutchings
2011-11-01 23:14 ` [PATCH ethtool 04/21] Fix type of bit-number parameter to set_bit() and clear_bit() Ben Hutchings
2011-11-01 23:15 ` [PATCH ethtool 05/21] ethtool.8: Change device name metavariable from 'ethX' to 'devname' Ben Hutchings
2011-11-01 23:15 ` [PATCH ethtool 06/21] ethtool.8: Allow line-break in description of parameters after -N Ben Hutchings
2011-11-01 23:15 ` [PATCH ethtool 07/21] Fix format of help text for -f option Ben Hutchings
2011-11-01 23:15 ` [PATCH ethtool 08/21] Use standard indentation for definition of struct option args Ben Hutchings
2011-11-01 23:16 ` [PATCH ethtool 09/21] Encapsulate command context in a structure Ben Hutchings
2011-11-01 23:17 ` [PATCH ethtool 10/21] Add test cases for command-line parsing Ben Hutchings
2011-11-01 23:17 ` [PATCH ethtool 11/21] Add more " Ben Hutchings
2011-11-01 23:18 ` [PATCH ethtool 12/21] Move argument parsing to sub-command functions Ben Hutchings
2011-11-01 23:18 ` [PATCH ethtool 13/21] Support arbitrary numbers of option names for each mode Ben Hutchings
2011-11-01 23:18 ` [PATCH ethtool 14/21] Fix reference to cmdline_ring in do_schannels() Ben Hutchings
2011-11-01 23:19 ` [PATCH ethtool 15/21] Convert cmdline_msglvl into array of named flags; convert back at run-time Ben Hutchings
2011-11-01 23:20 ` [PATCH ethtool 16/21] Replace global devname variable with a field in struct cmd_context Ben Hutchings
2011-11-01 23:21 ` [PATCH ethtool 17/21] Change most static global variables into automatic variables Ben Hutchings
2011-11-01 23:22 ` [PATCH ethtool 18/21] rxclass: Replace global rmgr with automatic variable/parameter Ben Hutchings
2011-11-01 23:22 ` [PATCH ethtool 19/21] Declare static variables const as appropriate Ben Hutchings
2011-11-01 23:23 ` [PATCH ethtool 20/21] Run tests in-process Ben Hutchings
2011-11-02 20:25   ` Ben Hutchings
2011-11-01 23:24 ` [PATCH ethtool 21/21] Rearrange definitions and remove unnecessary forward declarations Ben Hutchings
2011-11-03 19:17 ` [PATCH ethtool 00/21] ethtool refactoring and misc changes 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).