aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2013-07-10 20:05:06 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-11 15:18:49 -0400
commitcdbaa0bb26d8116d00be24e6b49043777b382f3a (patch)
tree51f4ebf87605daf9637d6ef5f36e7e1f80768aa1 /net/ipv4/udp.c
parent3b8ccd447375acebed9af0a3798e1ab4e58bedf4 (diff)
gso: Update tunnel segmentation to support Tx checksum offload
This change makes it so that the GRE and VXLAN tunnels can make use of Tx checksum offload support provided by some drivers via the hw_enc_features. Without this fix enabling GSO means sacrificing Tx checksum offload and this actually leads to a performance regression as shown below: Utilization Send Throughput local GSO 10^6bits/s % S state 6276.51 8.39 enabled 7123.52 8.42 disabled To resolve this it was necessary to address two items. First netif_skb_features needed to be updated so that it would correctly handle the Trans Ether Bridging protocol without impacting the need to check for Q-in-Q tagging. To do this it was necessary to update harmonize_features so that it used skb_network_protocol instead of just using the outer protocol. Second it was necessary to update the GRE and UDP tunnel segmentation offloads so that they would reset the encapsulation bit and inner header offsets after the offload was complete. As a result of this change I have seen the following results on a interface with Tx checksum enabled for encapsulated frames: Utilization Send Throughput local GSO 10^6bits/s % S state 7123.52 8.42 disabled 8321.75 5.43 enabled v2: Instead of replacing refrence to skb->protocol with skb_network_protocol just replace the protocol reference in harmonize_features to allow for double VLAN tag checks. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r--net/ipv4/udp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index a0d7151ffbd9..766e6bab9113 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2323,6 +2323,9 @@ struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
2323 struct udphdr *uh; 2323 struct udphdr *uh;
2324 int udp_offset = outer_hlen - tnl_hlen; 2324 int udp_offset = outer_hlen - tnl_hlen;
2325 2325
2326 skb_reset_inner_headers(skb);
2327 skb->encapsulation = 1;
2328
2326 skb->mac_len = mac_len; 2329 skb->mac_len = mac_len;
2327 2330
2328 skb_push(skb, outer_hlen); 2331 skb_push(skb, outer_hlen);
@@ -2345,7 +2348,6 @@ struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
2345 uh->check = CSUM_MANGLED_0; 2348 uh->check = CSUM_MANGLED_0;
2346 2349
2347 } 2350 }
2348 skb->ip_summed = CHECKSUM_NONE;
2349 skb->protocol = protocol; 2351 skb->protocol = protocol;
2350 } while ((skb = skb->next)); 2352 } while ((skb = skb->next));
2351out: 2353out: