Commit c3b89fbb authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

ipip: add GSO support

In commit 6b78f16e (gre: add GSO support) we added GSO support to GRE
tunnels.

This patch does the same for IPIP tunnels.

Performance of single TCP flow over an IPIP tunnel is increased by 40%
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Maciej Żenczykowski <maze@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d1ee40f9
...@@ -479,6 +479,10 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -479,6 +479,10 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb->protocol != htons(ETH_P_IP)) if (skb->protocol != htons(ETH_P_IP))
goto tx_error; goto tx_error;
if (skb->ip_summed == CHECKSUM_PARTIAL &&
skb_checksum_help(skb))
goto tx_error;
if (tos & 1) if (tos & 1)
tos = old_iph->tos; tos = old_iph->tos;
...@@ -773,6 +777,11 @@ static void ipip_dev_free(struct net_device *dev) ...@@ -773,6 +777,11 @@ static void ipip_dev_free(struct net_device *dev)
free_netdev(dev); free_netdev(dev);
} }
#define IPIP_FEATURES (NETIF_F_SG | \
NETIF_F_FRAGLIST | \
NETIF_F_HIGHDMA | \
NETIF_F_HW_CSUM)
static void ipip_tunnel_setup(struct net_device *dev) static void ipip_tunnel_setup(struct net_device *dev)
{ {
dev->netdev_ops = &ipip_netdev_ops; dev->netdev_ops = &ipip_netdev_ops;
...@@ -787,6 +796,9 @@ static void ipip_tunnel_setup(struct net_device *dev) ...@@ -787,6 +796,9 @@ static void ipip_tunnel_setup(struct net_device *dev)
dev->features |= NETIF_F_NETNS_LOCAL; dev->features |= NETIF_F_NETNS_LOCAL;
dev->features |= NETIF_F_LLTX; dev->features |= NETIF_F_LLTX;
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
dev->features |= IPIP_FEATURES;
dev->hw_features |= IPIP_FEATURES;
} }
static int ipip_tunnel_init(struct net_device *dev) static int ipip_tunnel_init(struct net_device *dev)
......
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