diff options
author | Joseph Gasparakis <joseph.gasparakis@intel.com> | 2012-12-07 09:14:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-09 00:20:28 -0500 |
commit | d6727fe3850de741b9a64e4a7069b536e380e2c6 (patch) | |
tree | 1a4b5d07535e9e7ed97d47f7a85430ebe824c1ff /drivers/net/vxlan.c | |
parent | fc70fb640b159f1d6bf5ad2321cd55e874c8d1b8 (diff) |
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: Joseph Gasparakis <joseph.gasparakis@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r-- | drivers/net/vxlan.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index ce77b8b693ae..88b31f2453dd 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -876,6 +876,11 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) | |||
876 | goto drop; | 876 | goto drop; |
877 | } | 877 | } |
878 | 878 | ||
879 | if (!skb->encapsulation) { | ||
880 | skb_reset_inner_headers(skb); | ||
881 | skb->encapsulation = 1; | ||
882 | } | ||
883 | |||
879 | /* Need space for new headers (invalidates iph ptr) */ | 884 | /* Need space for new headers (invalidates iph ptr) */ |
880 | if (skb_cow_head(skb, VXLAN_HEADROOM)) | 885 | if (skb_cow_head(skb, VXLAN_HEADROOM)) |
881 | goto drop; | 886 | goto drop; |
@@ -947,7 +952,8 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) | |||
947 | vxlan_set_owner(dev, skb); | 952 | vxlan_set_owner(dev, skb); |
948 | 953 | ||
949 | /* See iptunnel_xmit() */ | 954 | /* See iptunnel_xmit() */ |
950 | skb->ip_summed = CHECKSUM_NONE; | 955 | if (skb->ip_summed != CHECKSUM_PARTIAL) |
956 | skb->ip_summed = CHECKSUM_NONE; | ||
951 | ip_select_ident(iph, &rt->dst, NULL); | 957 | ip_select_ident(iph, &rt->dst, NULL); |
952 | 958 | ||
953 | err = ip_local_out(skb); | 959 | err = ip_local_out(skb); |
@@ -1168,6 +1174,8 @@ static void vxlan_setup(struct net_device *dev) | |||
1168 | dev->tx_queue_len = 0; | 1174 | dev->tx_queue_len = 0; |
1169 | dev->features |= NETIF_F_LLTX; | 1175 | dev->features |= NETIF_F_LLTX; |
1170 | dev->features |= NETIF_F_NETNS_LOCAL; | 1176 | dev->features |= NETIF_F_NETNS_LOCAL; |
1177 | dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; | ||
1178 | dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM; | ||
1171 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; | 1179 | dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; |
1172 | 1180 | ||
1173 | spin_lock_init(&vxlan->hash_lock); | 1181 | spin_lock_init(&vxlan->hash_lock); |