Skip to content

Commit

Permalink
gre: add GSO support
Browse files Browse the repository at this point in the history
Add GSO support to GRE tunnels.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Maciej Żenczykowski <maze@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Sep 19, 2012
1 parent 2c60db0 commit 6b78f16
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,10 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
__be32 dst;
int mtu;

if (skb->ip_summed == CHECKSUM_PARTIAL &&
skb_checksum_help(skb))
goto tx_error;

if (dev->type == ARPHRD_ETHER)
IPCB(skb)->flags = 0;

Expand Down Expand Up @@ -1296,6 +1300,11 @@ static void ipgre_dev_free(struct net_device *dev)
free_netdev(dev);
}

#define GRE_FEATURES (NETIF_F_SG | \
NETIF_F_FRAGLIST | \
NETIF_F_HIGHDMA | \
NETIF_F_HW_CSUM)

static void ipgre_tunnel_setup(struct net_device *dev)
{
dev->netdev_ops = &ipgre_netdev_ops;
Expand All @@ -1309,6 +1318,9 @@ static void ipgre_tunnel_setup(struct net_device *dev)
dev->addr_len = 4;
dev->features |= NETIF_F_NETNS_LOCAL;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;

dev->features |= GRE_FEATURES;
dev->hw_features |= GRE_FEATURES;
}

static int ipgre_tunnel_init(struct net_device *dev)
Expand Down

0 comments on commit 6b78f16

Please sign in to comment.