Age | Commit message (Collapse) | Author | Files | Lines |
|
vSwitch configurations.
Signed-off-by: Yan Burman <yanb@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
The current output of -m has been modified so that everything lines up
correctly.
The --module-info option alias has been added.
Signed-off-by: Aurelien Guillaume <aurelien@iwi.me>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
The et131x register set contains useful details of RX/TX queues for
the device. This dumps them with the -d option.
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
If we have a pretty-printer matching the driver name for a register
dump, but it doesn't handle the reported dump version, then we
currently fail and print:
Cannot dump registers: Success
Instead, fall back to hex dump. Also, don't use perror() to explain a
failure of dump_regs(). errno is not meaningful in either failure
case.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
When setting EEE parameters with the --set-eee command line option,
ethtool will send the ETHTOOL_SEEE ioctl down to the driver even if
none of the provided parameters are a change from current settings.
Simply ignore it when that happens as done with other ethtool commands.
Signed-off-by: Bruce Allan <bruce.w.allan@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>
|
|
There are bits in this bitfield that we want to leave untouched (PAUSE
and ASYM_PAUSE bits) when changing other bits (speed and duplex bits.)
Previously, these were always overwritten to zero when running commands
like "ethtool -s eth0 speed 10 duplex full autoneg off".
Signed-off-by: Johan Gunnarsson <johangu@axis.com>
[bwh: Fixed spelling and formatting]
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
A bit ago ethtool added support for reading MDI-X state, this
patch finishes the implementation, adding the complementary write
command.
Add support to ethtool for controlling the MDI-X (crossover)
state of a network port. Most adapters correctly negotiate
MDI-X, but some ill-behaved switches have trouble and end up
picking the wrong MDI setting, which results in complete loss of
link. Usually this error condition can be observed when multiple
ethtool -r ethX are required before link is achieved.
This patch allows the user to override the normal "auto" setting
and force the crossover state to on or off.
The set will fail if the driver doesn't support the get, as
suggested by Ben Hutchings.
setting MDI not supported
In addition the do_gset output was changed slightly to report the
value set by the user (when the driver supports the set)
old:
MDI-X: on
new:
MDI-X: on (auto)
or
MDI-X: on (forced)
usage is ethtool -s eth0 mdix [auto|on|off]
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Ben Hutchings <bhutchings@solarflare.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>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
'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>
|
|
This removes lots of repeated code and makes it trivial to support
additional modes.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
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>
|
|
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
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>
|
|
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
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>
|
|
cmdline_ring and cmdline_channels have the same array size, so this
just happened to work.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
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>
|
|
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>
|
|
Preparation for refactoring command-line parsing.
All these test cases pass.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
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>
|
|
Also put the whole of the help string on a line of its own where
necessary.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
|
|
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
|
|
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>
|