Commit d0bc6555 authored by Or Gerlitz's avatar Or Gerlitz Committed by David S. Miller

net/vxlan: Share RX skb de-marking and checksum checks with ovs

Make sure the practice set by commit 0afb1666 "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 <joseph.gasparakis@intel.com>
Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 28f39ef6
...@@ -1159,6 +1159,16 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) ...@@ -1159,6 +1159,16 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
if (!vs) if (!vs)
goto drop; 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->ip_summed != CHECKSUM_PARTIAL) ||
!skb->encapsulation)
skb->ip_summed = CHECKSUM_NONE;
skb->encapsulation = 0;
vs->rcv(vs, skb, vxh->vx_vni); vs->rcv(vs, skb, vxh->vx_vni);
return 0; return 0;
...@@ -1217,17 +1227,6 @@ static void vxlan_rcv(struct vxlan_sock *vs, ...@@ -1217,17 +1227,6 @@ static void vxlan_rcv(struct vxlan_sock *vs,
skb_reset_network_header(skb); 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->ip_summed != CHECKSUM_PARTIAL) ||
!skb->encapsulation || !(vxlan->dev->features & NETIF_F_RXCSUM))
skb->ip_summed = CHECKSUM_NONE;
skb->encapsulation = 0;
if (oip6) if (oip6)
err = IP6_ECN_decapsulate(oip6, skb); err = IP6_ECN_decapsulate(oip6, skb);
if (oip) if (oip)
......
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