net: ethtool: require drivers to set supported_coalesce_params
Now that all in-tree drivers have been updated we can make the supported_coalesce_params mandatory. To save debugging time in case some driver was missed (or is out of tree) add a warning when netdev is registered with set_coalesce but without supported_coalesce_params. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
329bab6ea9
commit
9000edb71a
@@ -289,3 +289,14 @@ out:
|
||||
kfree(indir);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ethtool_check_ops(const struct ethtool_ops *ops)
|
||||
{
|
||||
if (WARN_ON(ops->set_coalesce && !ops->supported_coalesce_params))
|
||||
return -EINVAL;
|
||||
/* NOTE: sufficiently insane drivers may swap ethtool_ops at runtime,
|
||||
* the fact that ops are checked at registration time does not
|
||||
* mean the ops attached to a netdev later on are sane.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1519,9 +1519,6 @@ ethtool_set_coalesce_supported(struct net_device *dev,
|
||||
u32 supported_params = dev->ethtool_ops->supported_coalesce_params;
|
||||
u32 nonzero_params = 0;
|
||||
|
||||
if (!supported_params)
|
||||
return true;
|
||||
|
||||
if (coalesce->rx_coalesce_usecs)
|
||||
nonzero_params |= ETHTOOL_COALESCE_RX_USECS;
|
||||
if (coalesce->rx_max_coalesced_frames)
|
||||
|
Reference in New Issue
Block a user