]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.8.4/tcp-fix-double-counted-receiver-rtt-when-leaving-receiver-fast-path.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 3.8.4 / tcp-fix-double-counted-receiver-rtt-when-leaving-receiver-fast-path.patch
1 From 2d2809452253a92adcabba4d897bf58a5c9794fb Mon Sep 17 00:00:00 2001
2 From: Neal Cardwell <ncardwell@google.com>
3 Date: Mon, 4 Mar 2013 06:23:05 +0000
4 Subject: tcp: fix double-counted receiver RTT when leaving receiver fast path
5
6
7 From: Neal Cardwell <ncardwell@google.com>
8
9 [ Upstream commit aab2b4bf224ef8358d262f95b568b8ad0cecf0a0 ]
10
11 We should not update ts_recent and call tcp_rcv_rtt_measure_ts() both
12 before and after going to step5. That wastes CPU and double-counts the
13 receiver-side RTT sample.
14
15 Signed-off-by: Neal Cardwell <ncardwell@google.com>
16 Acked-by: Eric Dumazet <edumazet@google.com>
17 Signed-off-by: David S. Miller <davem@davemloft.net>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19 ---
20 net/ipv4/tcp_input.c | 6 +++---
21 1 file changed, 3 insertions(+), 3 deletions(-)
22
23 --- a/net/ipv4/tcp_input.c
24 +++ b/net/ipv4/tcp_input.c
25 @@ -5498,6 +5498,9 @@ int tcp_rcv_established(struct sock *sk,
26 if (tcp_checksum_complete_user(sk, skb))
27 goto csum_error;
28
29 + if ((int)skb->truesize > sk->sk_forward_alloc)
30 + goto step5;
31 +
32 /* Predicted packet is in window by definition.
33 * seq == rcv_nxt and rcv_wup <= rcv_nxt.
34 * Hence, check seq<=rcv_wup reduces to:
35 @@ -5509,9 +5512,6 @@ int tcp_rcv_established(struct sock *sk,
36
37 tcp_rcv_rtt_measure_ts(sk, skb);
38
39 - if ((int)skb->truesize > sk->sk_forward_alloc)
40 - goto step5;
41 -
42 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPHITS);
43
44 /* Bulk data transfer: receiver */