Commit 27660515 authored by Michał Mirosław's avatar Michał Mirosław Committed by David S. Miller

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: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 736561a0
...@@ -648,6 +648,9 @@ enum ethtool_sfeatures_retval_bits { ...@@ -648,6 +648,9 @@ enum ethtool_sfeatures_retval_bits {
#include <linux/rculist.h> #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_container {
struct ethtool_rx_ntuple_flow_spec fs; struct ethtool_rx_ntuple_flow_spec fs;
struct list_head list; struct list_head list;
......
...@@ -1353,14 +1353,17 @@ EXPORT_SYMBOL(dev_close); ...@@ -1353,14 +1353,17 @@ EXPORT_SYMBOL(dev_close);
*/ */
void dev_disable_lro(struct net_device *dev) void dev_disable_lro(struct net_device *dev)
{ {
if (dev->ethtool_ops && dev->ethtool_ops->get_flags && u32 flags;
dev->ethtool_ops->set_flags) {
u32 flags = dev->ethtool_ops->get_flags(dev); if (dev->ethtool_ops && dev->ethtool_ops->get_flags)
if (flags & ETH_FLAG_LRO) { flags = dev->ethtool_ops->get_flags(dev);
flags &= ~ETH_FLAG_LRO; else
dev->ethtool_ops->set_flags(dev, flags); 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); WARN_ON(dev->features & NETIF_F_LRO);
} }
EXPORT_SYMBOL(dev_disable_lro); EXPORT_SYMBOL(dev_disable_lro);
......
...@@ -513,7 +513,7 @@ static int ethtool_set_one_feature(struct net_device *dev, ...@@ -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; u32 changed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment