diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2010-06-29 22:44:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-30 17:09:35 -0400 |
commit | 1437ce3983bcbc0447a0dedcd644c14fe833d266 (patch) | |
tree | 073ba0dc60127b08b65fbcca4d0d7c15318c08f8 /drivers/net/ixgbe/ixgbe_ethtool.c | |
parent | b3003be36a3c9215cd17182349981581de269048 (diff) |
ethtool: Change ethtool_op_set_flags to validate flags
ethtool_op_set_flags() does not check for unsupported flags, and has
no way of doing so. This means it is not suitable for use as a
default implementation of ethtool_ops::set_flags.
Add a 'supported' parameter specifying the flags that the driver and
hardware support, validate the requested flags against this, and
change all current callers to pass this parameter.
Change some other trivial implementations of ethtool_ops::set_flags to
call ethtool_op_set_flags().
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 873b45efca40..7d2e5ea2deba 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -2205,8 +2205,11 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data) | |||
2205 | { | 2205 | { |
2206 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 2206 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
2207 | bool need_reset = false; | 2207 | bool need_reset = false; |
2208 | int rc; | ||
2208 | 2209 | ||
2209 | ethtool_op_set_flags(netdev, data); | 2210 | rc = ethtool_op_set_flags(netdev, data, ETH_FLAG_LRO | ETH_FLAG_NTUPLE); |
2211 | if (rc) | ||
2212 | return rc; | ||
2210 | 2213 | ||
2211 | /* if state changes we need to update adapter->flags and reset */ | 2214 | /* if state changes we need to update adapter->flags and reset */ |
2212 | if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) { | 2215 | if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE) { |