Merge branch 'ethtool-consolidate-parameter-checking-for-irq-coalescing'
Jakub Kicinski says:
====================
ethtool: consolidate parameter checking for irq coalescing
This set aims to simplify and unify the unsupported irq
coalescing parameter handling.
First patch adds a bitmask which drivers should fill in
in their ethtool_ops structs to declare which parameters
they support. Core will then ensure that driver callback
won't see any parameter outside of that set.
This allows us to save some LoC and make sure all drivers
respond the same to unsupported parameters.
If any parameter driver does not support is set to a value
other than 0 core will return -EINVAL. In the future we can
reject any present but unsupported netlink attribute, without
assuming 0 means unset. We can also add some prints or extack,
perhaps a'la Intel's current code.
I started converting the drivers alphabetically but then
realized that for the first set it's probably best to
address a representative mix of actively developed drivers.
According to my unreliable math there are roughly 69 drivers
in the tree which support some form of interrupt coalescing
settings via ethtool. Of these roughly 17 reject parameters
they don't support.
I hope drivers which ignore the parameters don't care, and
won't care about the slight change in behavior. Once all
drivers are converted we can make the checking mandatory.
I've only tested the e1000e and virtio patches, the rest builds.
v2: fix up ice and virtio conversions
v3: (patch 1)
- 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)
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Showing
Please register or sign in to comment