summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-01-21Merge RX NFC optionsBen Hutchings3-208/+177
Santwona Behera originally intended to extend the -n and -N options to cover querying and setting rules as well as flow hash options. However, his patch fell between the cracks and the ethtool utility got n-tuple support first, using the -u and -U options. When RX NFC rule support was finally added I insisted that it should not require different command syntax, so rules must be accessed through these options. The sets of valid argument lists following the -n and -u options are still non-overlapping, and similarly for the -N and -U options. Since the top level argument parser now supports arbitrary numbers of option aliases, we can merge these pairs together and achieve the original intent. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-01-20Move '--flash' down the list of optionsBen Hutchings1-3/+3
It doesn't make sense to to list it between the two RX NFC options in the online help. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-01-12Release version 3.2.Ben Hutchings2-1/+10
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-01-12ethtool: Correct register dump offsets for Intel 82575 chipsets.Matthew Vick1-6/+6
When support was added to dump the registers on 82575 chipset devices, six register offsets (receive/transmit desc length, head, and tail) were incorrectly mapped. This patch remaps the offsets to the correct registers. Signed-off-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-01-12rxclass: Allow driver to select RX NFC rule locationBen Hutchings1-9/+20
If the user does not specify a location for an RX NFC rule to be added and the result of the ETHTOOL_GRXCLSRLCNT command indicates that the driver supports special rule locations, let the driver select the location. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-01-12rxclass: Use RX_CLS_LOC_{ANY,SPECIAL} in place of RX_CLS_LOC_UNSPECBen Hutchings3-10/+5
The macro RX_CLS_LOC_ANY is now defined in ethtool(-copy).h with the same intended semantics and same value as RX_CLS_LOC_UNSPEC. Change some equality tests to check for the flag RX_CLS_LOC_SPECIAL, to allow for future support of other special location value. Remove the special case for RX_CLS_LOC_UNSPEC in rxclass_print_nfc_rule(), since it is dead code. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-01-12ethtool-copy.h: sync with net-nextBen Hutchings1-4/+34
This covers kernel changes up to: commit 6cfb5e759d47f037cbd0953ec2c3ceb220ed9e96 Author: Ben Hutchings <bhutchings@solarflare.com> Date: Tue Jan 3 12:07:59 2012 +0000 ethtool: Remove ethtool_ops::set_rx_ntuple operation Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-12-21sfc: Omit zero values in register tablesBen Hutchings1-9/+20
Some register tables on Solarflare controllers are very large and may have only a few rows in use. Make register dumps more readable by omitting rows where all bits read as zero. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-12-02Add support for querying and setting private flagsBen Hutchings3-2/+127
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-30Implement and use a generic get_stringset() functionBen Hutchings1-54/+67
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-16Release version 3.1.Ben Hutchings2-1/+15
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03gitignore: ethtool.8 is now a generated fileBen Hutchings1-0/+1
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Rearrange definitions and remove unnecessary forward declarationsBen Hutchings1-243/+204
Most functions in ethtool.c are defined before use. The major exception is that the args array refers to a large number of functions defined after it. Move the args array and show_usage() functions down, and move a few other functions up. This leaves just one forward declaration in ethtool.c, which is unavoidable because show_usage() and args refer to each other. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Declare static variables const as appropriateBen Hutchings2-6/+6
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03rxclass: Replace global rmgr with automatic variable/parameterBen Hutchings1-44/+34
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Change most static global variables into automatic variablesBen Hutchings1-260/+293
This is necessary preparation for in-process testing. It should also reduce the risk of some classes of bug by putting declaration and use closer together. Add parameters to various functions as necessary. Leave the global constants alone. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Replace global devname variable with a field in struct cmd_contextBen Hutchings2-13/+12
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Convert cmdline_msglvl into array of named flags; convert back at run-timeBen Hutchings1-35/+44
cmdline_msglvl is used both in do_gset() and do_sset(), but it refers to variables only used in do_sset(). I want to get rid of the global variables without duplicating the flag definitions. So separate out the flag definitions into a new structure and generate cmdline_msglvl from that at run-time. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Fix reference to cmdline_ring in do_schannels()Ben Hutchings1-1/+1
cmdline_ring and cmdline_channels have the same array size, so this just happened to work. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Support arbitrary numbers of option names for each modeBen Hutchings1-52/+58
Instead of supporting a single short and long option for each mode, take a string of options separated by "|" (matching the way they are displayed in online help). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Move argument parsing to sub-command functionsBen Hutchings4-610/+390
Instead of doing most of the argument parsing in parse_cmdline(), find the sub-command and (if required) the device name in main() and do the rest in the sub-command handler function. Pass argc and argp around in struct cmd_context. This also tightens up argument parsing slightly: extraneous or missing arguments will now result in an error in a few cases where they were previously ignored. All test cases now pass. Replace sub-command dispatch in doit() with a function pointer in struct option. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Add more test cases for command-line parsingBen Hutchings1-0/+28
These test cases currently fail. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-03Add test cases for command-line parsingBen Hutchings7-0/+318
Preparation for refactoring command-line parsing. All these test cases pass. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-01Encapsulate command context in a structureBen Hutchings3-273/+204
Replace the fd and ifr arguments to each sub-command handler with struct cmd_context. Change send_ioctl() to take a pointer to this context and a pointer to the ethtool_cmd or other structure. Use send_ioctl() consistently. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-01Use standard indentation for definition of struct option argsBen Hutchings1-138/+142
Also put the whole of the help string on a line of its own where necessary. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-01Fix format of help text for -f optionBen Hutchings1-2/+2
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-01ethtool.8: Allow line-break in description of parameters after -NBen Hutchings1-2/+2
These lines are currently unbreakable and result in ugly wrapping in an 80-column window. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-01ethtool.8: Change device name metavariable from 'ethX' to 'devname'Ben Hutchings1-31/+31
The name 'ethX' is a poor choice because: - Many ethtool options are applicable to non-Ethernet devices - Ethernet device names don't have to begin with 'eth', and the new convention is to use the prefix 'lan' for LAN-on-motherboard or 'pci' for PCI plug-in cards The online help text already uses 'DEVNAME' instead, so change the manual page to be consistent. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-01Fix type of bit-number parameter to set_bit() and clear_bit()Ben Hutchings1-2/+2
The index must not be negative, so the parameter does not need to be signed. Division and modulus on signed operands generally cannot be optimised to right-shift and bitwise-and. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-11-01Combine ethtool-{bitops,util}.h into internal.hBen Hutchings24-51/+46
ethtool-util.h contains all kinds of declarations, not just utility functions or macros. ethtool-bitops.h contains just a few extra definitions, and its only user also includes ethtool-util.h. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-10-28ethtool.8: Fix initial blank line/pageBen Hutchings1-1/+1
Commit 8d63f72ccdcb1b19358d753a8f48f08dcd2136f0 included a regression of the problem fixed in commit 97b5471fc446d60f8772631b9c4e6d824404336d. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-10-28Report pause frame autonegotiation resultBen Hutchings1-6/+40
If pause frame autonegotiation is enabled and the driver reports the link partner's advertising flags, report the result of autonegotiation. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-10-17ethtool: add ETHTOOL_{G,S}CHANNEL support.Sucheta Chakraborty2-0/+149
Used to configure number of tx/ rx/ other channels. Reqd. man page changes are included. Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-10-08ethtool: fix flow control register dump for 82599 and newerEmil Tantilov1-9/+129
Fix reporting of the flow control settings in the register dump for ixgbe. Use MFLCN for 82599 and X540 HW instead of FCTRL. This patch also adds the ability to check for mac type. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-10-04ethtool: add support for external loopback.Sucheta Chakraborty2-6/+23
External loopback will be performed in addition to other offline tests. User need to pass new parameter "external_lb" for the same. Reqd. man page changes included. Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> [bwh: Report whether the external loopback test 'was', not 'is' executed. For compatibility, don't report this if not requested.] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-10-04ethtool-copy.h: sync with net-nextBen Hutchings1-93/+106
This covers kernel changes up to: commit a355d865f99d0dbbaba5595416e292592bd347dd Author: françois romieu <romieu@fr.zoreil.com> Date: Fri Sep 30 00:39:23 2011 +0000 tehuti: shorten PCI device table. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-08-31ethtool: Uncook tg3 regdump outputMatt Carlson1-23/+7
tg3 devices have changed a lot since the bcm5700 days. Register blocks have been added, removed and redefined. The existing tg3 register dump code has not kept up. This patch changes the tg3_dump_regs() function to be more simplistic. Rather than attempting to locate where meaningful data is, it will instead print the registers as 32-bit values, omitting all registers that have a value of zero. By performing the output this way, we hope to future-proof the interface. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-08-04Release version 3.0.Ben Hutchings2-1/+13
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-07-14Correct parameter types for ethtool -e and ethtool -EBen Hutchings1-16/+24
All parameters to the underlying ethtool commands are unsigned, not signed. In particular, the 'magic' parameter to ethtool -E often has the most significant bit set and users should not have to provide it as a negative number. For ethtool -E, the value to be written is 8-bit, not 32-bit. Reported-by: Jens Rottmann <JRottmann@LiPPERTEmbedded.de> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-07-14ethtool: RX NFC correctionsSebastian Pöhn2-3/+13
This patch: least as long there is no opportunity to use others than IPv4 and there is no frontend option to enter ip_ver. Signed-off-by: Sebastian Poehn <sebastian.poehn@belden.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-06-06ethtool: Add support for 20G link speedYaniv Rosner2-1/+19
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
2011-06-02Fix type mismatch for field width argument to fprintf()Ben Hutchings1-1/+1
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-06-02ethtool: Added FW dump supportAnirban Chakraborty2-1/+139
Added support to take FW dump via ethtool. Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-06-01Combine code to display supported and advertised link capabilitiesBen Hutchings1-59/+21
Rename dump_advertised() to dump_link_caps(), and change dump_supported() to call it instead of repeating nearly identical code. Add a separate prefix parameter and adjust indentation so that the output is unchanged except for added lines. Deleted unused parameter and variables. As an immediate benefit, this adds the display of supported pause frame use. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-06-01ethtool-copy.h: sync with net-next-2.6Ben Hutchings1-4/+37
This covers kernel changes up to: commit 34b1ef04fc050d171e055f75d6a3384e1323bd38 Author: Somnath Kotur <somnath.kotur@emulex.com> Date: Wed Jun 1 00:33:22 2011 +0000 be2net: Fallback to the older opcode if MCC_CREATE_EXT opcode is not supported on the card Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-06-01Release version 2.6.39.Ben Hutchings2-1/+17
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-06-01Add new header ethtool-bitops.h to ethtool_SOURCESBen Hutchings1-1/+1
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-06-01ethtool: mask out FLOW_EXTSebastian Pöhn1-0/+3
The FLOW_EXT bit must be masked out. Otherwise if e.g. vlan is set a driver receiving the ntuple may not detect the flow_type correctly! Signed-off-by: Sebastian Poehn <sebastian.poehn@belden.com> [bwh: Fixed spacing] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-06-01Change bug-address to netdevBen Hutchings1-1/+1
I really want bug reports to go to both me and netdev, but autoconf wants a single address (without a real name). The netdev address is likely to be valid for longer, so use that. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2011-06-01Correct references to post-2004 changelogsBen Hutchings1-2/+4
Refer to the git repository for the current changelog. Since the BitKeeper changes aren't included in git history, add a full reference to that repository for anyone who cares to look at the intermediate changelog. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>