Skip to content

Commit

Permalink
net/vxlan: Share RX skb de-marking and checksum checks with ovs
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Pravin B Shelar <[email protected]>
Signed-off-by: Or Gerlitz <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ogerlitz authored and davem330 committed Jan 23, 2014
1 parent 28f39ef commit d0bc655
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,16 @@ 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->ip_summed != CHECKSUM_PARTIAL) ||
!skb->encapsulation)
skb->ip_summed = CHECKSUM_NONE;

skb->encapsulation = 0;

vs->rcv(vs, skb, vxh->vx_vni);
return 0;

Expand Down Expand Up @@ -1217,17 +1227,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->ip_summed != CHECKSUM_PARTIAL) ||
!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)
Expand Down

0 comments on commit d0bc655

Please sign in to comment.