1 #include <linux/if_bridge.h>
2 #include <linux/netdevice.h>
3 #include <linux/version.h>
4 #include <net/rtnetlink.h>
8 #include "vport-internal_dev.h"
9 #include "vport-netdev.h"
11 #ifndef HAVE_DEV_DISABLE_LRO
14 #include <linux/ethtool.h>
17 * dev_disable_lro - disable Large Receive Offload on a device
20 * Disable Large Receive Offload (LRO) on a net device. Must be
21 * called under RTNL. This is needed if received packets may be
22 * forwarded to another interface.
24 void dev_disable_lro(struct net_device *dev)
26 if (dev->ethtool_ops && dev->ethtool_ops->get_flags &&
27 dev->ethtool_ops->set_flags) {
28 u32 flags = dev->ethtool_ops->get_flags(dev);
29 if (flags & ETH_FLAG_LRO) {
30 flags &= ~ETH_FLAG_LRO;
31 dev->ethtool_ops->set_flags(dev, flags);
34 WARN_ON(dev->features & NETIF_F_LRO);
37 void dev_disable_lro(struct net_device *dev) { }
38 #endif /* NETIF_F_LRO */
40 #endif /* HAVE_DEV_DISABLE_LRO */
42 int rpl_rtnl_delete_link(struct net_device *dev)
44 const struct rtnl_link_ops *ops;
46 ops = dev->rtnl_link_ops;
47 if (!ops || !ops->dellink)
50 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
56 ops->dellink(dev, &list_kill);
57 unregister_netdevice_many(&list_kill);
63 #ifndef USE_UPSTREAM_TUNNEL
64 int ovs_dev_fill_metadata_dst(struct net_device *dev, struct sk_buff *skb)
66 struct ip_tunnel_info *info;
69 if (!SKB_SETUP_FILL_METADATA_DST(skb))
72 vport = ovs_netdev_get_vport(dev);
76 if (!vport->ops->fill_metadata_dst)
79 info = skb_tunnel_info(skb);
82 if (unlikely(!(info->mode & IP_TUNNEL_INFO_TX)))
85 return vport->ops->fill_metadata_dst(dev, skb);
87 EXPORT_SYMBOL_GPL(ovs_dev_fill_metadata_dst);