]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: implement dev_disable_lro() hw_features compatibility
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Fri, 18 Mar 2011 16:56:34 +0000 (16:56 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Mar 2011 08:00:26 +0000 (01:00 -0700)
Implement compatibility with new hw_features for dev_disable_lro().
This is a transition path - dev_disable_lro() should be later
integrated into netdev_fix_features() after all drivers are converted.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/ethtool.h
net/core/dev.c
net/core/ethtool.c

index b297f288f6eb837415982d4eef6b3cb3fe2eb1dd..ae757bcf128035d08d4fd65540d2f5539492385b 100644 (file)
@@ -648,6 +648,9 @@ enum ethtool_sfeatures_retval_bits {
 
 #include <linux/rculist.h>
 
+/* needed by dev_disable_lro() */
+extern int __ethtool_set_flags(struct net_device *dev, u32 flags);
+
 struct ethtool_rx_ntuple_flow_spec_container {
        struct ethtool_rx_ntuple_flow_spec fs;
        struct list_head list;
index 0b88eba97dabcf59d12e1c0735dea04088cac8fe..f453370131a0df665ae8361661a9cb1d6a849cce 100644 (file)
@@ -1353,14 +1353,17 @@ EXPORT_SYMBOL(dev_close);
  */
 void dev_disable_lro(struct net_device *dev)
 {
-       if (dev->ethtool_ops && dev->ethtool_ops->get_flags &&
-           dev->ethtool_ops->set_flags) {
-               u32 flags = dev->ethtool_ops->get_flags(dev);
-               if (flags & ETH_FLAG_LRO) {
-                       flags &= ~ETH_FLAG_LRO;
-                       dev->ethtool_ops->set_flags(dev, flags);
-               }
-       }
+       u32 flags;
+
+       if (dev->ethtool_ops && dev->ethtool_ops->get_flags)
+               flags = dev->ethtool_ops->get_flags(dev);
+       else
+               flags = ethtool_op_get_flags(dev);
+
+       if (!(flags & ETH_FLAG_LRO))
+               return;
+
+       __ethtool_set_flags(dev, flags & ~ETH_FLAG_LRO);
        WARN_ON(dev->features & NETIF_F_LRO);
 }
 EXPORT_SYMBOL(dev_disable_lro);
index a1086fb0c0c7d0929db5a3f2f9cdae42d540c814..24bd57493c0d602d38259b6111a6780611ca46fd 100644 (file)
@@ -513,7 +513,7 @@ static int ethtool_set_one_feature(struct net_device *dev,
        }
 }
 
-static int __ethtool_set_flags(struct net_device *dev, u32 data)
+int __ethtool_set_flags(struct net_device *dev, u32 data)
 {
        u32 changed;