From 7da69d2cbd4bcf50d3ea2b930829a2e4b7001c03 Mon Sep 17 00:00:00 2001 From: Or Gerlitz Date: Thu, 23 Jan 2014 11:28:13 +0200 Subject: [PATCH] net/vxlan: Share RX skb de-marking and checksum checks with ovs [ Upstream commit d0bc65557ad09a57b4db176e9e3ccddb26971453 ] Make sure the practice set by commit 0afb166 "vxlan: Add capability of Rx checksum offload for inner packet" is applied when the skb goes through the portion of the RX code which is shared between vxlan netdevices and ovs vxlan port instances. Cc: Joseph Gasparakis Cc: Pravin B Shelar Signed-off-by: Or Gerlitz Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/vxlan.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 146236891889..32c45c3d820d 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -1051,6 +1051,15 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) if (!vs) goto drop; + /* If the NIC driver gave us an encapsulated packet + * with the encapsulation mark, the device checksummed it + * for us. Otherwise force the upper layers to verify it. + */ + if (skb->ip_summed != CHECKSUM_UNNECESSARY || !skb->encapsulation) + skb->ip_summed = CHECKSUM_NONE; + + skb->encapsulation = 0; + vs->rcv(vs, skb, vxh->vx_vni); return 0; @@ -1109,17 +1118,6 @@ static void vxlan_rcv(struct vxlan_sock *vs, skb_reset_network_header(skb); - /* If the NIC driver gave us an encapsulated packet with - * CHECKSUM_UNNECESSARY and Rx checksum feature is enabled, - * leave the CHECKSUM_UNNECESSARY, the device checksummed it - * for us. Otherwise force the upper layers to verify it. - */ - if (skb->ip_summed != CHECKSUM_UNNECESSARY || !skb->encapsulation || - !(vxlan->dev->features & NETIF_F_RXCSUM)) - skb->ip_summed = CHECKSUM_NONE; - - skb->encapsulation = 0; - if (oip6) err = IP6_ECN_decapsulate(oip6, skb); if (oip) -- 2.34.1