1 #ifndef HAVE_DEV_DISABLE_LRO
3 #include <linux/netdevice.h>
6 #include <linux/ethtool.h>
9 * dev_disable_lro - disable Large Receive Offload on a device
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.
16 void dev_disable_lro(struct net_device *dev)
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);
26 WARN_ON(dev->features & NETIF_F_LRO);
29 void dev_disable_lro(struct net_device *dev) { }
30 #endif /* NETIF_F_LRO */
32 #endif /* HAVE_DEV_DISABLE_LRO */