Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 368159
b: refs/heads/master
c: 05c0db0
h: refs/heads/master
i:
  368157: c6f9f90
  368155: 45bcfa1
  368151: c9b4f22
  368143: 3df40c4
  368127: ce02e51
v: v3
  • Loading branch information
Pravin B Shelar authored and David S. Miller committed Mar 9, 2013
1 parent ec26168 commit 7899928
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 731362674580cb0c696cd1b1a03d8461a10cf90a
refs/heads/master: 05c0db08abb82a11e50c1a66392b21bb15aee9cd
21 changes: 18 additions & 3 deletions trunk/drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,20 @@ static u16 vxlan_src_port(const struct vxlan_dev *vxlan, struct sk_buff *skb)
return (((u64) hash * range) >> 32) + vxlan->port_min;
}

static int handle_offloads(struct sk_buff *skb)
{
if (skb_is_gso(skb)) {
int err = skb_unclone(skb, GFP_ATOMIC);
if (unlikely(err))
return err;

skb_shinfo(skb)->gso_type |= (SKB_GSO_UDP_TUNNEL | SKB_GSO_UDP);
} else if (skb->ip_summed != CHECKSUM_PARTIAL)
skb->ip_summed = CHECKSUM_NONE;

return 0;
}

/* Transmit local packets over Vxlan
*
* Outer IP header inherits ECN and DF from inner header.
Expand Down Expand Up @@ -963,9 +977,8 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev)

vxlan_set_owner(dev, skb);

/* See iptunnel_xmit() */
if (skb->ip_summed != CHECKSUM_PARTIAL)
skb->ip_summed = CHECKSUM_NONE;
if (handle_offloads(skb))
goto drop;

err = ip_local_out(skb);
if (likely(net_xmit_eval(err) == 0)) {
Expand Down Expand Up @@ -1187,8 +1200,10 @@ static void vxlan_setup(struct net_device *dev)
dev->features |= NETIF_F_NETNS_LOCAL;
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
dev->features |= NETIF_F_RXCSUM;
dev->features |= NETIF_F_GSO_SOFTWARE;

dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
dev->hw_features |= NETIF_F_GSO_SOFTWARE;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;

Expand Down

0 comments on commit 7899928

Please sign in to comment.