aboutsummaryrefslogtreecommitdiff
path: root/test-features.c
AgeCommit message (Collapse)Author
2016-03-13test-features.c: add braces around array initializationMaciej Żenczykowski
This fixes: test-features.c:21:1: error: missing braces around initializer [-Werror=missing-braces] cmd_gssetinfo = { { ETHTOOL_GSSET_INFO, 0, 1ULL << ETH_SS_FEATURES }, 34 }; ^ Signed-off-by: Maciej Żenczykowski <maze@google.com> Signed-off-by: David Decotigny <decot@googlers.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2012-06-13ethtool: Handle more errors when getting feature namesBen Hutchings
'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-02Change -k/-K options to use ETHTOOL_{G,S}FEATURESBen Hutchings
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 Hutchings
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 Hutchings
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 Hutchings
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>