netlink: add netlink handler for sfeatures (-K)

Implement "ethtool -K <dev> ..." subcommand to set netdev feature flags
using ETHTOOL_MSG_FEATURES_SET netlink message. These are traditionally set
using ETHTOOL_SFEATURES ioctl request (and some older ones).

Unlike with ioctl, an attempt to set a value of a "group flag" (e.g. "tso"
or "txcsum") translates to a request to set all features in that group
(rather than letting kernel to do that); this can be a different set of
features than kernel uses (kernel fix is going to be submitted soon).

Output of the command also explicitly marks features with values changed
without being requested (e.g. because of dependencies).

Signed-off-by: Michal Kubecek <>
5 files changed