2010-05-06 12:31:43 -07:00
|
|
|
#ifndef HAVE_SKB_WARN_LRO
|
2010-02-19 16:54:19 -05:00
|
|
|
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
|
2010-05-06 13:37:49 -07:00
|
|
|
#ifdef NETIF_F_LRO
|
2010-02-19 16:54:19 -05:00
|
|
|
#include <linux/ethtool.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* dev_disable_lro - disable Large Receive Offload on a device
|
|
|
|
* @dev: device
|
|
|
|
*
|
|
|
|
* Disable Large Receive Offload (LRO) on a net device. Must be
|
|
|
|
* called under RTNL. This is needed if received packets may be
|
|
|
|
* forwarded to another interface.
|
|
|
|
*/
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
WARN_ON(dev->features & NETIF_F_LRO);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* NETIF_F_LRO */
|
|
|
|
|
2010-05-06 12:31:43 -07:00
|
|
|
#endif /* HAVE_SKB_WARN_LRO */
|