diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-03-18 12:56:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-22 04:00:26 -0400 |
commit | 27660515a21bf913e3208ded3f27abd0529fae0e (patch) | |
tree | e07baa50f459b227eff6aa0dfbb6041f501bfb90 | |
parent | 736561a01f11114146b1b7f82d486fa9c95828ef (diff) |
net: implement dev_disable_lro() hw_features compatibility
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>
-rw-r--r-- | include/linux/ethtool.h | 3 | ||||
-rw-r--r-- | net/core/dev.c | 19 | ||||
-rw-r--r-- | net/core/ethtool.c | 2 |
3 files changed, 15 insertions, 9 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index b297f288f6eb..ae757bcf1280 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -648,6 +648,9 @@ enum ethtool_sfeatures_retval_bits { | |||
648 | 648 | ||
649 | #include <linux/rculist.h> | 649 | #include <linux/rculist.h> |
650 | 650 | ||
651 | /* needed by dev_disable_lro() */ | ||
652 | extern int __ethtool_set_flags(struct net_device *dev, u32 flags); | ||
653 | |||
651 | struct ethtool_rx_ntuple_flow_spec_container { | 654 | struct ethtool_rx_ntuple_flow_spec_container { |
652 | struct ethtool_rx_ntuple_flow_spec fs; | 655 | struct ethtool_rx_ntuple_flow_spec fs; |
653 | struct list_head list; | 656 | struct list_head list; |
diff --git a/net/core/dev.c b/net/core/dev.c index 0b88eba97dab..f453370131a0 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1353,14 +1353,17 @@ EXPORT_SYMBOL(dev_close); | |||
1353 | */ | 1353 | */ |
1354 | void dev_disable_lro(struct net_device *dev) | 1354 | void dev_disable_lro(struct net_device *dev) |
1355 | { | 1355 | { |
1356 | if (dev->ethtool_ops && dev->ethtool_ops->get_flags && | 1356 | u32 flags; |
1357 | dev->ethtool_ops->set_flags) { | 1357 | |
1358 | u32 flags = dev->ethtool_ops->get_flags(dev); | 1358 | if (dev->ethtool_ops && dev->ethtool_ops->get_flags) |
1359 | if (flags & ETH_FLAG_LRO) { | 1359 | flags = dev->ethtool_ops->get_flags(dev); |
1360 | flags &= ~ETH_FLAG_LRO; | 1360 | else |
1361 | dev->ethtool_ops->set_flags(dev, flags); | 1361 | flags = ethtool_op_get_flags(dev); |
1362 | } | 1362 | |
1363 | } | 1363 | if (!(flags & ETH_FLAG_LRO)) |
1364 | return; | ||
1365 | |||
1366 | __ethtool_set_flags(dev, flags & ~ETH_FLAG_LRO); | ||
1364 | WARN_ON(dev->features & NETIF_F_LRO); | 1367 | WARN_ON(dev->features & NETIF_F_LRO); |
1365 | } | 1368 | } |
1366 | EXPORT_SYMBOL(dev_disable_lro); | 1369 | EXPORT_SYMBOL(dev_disable_lro); |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index a1086fb0c0c7..24bd57493c0d 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -513,7 +513,7 @@ static int ethtool_set_one_feature(struct net_device *dev, | |||
513 | } | 513 | } |
514 | } | 514 | } |
515 | 515 | ||
516 | static int __ethtool_set_flags(struct net_device *dev, u32 data) | 516 | int __ethtool_set_flags(struct net_device *dev, u32 data) |
517 | { | 517 | { |
518 | u32 changed; | 518 | u32 changed; |
519 | 519 | ||