aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-10-19 19:37:06 -0400
committerDavid S. Miller <davem@davemloft.net>2013-10-19 19:37:06 -0400
commit53481da372851a5506deb5247302f75459b472b4 (patch)
treef56596d0aa56f97a2a54cd18749805ae2c4becc8 /net/core/skbuff.c
parentb917eb155c56bbb766140b406979820e719e3f55 (diff)
parent117401ee1df6517203454637fbc3e7e660ce45f6 (diff)
Merge branch 'ipip_gso'
Eric Dumazet says: ==================== net: Implement GSO/TSO support for IPIP This patch serie implements GSO/TSO support for IPIP David, please note it applies after "ipv4: gso: send_check() & segment() cleanups" ( http://patchwork.ozlabs.org/patch/284714/ ) Broadcom bnx2x driver is now enabled for TSO support of IPIP traffic 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 8532.40 2.55 7.73 0.588 1.781 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 8ead744fcc94..0ab32faa520f 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -903,6 +903,9 @@ EXPORT_SYMBOL(skb_clone);
903 903
904static void skb_headers_offset_update(struct sk_buff *skb, int off) 904static void skb_headers_offset_update(struct sk_buff *skb, int off)
905{ 905{
906 /* Only adjust this if it actually is csum_start rather than csum */
907 if (skb->ip_summed == CHECKSUM_PARTIAL)
908 skb->csum_start += off;
906 /* {transport,network,mac}_header and tail are relative to skb->head */ 909 /* {transport,network,mac}_header and tail are relative to skb->head */
907 skb->transport_header += off; 910 skb->transport_header += off;
908 skb->network_header += off; 911 skb->network_header += off;
@@ -1109,9 +1112,6 @@ int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail,
1109#endif 1112#endif
1110 skb->tail += off; 1113 skb->tail += off;
1111 skb_headers_offset_update(skb, nhead); 1114 skb_headers_offset_update(skb, nhead);
1112 /* Only adjust this if it actually is csum_start rather than csum */
1113 if (skb->ip_summed == CHECKSUM_PARTIAL)
1114 skb->csum_start += nhead;
1115 skb->cloned = 0; 1115 skb->cloned = 0;
1116 skb->hdr_len = 0; 1116 skb->hdr_len = 0;
1117 skb->nohdr = 0; 1117 skb->nohdr = 0;
@@ -1176,7 +1176,6 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
1176 NUMA_NO_NODE); 1176 NUMA_NO_NODE);
1177 int oldheadroom = skb_headroom(skb); 1177 int oldheadroom = skb_headroom(skb);
1178 int head_copy_len, head_copy_off; 1178 int head_copy_len, head_copy_off;
1179 int off;
1180 1179
1181 if (!n) 1180 if (!n)
1182 return NULL; 1181 return NULL;
@@ -1200,11 +1199,7 @@ struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
1200 1199
1201 copy_skb_header(n, skb); 1200 copy_skb_header(n, skb);
1202 1201
1203 off = newheadroom - oldheadroom; 1202 skb_headers_offset_update(n, newheadroom - oldheadroom);
1204 if (n->ip_summed == CHECKSUM_PARTIAL)
1205 n->csum_start += off;
1206
1207 skb_headers_offset_update(n, off);
1208 1203
1209 return n; 1204 return n;
1210} 1205}
@@ -2837,14 +2832,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features)
2837 __copy_skb_header(nskb, skb); 2832 __copy_skb_header(nskb, skb);
2838 nskb->mac_len = skb->mac_len; 2833 nskb->mac_len = skb->mac_len;
2839 2834
2840 /* nskb and skb might have different headroom */ 2835 skb_headers_offset_update(nskb, skb_headroom(nskb) - headroom);
2841 if (nskb->ip_summed == CHECKSUM_PARTIAL)
2842 nskb->csum_start += skb_headroom(nskb) - headroom;
2843
2844 skb_reset_mac_header(nskb);
2845 skb_set_network_header(nskb, skb->mac_len);
2846 nskb->transport_header = (nskb->network_header +
2847 skb_network_header_len(skb));
2848 2836
2849 skb_copy_from_linear_data_offset(skb, -tnl_hlen, 2837 skb_copy_from_linear_data_offset(skb, -tnl_hlen,
2850 nskb->data - tnl_hlen, 2838 nskb->data - tnl_hlen,