]> git.proxmox.com Git - mirror_ovs.git/blob - datapath/linux/compat/dev-openvswitch.c
datapath: Rename linux-2.6 and compat-2.6 directories.
[mirror_ovs.git] / datapath / linux / compat / dev-openvswitch.c
1 #ifndef HAVE_DEV_DISABLE_LRO
2
3 #include <linux/netdevice.h>
4
5 #ifdef NETIF_F_LRO
6 #include <linux/ethtool.h>
7
8 /**
9 * dev_disable_lro - disable Large Receive Offload on a device
10 * @dev: device
11 *
12 * Disable Large Receive Offload (LRO) on a net device. Must be
13 * called under RTNL. This is needed if received packets may be
14 * forwarded to another interface.
15 */
16 void dev_disable_lro(struct net_device *dev)
17 {
18 if (dev->ethtool_ops && dev->ethtool_ops->get_flags &&
19 dev->ethtool_ops->set_flags) {
20 u32 flags = dev->ethtool_ops->get_flags(dev);
21 if (flags & ETH_FLAG_LRO) {
22 flags &= ~ETH_FLAG_LRO;
23 dev->ethtool_ops->set_flags(dev, flags);
24 }
25 }
26 WARN_ON(dev->features & NETIF_F_LRO);
27 }
28 #else
29 void dev_disable_lro(struct net_device *dev) { }
30 #endif /* NETIF_F_LRO */
31
32 #endif /* HAVE_DEV_DISABLE_LRO */