linux/net/ethtool
Jakub Kicinski 95cddcb5cc ethtool: add infrastructure for centralized checking of coalescing parameters
Linux supports 22 different interrupt coalescing parameters.
No driver implements them all. Some drivers just ignore the
ones they don't support, while others have to carry a long
list of checks to reject unsupported settings.

To simplify the drivers add the ability to specify inside
ethtool_ops which parameters are supported and let the core
reject attempts to set any other one.

This commit makes the mechanism an opt-in, only drivers which
set ethtool_opts->coalesce_types to a non-zero value will have
the checks enforced.

The same mask is used for global and per queue settings.

v3: - move the (temporary) check if driver defines types
      earlier (Michal)
    - rename used_types -> nonzero_params, and
      coalesce_types -> supported_coalesce_params (Alex)
    - use EOPNOTSUPP instead of EINVAL (Andrew, Michal)

Leaving the long series of ifs for now, it seems nice to
be able to grep for the field and flag names. This will
probably have to be revisited once netlink support lands.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-05 12:12:34 -08:00
..
bitset.c ethtool: limit bitset size 2020-02-26 11:27:31 -08:00
bitset.h ethtool: limit bitset size 2020-02-26 11:27:31 -08:00
common.c ethtool: Add support for low latency RS FEC 2020-02-18 19:17:31 -08:00
common.h ethtool: provide WoL settings with WOL_GET request 2020-01-27 11:31:36 +01:00
debug.c ethtool: add DEBUG_NTF notification 2020-01-27 11:31:36 +01:00
ioctl.c ethtool: add infrastructure for centralized checking of coalescing parameters 2020-03-05 12:12:34 -08:00
linkinfo.c ethtool: add LINKINFO_NTF notification 2019-12-27 16:40:02 -08:00
linkmodes.c ethtool: Add support for low latency RS FEC 2020-02-18 19:17:31 -08:00
linkstate.c ethtool: provide link state with LINKSTATE_GET request 2019-12-27 16:40:02 -08:00
Makefile ethtool: provide WoL settings with WOL_GET request 2020-01-27 11:31:36 +01:00
netlink.c ethtool: add WOL_NTF notification 2020-01-27 11:31:36 +01:00
netlink.h ethtool: set wake-on-lan settings with WOL_SET request 2020-01-27 11:31:36 +01:00
strset.c ethtool: provide WoL settings with WOL_GET request 2020-01-27 11:31:36 +01:00
wol.c ethtool: add WOL_NTF notification 2020-01-27 11:31:36 +01:00