summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-07-16Merge commit 'v3.4.2'Ben Hutchings4-28/+85
2012-07-16ethtool: added support for 40G link.Parav Pandit1-0/+4
1. defined values for KR4, CR4, SR4, LR4 PHY. Signed-off-by: Parav Pandit <parav.pandit@emulex.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-07-16ethtool-copy.h: sync with net-nextBen Hutchings1-0/+8
This covers kernel changes up to: commit e440cf2ca0a1b075c64016240d46c3aa9d877bbf Author: parav.pandit@emulex.com <parav.pandit@emulex.com> Date: Wed Jun 27 03:56:12 2012 +0000 net: added support for 40GbE link. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-07-16Don't trust drivers to null-terminate stringsBen Hutchings1-15/+23
Some drivers have been seen to fill all bytes of ethtool_drvinfo::fw_version without including a null terminator, which effectively concatenates the following bytes to the string. We've already dealt with a similar problem in dump_stats() (commit 7764430a139e4a089127f5616b0d56f497be1036). Try to cover all the remaining string fields: - In dump_drvinfo(), limit the length using printf() modifiers - Add an option to get_stringset() to null-terminate all strings - Change all callers except dump_stats() to set that option Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-07-16test-cmdline: More test cases for EEE optionsBen Hutchings1-0/+4
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-07-16Ethtool: Add EEE supportYuval Mintz3-20/+159
This patch adds 2 new ethtool commands which can be used to manipulate network interfaces' support in EEE. Output of 'get' has the following form: EEE Settings for p2p1: EEE status: enabled - active Tx LPI: 1000 (us) Supported EEE link modes: 10000baseT/Full Advertised EEE link modes: 10000baseT/Full Link partner advertised EEE link modes: 10000baseT/Full Thanks goes to Giuseppe Cavallaro for his original patch. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-07-16Release version 3.4.2.Ben Hutchings2-1/+10
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-07-16Fix reporting of VLAN tag offload flags on Linux < 2.6.37Ben Hutchings1-0/+41
These kernel versions implement ETHTOOL_GFLAGS but do not include the flags for VLAN tag offload (and do not implement ETHTOOL_GFEATURES). Since the VLAN tag offload features were already defined and implemented by many drivers, we shouldn't assume they are off. Instead, since these feature flag values were stable, read them from sysfs. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-07-16Remove bogus error message when changing offload settings on Linux < 2.6.39Ben Hutchings1-27/+33
We should not be checking for fixed features when we have no information about which are fixed. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-07-16ethtool: Resolve use of uninitialized memory in rxclass_get_dev_infoAlexander Duyck1-0/+1
The ethtool function for getting the rule count was not zeroing out the data field before passing it to the kernel. As a result the value started uninitialized and was incorrectly returning a result indicating that devices supported setting new rule indexes. In order to correct this I am adding a one line fix that sets data to zero before we pass the command to the kernel. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-13Merge commit 'v3.4.1'Ben Hutchings5-4/+48
2012-06-13Release version 3.4.1.Ben Hutchings2-1/+9
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-13ethtool.8: Fix the dateBen Hutchings1-1/+1
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-13ethtool: Handle more errors when getting feature namesBen Hutchings2-2/+38
'ethtool -k eth0' generally works for unprivileged users, but in some kernel versions ETHTOOL_GSSET_INFO wrongly returns -EPERM. We need to fall back to the old offload operations in this case. Also, if we get some other error code, report that before exiting. Add regression test cases covering this and some other operations that may fail (which were already handled correctly). Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-08Make link mode listing in dump_link_caps() a data-driven loopBen Hutchings1-68/+31
This removes lots of repeated code and makes it trivial to support additional modes. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-08ethtool: fix to display support for KX4 and KX PHYAjit Khaparde1-0/+14
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-08ethtool-copy.h: sync with net-nextBen Hutchings1-1/+37
This covers kernel changes up to: commit 80f12eccce775dc6bb93dba9b52529740f929237 Author: Yuval Mintz <yuvalmin@broadcom.com> Date: Wed Jun 6 17:13:06 2012 +0000 Added kernel support in EEE Ethtool commands Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-08Release version 3.4.Ben Hutchings2-1/+11
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-02Change -k/-K options to use ETHTOOL_{G,S}FEATURESBen Hutchings4-124/+707
Rewrite the offload get and set functions to use the generic features API where available, while maintaining a similar output format. Add the long options --show-features and --features as additional aliases for -k and -K. Where there is exactly one named feature corresponding to an old offload name, show the feature using the old offload name. Where there are multiple features corresponding to an old offload name, show the features as a group, indented underneath it. Add some test cases to check that this works properly with or without the generic features API. (These may well be insufficient.) Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-02Report when offload feature changes are not exactly as requestedBen Hutchings2-22/+77
When an offload feature is enabled or disabled, this can change the state of other features that depend on it, or may itself be deferred if it depends on a feature that is disabled. Report when this happens, and fail if no offload features could be changed. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-02Regularise offload feature settingsBen Hutchings3-205/+110
This is partly preparation for use of the new net device features API, but is useful in its own right. Replace repetitive code for getting/setting offload flags with data- driven loops. This changes error messages to use the same long names for offload flags as in dump_offload(), and changes various exit codes to 1. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-02Add unit tests for setting offload features (old API)Ben Hutchings3-2/+158
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-01test: Add test_ioctl() function to support a mock send_ioctl()Ben Hutchings2-12/+68
test_ioctl() verifies an ethtool ioctl structure and either returns a canned response (if it was as expected) or aborts the test. Adjust the file redirection in test_cmdline() so that test_ioctl() can always print error messages. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-06-01Add output file parameter to dump_hex() and make it externBen Hutchings2-9/+12
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-05-23Run tests in-processBen Hutchings6-44/+332
Wrap main(), exit(), and resource management so that ethtool commands can be tested without starting a new process and without leaking. This will allow deeper teesting that covers ioctl requests and responses. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-05-23ethtool: Addition of -m option to dump module eepromStuart Hodgson6-1/+498
The -m option now allows for retrieval of EEPROM information form a plug in module such as SFP+. This shows specific information about the type and capabilities of the module in use The format can be easily extended to support other modules types such as QSFP in future. Raw data dump is also supported. Signed-off-by: Stuart Hodgson <smhodgson@solarflare.com> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-05-23ethtool: Split out printing of hex dataStuart Hodgson1-17/+18
Split out printing of hex data to common function from dump_regs and dump_eeprom. Ready for use by module eeprom dumping. Signed-off-by: Stuart Hodgson <smhodgson@solarflare.com> [bwh: Line up columns like the version in dump_eeprom(), not dump_regs()] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-05-23Add net_tstamp-copy.h to sources for automakeBen Hutchings1-1/+1
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-05-23Add the command to show the time stamping capabilities.Richard Cochran5-0/+228
Signed-off-by: Richard Cochran <richardcochran@gmail.com> [bwh: Rename the long option to '--show-time-stamping'] Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-05-15ethtool-copy.h: sync with net-nextBen Hutchings1-2/+70
This covers kernel changes up to: commit 41c3cb6d20f0252308e9796fa4f3dacb4960de91 Author: Stuart Hodgson <smhodgson@solarflare.com> Date: Thu Apr 19 09:44:42 2012 +0100 ethtool: Extend the ethtool API to obtain plugin module eeprom data Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-02-07ethtool.8: Add ntuple to the -K option in the man pageAmir Hanania1-0/+4
Signed-off-by: Amir Hanania <amir.hanania@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>
2012-01-21ethtool.8: Improve description of RX NFC optionsBen Hutchings1-4/+5
State explicitly that arguments beginning with 'flow-type' will insert or update a rule. Refer consistently to 'flow type' rather than 'network traffic type'. Refer to 'options and rules', covering both flow hashing and steering/filtering. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
2012-01-21ethtool.8: Don't mention the 'clear rule' action for NFC rulesBen Hutchings1-1/+0
The sfc driver implemented a 'clear rule' action as a means to delete a rule through the n-tuple API. This action is not valid or useful in the RX NFC API and it's probably confusing to mention it at all. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
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>