[3.5.y.z,extended,stable] Patch "tcp: fix double-counted receiver RTT when leaving receiver" has been added to staging queue

Message ID 1363776243-5358-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques March 20, 2013, 10:44 a.m.
This is a note to let you know that I have just added a patch titled

    tcp: fix double-counted receiver RTT when leaving receiver

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From 18656b2bfa04c916a7cdf224bcf996a16c9a1fa9 Mon Sep 17 00:00:00 2001
From: Neal Cardwell <ncardwell@google.com>
Date: Mon, 4 Mar 2013 06:23:05 +0000
Subject: [PATCH] tcp: fix double-counted receiver RTT when leaving receiver
 fast path

commit aab2b4bf224ef8358d262f95b568b8ad0cecf0a0 upstream.

We should not update ts_recent and call tcp_rcv_rtt_measure_ts() both
before and after going to step5. That wastes CPU and double-counts the
receiver-side RTT sample.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
 net/ipv4/tcp_input.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 3b14d81..410b7c4 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5683,6 +5683,9 @@  int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
 				if (tcp_checksum_complete_user(sk, skb))
 					goto csum_error;

+				if ((int)skb->truesize > sk->sk_forward_alloc)
+					goto step5;
 				/* Predicted packet is in window by definition.
 				 * seq == rcv_nxt and rcv_wup <= rcv_nxt.
 				 * Hence, check seq<=rcv_wup reduces to:
@@ -5694,9 +5697,6 @@  int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,

 				tcp_rcv_rtt_measure_ts(sk, skb);

-				if ((int)skb->truesize > sk->sk_forward_alloc)
-					goto step5;

 				/* Bulk data transfer: receiver */