mirror of
https://github.com/openvswitch/ovs
synced 2025-09-05 16:55:42 +00:00
The linux-2.6 and compat-2.6 directories apply equally to the upcoming Linux 3.0 release, so this drops the 2.6 suffix and updates Makefiles. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
33 lines
813 B
C
33 lines
813 B
C
#ifndef HAVE_DEV_DISABLE_LRO
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
#ifdef NETIF_F_LRO
|
|
#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);
|
|
}
|
|
#else
|
|
void dev_disable_lro(struct net_device *dev) { }
|
|
#endif /* NETIF_F_LRO */
|
|
|
|
#endif /* HAVE_DEV_DISABLE_LRO */
|