From: David S. Miller Date: Thu, 5 Mar 2020 20:12:35 +0000 (-0800) Subject: Merge branch 'ethtool-consolidate-parameter-checking-for-irq-coalescing' X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f3588909c18553e0a9d69fc7832a606681f59048;p=openwrt%2Fstaging%2Fblogic.git 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 --- f3588909c18553e0a9d69fc7832a606681f59048