Commit d6727fe3 authored by Joseph Gasparakis's avatar Joseph Gasparakis Committed by David S. Miller

vxlan: capture inner headers during encapsulation

Allow VXLAN to make use of Tx checksum offloading and Tx scatter-gather.
The advantage to these two changes is that it also allows the VXLAN to
make use of GSO.
Signed-off-by: default avatarJoseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc70fb64
...@@ -876,6 +876,11 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -876,6 +876,11 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
goto drop; goto drop;
} }
if (!skb->encapsulation) {
skb_reset_inner_headers(skb);
skb->encapsulation = 1;
}
/* Need space for new headers (invalidates iph ptr) */ /* Need space for new headers (invalidates iph ptr) */
if (skb_cow_head(skb, VXLAN_HEADROOM)) if (skb_cow_head(skb, VXLAN_HEADROOM))
goto drop; goto drop;
...@@ -947,7 +952,8 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -947,7 +952,8 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)
vxlan_set_owner(dev, skb); vxlan_set_owner(dev, skb);
/* See iptunnel_xmit() */ /* See iptunnel_xmit() */
skb->ip_summed = CHECKSUM_NONE; if (skb->ip_summed != CHECKSUM_PARTIAL)
skb->ip_summed = CHECKSUM_NONE;
ip_select_ident(iph, &rt->dst, NULL); ip_select_ident(iph, &rt->dst, NULL);
err = ip_local_out(skb); err = ip_local_out(skb);
...@@ -1168,6 +1174,8 @@ static void vxlan_setup(struct net_device *dev) ...@@ -1168,6 +1174,8 @@ static void vxlan_setup(struct net_device *dev)
dev->tx_queue_len = 0; dev->tx_queue_len = 0;
dev->features |= NETIF_F_LLTX; dev->features |= NETIF_F_LLTX;
dev->features |= NETIF_F_NETNS_LOCAL; dev->features |= NETIF_F_NETNS_LOCAL;
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
spin_lock_init(&vxlan->hash_lock); spin_lock_init(&vxlan->hash_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment