aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipip.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-10-19 14:42:57 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-19 19:36:19 -0400
commitcb32f511a70be8967ac9025cf49c44324ced9a39 (patch)
tree9e3fa3245096053bcf67cc61b60a72f3bb946008 /net/ipv4/ipip.c
parent3347c960295583eee3fd58e5c539fb1972fbc005 (diff)
ipip: add GSO/TSO support
Now inet_gso_segment() is stackable, its relatively easy to implement GSO/TSO support for IPIP Performance results, when segmentation is done after tunnel device (as no NIC is yet enabled for TSO IPIP support) : Before patch : lpq83:~# ./netperf -H 7.7.9.84 -Cc MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.9.84 () port 0 AF_INET Recv Send Send Utilization Service Demand Socket Socket Message Elapsed Send Recv Send Recv Size Size Size Time Throughput local remote local remote bytes bytes bytes secs. 10^6bits/s % S % S us/KB us/KB 87380 16384 16384 10.00 3357.88 5.09 3.70 2.983 2.167 After patch : lpq83:~# ./netperf -H 7.7.9.84 -Cc MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.9.84 () port 0 AF_INET Recv Send Send Utilization Service Demand Socket Socket Message Elapsed Send Recv Send Recv Size Size Size Time Throughput local remote local remote bytes bytes bytes secs. 10^6bits/s % S % S us/KB us/KB 87380 16384 16384 10.00 7710.19 4.52 6.62 1.152 1.687 Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r--net/ipv4/ipip.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
index 7f80fb4b82d3..fe3e9f7f1f0b 100644
--- a/net/ipv4/ipip.c
+++ b/net/ipv4/ipip.c
@@ -220,17 +220,17 @@ static netdev_tx_t ipip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
220 if (unlikely(skb->protocol != htons(ETH_P_IP))) 220 if (unlikely(skb->protocol != htons(ETH_P_IP)))
221 goto tx_error; 221 goto tx_error;
222 222
223 if (likely(!skb->encapsulation)) { 223 skb = iptunnel_handle_offloads(skb, false, SKB_GSO_IPIP);
224 skb_reset_inner_headers(skb); 224 if (IS_ERR(skb))
225 skb->encapsulation = 1; 225 goto out;
226 }
227 226
228 ip_tunnel_xmit(skb, dev, tiph, tiph->protocol); 227 ip_tunnel_xmit(skb, dev, tiph, tiph->protocol);
229 return NETDEV_TX_OK; 228 return NETDEV_TX_OK;
230 229
231tx_error: 230tx_error:
232 dev->stats.tx_errors++;
233 dev_kfree_skb(skb); 231 dev_kfree_skb(skb);
232out:
233 dev->stats.tx_errors++;
234 return NETDEV_TX_OK; 234 return NETDEV_TX_OK;
235} 235}
236 236
@@ -275,6 +275,7 @@ static const struct net_device_ops ipip_netdev_ops = {
275#define IPIP_FEATURES (NETIF_F_SG | \ 275#define IPIP_FEATURES (NETIF_F_SG | \
276 NETIF_F_FRAGLIST | \ 276 NETIF_F_FRAGLIST | \
277 NETIF_F_HIGHDMA | \ 277 NETIF_F_HIGHDMA | \
278 NETIF_F_GSO_SOFTWARE | \
278 NETIF_F_HW_CSUM) 279 NETIF_F_HW_CSUM)
279 280
280static void ipip_tunnel_setup(struct net_device *dev) 281static void ipip_tunnel_setup(struct net_device *dev)