X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=datapath%2Fvport-netdev.c;h=2a83f730a01f067744a6788b62a2642c0657c7af;hb=b2f2acd543f159ba984a00059892917933612a10;hp=4bc16175c92256cf2935fdc29e640574922d63cd;hpb=2b51596fdeba7fbf4caff323dd6af375e7f84596;p=sliver-openvswitch.git diff --git a/datapath/vport-netdev.c b/datapath/vport-netdev.c index 4bc16175c..2a83f730a 100644 --- a/datapath/vport-netdev.c +++ b/datapath/vport-netdev.c @@ -29,23 +29,11 @@ #include -#include "checksum.h" #include "datapath.h" #include "vlan.h" #include "vport-internal_dev.h" #include "vport-netdev.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) && \ - !defined(HAVE_VLAN_BUG_WORKAROUND) -#include - -static int vlan_tso __read_mostly; -module_param(vlan_tso, int, 0644); -MODULE_PARM_DESC(vlan_tso, "Enable TSO for VLAN packets"); -#else -#define vlan_tso true -#endif - static void netdev_port_receive(struct vport *vport, struct sk_buff *skb); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) @@ -80,7 +68,7 @@ static struct sk_buff *netdev_frame_hook(struct sk_buff *skb) return NULL; } -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) /* * Used as br_handle_frame_hook. (Cannot run bridge at the same time, even on * different set of devices!) @@ -92,17 +80,6 @@ static struct sk_buff *netdev_frame_hook(struct net_bridge_port *p, netdev_port_receive((struct vport *)p, skb); return NULL; } -#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) -/* - * Used as br_handle_frame_hook. (Cannot run bridge at the same time, even on - * different set of devices!) - */ -/* Called with rcu_read_lock and bottom-halves disabled. */ -static int netdev_frame_hook(struct net_bridge_port *p, struct sk_buff **pskb) -{ - netdev_port_receive((struct vport *)p, *pskb); - return 1; -} #else #error #endif @@ -186,9 +163,6 @@ static struct vport *netdev_create(const struct vport_parms *parms) goto error_master_upper_dev_unlink; dev_set_promiscuity(netdev_vport->dev, 1); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) - dev_disable_lro(netdev_vport->dev); -#endif netdev_vport->dev->priv_flags |= IFF_OVS_DATAPATH; rtnl_unlock(); @@ -254,14 +228,9 @@ static void netdev_port_receive(struct vport *vport, struct sk_buff *skb) if (unlikely(!skb)) return; - if (unlikely(compute_ip_summed(skb, false))) - goto error; - skb_push(skb, ETH_HLEN); ovs_skb_postpush_rcsum(skb, skb->data, ETH_HLEN); - vlan_copy_skb_tci(skb); - ovs_vport_receive(vport, skb, NULL); return; @@ -279,19 +248,6 @@ static unsigned int packet_length(const struct sk_buff *skb) return length; } -static bool dev_supports_vlan_tx(struct net_device *dev) -{ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) - /* Software fallback means every device supports vlan_tci on TX. */ - return true; -#elif defined(HAVE_VLAN_BUG_WORKAROUND) - return dev->features & NETIF_F_HW_VLAN_TX; -#else - /* Assume that the driver is buggy. */ - return false; -#endif -} - static int netdev_send(struct vport *vport, struct sk_buff *skb) { struct netdev_vport *netdev_vport = netdev_vport_priv(vport); @@ -306,60 +262,6 @@ static int netdev_send(struct vport *vport, struct sk_buff *skb) } skb->dev = netdev_vport->dev; - forward_ip_summed(skb, true); - - if (vlan_tx_tag_present(skb) && !dev_supports_vlan_tx(skb->dev)) { - int features; - - features = netif_skb_features(skb); - - if (!vlan_tso) - features &= ~(NETIF_F_TSO | NETIF_F_TSO6 | - NETIF_F_UFO | NETIF_F_FSO); - - if (netif_needs_gso(skb, features)) { - struct sk_buff *nskb; - - nskb = skb_gso_segment(skb, features); - if (!nskb) { - if (unlikely(skb_cloned(skb) && - pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) - goto drop; - - skb_shinfo(skb)->gso_type &= ~SKB_GSO_DODGY; - goto tag; - } - - if (IS_ERR(nskb)) - goto drop; - consume_skb(skb); - skb = nskb; - - len = 0; - do { - nskb = skb->next; - skb->next = NULL; - - skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb)); - if (likely(skb)) { - len += skb->len; - vlan_set_tci(skb, 0); - dev_queue_xmit(skb); - } - - skb = nskb; - } while (skb); - - return len; - } - -tag: - skb = __vlan_put_tag(skb, vlan_tx_tag_get(skb)); - if (unlikely(!skb)) - return 0; - vlan_set_tci(skb, 0); - } - len = skb->len; dev_queue_xmit(skb);