summaryrefslogtreecommitdiff
path: root/test-features.c
AgeCommit message (Collapse)AuthorFilesLines
2012-06-13ethtool: Handle more errors when getting feature namesBen Hutchings1-0/+28
'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 Hutchings1-6/+339
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 Hutchings1-2/+32
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 Hutchings1-3/+3
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 Hutchings1-0/+153
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>