]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
Merge branch 'ethtool-consolidate-parameter-checking-for-irq-coalescing'
authorDavid S. Miller <davem@davemloft.net>
Thu, 5 Mar 2020 20:12:35 +0000 (12:12 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Mar 2020 20:12:35 +0000 (12:12 -0800)
commitf3588909c18553e0a9d69fc7832a606681f59048
tree05912b7f3192e4a8f8c77228f6c42552ea05cd0e
parent56dc0a0eac999b77b1d37fe83a3c0409a6066319
parenta51e520653a635051298532a2066c3346d6acd29
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>