aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 934396bb1376..66e9a729f6df 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -268,7 +268,7 @@
268#include <asm/uaccess.h> 268#include <asm/uaccess.h>
269#include <asm/ioctls.h> 269#include <asm/ioctls.h>
270 270
271int sysctl_tcp_fin_timeout = TCP_FIN_TIMEOUT; 271int sysctl_tcp_fin_timeout __read_mostly = TCP_FIN_TIMEOUT;
272 272
273DEFINE_SNMP_STAT(struct tcp_mib, tcp_statistics) __read_mostly; 273DEFINE_SNMP_STAT(struct tcp_mib, tcp_statistics) __read_mostly;
274 274
@@ -568,7 +568,7 @@ new_segment:
568 skb->truesize += copy; 568 skb->truesize += copy;
569 sk->sk_wmem_queued += copy; 569 sk->sk_wmem_queued += copy;
570 sk->sk_forward_alloc -= copy; 570 sk->sk_forward_alloc -= copy;
571 skb->ip_summed = CHECKSUM_HW; 571 skb->ip_summed = CHECKSUM_PARTIAL;
572 tp->write_seq += copy; 572 tp->write_seq += copy;
573 TCP_SKB_CB(skb)->end_seq += copy; 573 TCP_SKB_CB(skb)->end_seq += copy;
574 skb_shinfo(skb)->gso_segs = 0; 574 skb_shinfo(skb)->gso_segs = 0;
@@ -723,7 +723,7 @@ new_segment:
723 * Check whether we can use HW checksum. 723 * Check whether we can use HW checksum.
724 */ 724 */
725 if (sk->sk_route_caps & NETIF_F_ALL_CSUM) 725 if (sk->sk_route_caps & NETIF_F_ALL_CSUM)
726 skb->ip_summed = CHECKSUM_HW; 726 skb->ip_summed = CHECKSUM_PARTIAL;
727 727
728 skb_entail(sk, tp, skb); 728 skb_entail(sk, tp, skb);
729 copy = size_goal; 729 copy = size_goal;
@@ -955,8 +955,11 @@ void tcp_cleanup_rbuf(struct sock *sk, int copied)
955 * receive buffer and there was a small segment 955 * receive buffer and there was a small segment
956 * in queue. 956 * in queue.
957 */ 957 */
958 (copied > 0 && (icsk->icsk_ack.pending & ICSK_ACK_PUSHED) && 958 (copied > 0 &&
959 !icsk->icsk_ack.pingpong && !atomic_read(&sk->sk_rmem_alloc))) 959 ((icsk->icsk_ack.pending & ICSK_ACK_PUSHED2) ||
960 ((icsk->icsk_ack.pending & ICSK_ACK_PUSHED) &&
961 !icsk->icsk_ack.pingpong)) &&
962 !atomic_read(&sk->sk_rmem_alloc)))
960 time_to_ack = 1; 963 time_to_ack = 1;
961 } 964 }
962 965
@@ -2205,7 +2208,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
2205 th->fin = th->psh = 0; 2208 th->fin = th->psh = 0;
2206 2209
2207 th->check = ~csum_fold(th->check + delta); 2210 th->check = ~csum_fold(th->check + delta);
2208 if (skb->ip_summed != CHECKSUM_HW) 2211 if (skb->ip_summed != CHECKSUM_PARTIAL)
2209 th->check = csum_fold(csum_partial(skb->h.raw, thlen, 2212 th->check = csum_fold(csum_partial(skb->h.raw, thlen,
2210 skb->csum)); 2213 skb->csum));
2211 2214
@@ -2219,7 +2222,7 @@ struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
2219 2222
2220 delta = htonl(oldlen + (skb->tail - skb->h.raw) + skb->data_len); 2223 delta = htonl(oldlen + (skb->tail - skb->h.raw) + skb->data_len);
2221 th->check = ~csum_fold(th->check + delta); 2224 th->check = ~csum_fold(th->check + delta);
2222 if (skb->ip_summed != CHECKSUM_HW) 2225 if (skb->ip_summed != CHECKSUM_PARTIAL)
2223 th->check = csum_fold(csum_partial(skb->h.raw, thlen, 2226 th->check = csum_fold(csum_partial(skb->h.raw, thlen,
2224 skb->csum)); 2227 skb->csum));
2225 2228
@@ -2254,9 +2257,7 @@ void __init tcp_init(void)
2254 tcp_hashinfo.bind_bucket_cachep = 2257 tcp_hashinfo.bind_bucket_cachep =
2255 kmem_cache_create("tcp_bind_bucket", 2258 kmem_cache_create("tcp_bind_bucket",
2256 sizeof(struct inet_bind_bucket), 0, 2259 sizeof(struct inet_bind_bucket), 0,
2257 SLAB_HWCACHE_ALIGN, NULL, NULL); 2260 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL, NULL);
2258 if (!tcp_hashinfo.bind_bucket_cachep)
2259 panic("tcp_init: Cannot alloc tcp_bind_bucket cache.");
2260 2261
2261 /* Size and allocate the main established and bind bucket 2262 /* Size and allocate the main established and bind bucket
2262 * hash tables. 2263 * hash tables.