aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorJoseph Gasparakis <joseph.gasparakis@intel.com>2012-12-07 09:14:18 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-09 00:20:28 -0500
commit0afb1666fe4ed8e51083af544f00d31bc8753352 (patch)
treee08de4fe8935c4990cfbcb328a38754ed0ccc8a4 /drivers/net/vxlan.c
parentd6727fe3850de741b9a64e4a7069b536e380e2c6 (diff)
vxlan: Add capability of Rx checksum offload for inner packet
This patch adds capability in vxlan to identify received checksummed inner packets and signal them to the upper layers of the stack. The driver needs to set the skb->encapsulation bit and also set the skb->ip_summed to CHECKSUM_UNNECESSARY. Signed-off-by: Joseph Gasparakis <joseph.gasparakis@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r--drivers/net/vxlan.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 88b31f2453dd..3b3fdf648ea7 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -607,7 +607,17 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
607 607
608 __skb_tunnel_rx(skb, vxlan->dev); 608 __skb_tunnel_rx(skb, vxlan->dev);
609 skb_reset_network_header(skb); 609 skb_reset_network_header(skb);
610 skb->ip_summed = CHECKSUM_NONE; 610
611 /* If the NIC driver gave us an encapsulated packet with
612 * CHECKSUM_UNNECESSARY and Rx checksum feature is enabled,
613 * leave the CHECKSUM_UNNECESSARY, the device checksummed it
614 * for us. Otherwise force the upper layers to verify it.
615 */
616 if (skb->ip_summed != CHECKSUM_UNNECESSARY || !skb->encapsulation ||
617 !(vxlan->dev->features & NETIF_F_RXCSUM))
618 skb->ip_summed = CHECKSUM_NONE;
619
620 skb->encapsulation = 0;
611 621
612 err = IP_ECN_decapsulate(oip, skb); 622 err = IP_ECN_decapsulate(oip, skb);
613 if (unlikely(err)) { 623 if (unlikely(err)) {
@@ -1175,7 +1185,9 @@ static void vxlan_setup(struct net_device *dev)
1175 dev->features |= NETIF_F_LLTX; 1185 dev->features |= NETIF_F_LLTX;
1176 dev->features |= NETIF_F_NETNS_LOCAL; 1186 dev->features |= NETIF_F_NETNS_LOCAL;
1177 dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; 1187 dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
1178 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM; 1188 dev->features |= NETIF_F_RXCSUM;
1189
1190 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
1179 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; 1191 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
1180 1192
1181 spin_lock_init(&vxlan->hash_lock); 1193 spin_lock_init(&vxlan->hash_lock);