Sophie

Sophie

distrib > CentOS > 5 > i386 > by-pkgid > ea32411352494358b8d75a78402a4713 > files > 3233

kernel-2.6.18-238.19.1.el5.centos.plus.src.rpm

From: Thomas Graf <tgraf@redhat.com>
Date: Fri, 23 Jul 2010 15:30:32 -0400
Subject: [net] tcp: move prior_in_flight collect to better spot
Message-id: <20100723153032.GC14925@lsx.localdomain>
Patchwork-id: 27061
O-Subject: [RHEL5.6 PATCH 1/14] tcp: Move prior_in_flight collect to more
	robust place
Bugzilla: 612709
RH-Acked-by: Neil Horman <nhorman@redhat.com>
RH-Acked-by: David S. Miller <davem@redhat.com>

commit 52d3408150858a301a84bcbfe2f323d90d71d2ce
Author: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Date:   Wed Dec 5 02:21:35 2007 -0800

    [TCP]: Move prior_in_flight collect to more robust place

    The previous location is after sacktag processing, which affects
    counters tcp_packets_in_flight depends on. This may manifest as
    wrong behavior if new SACK blocks are present and all is clear
    for call to tcp_cong_avoid, which in the case of
    tcp_reno_cong_avoid bails out early because it thinks that
    TCP is not limited by cwnd.

    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Jarod Wilson <jarod@redhat.com>

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 66a04c2..e9aa763 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2525,6 +2525,8 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
 			tp->bytes_acked += min(ack - prior_snd_una, tp->mss_cache);
 	}
 
+	prior_in_flight = tcp_packets_in_flight(tp);
+
 	if (!(flag&FLAG_SLOWPATH) && after(ack, prior_snd_una)) {
 		/* Window is constant, pure forward advance.
 		 * No more checks are required.
@@ -2564,8 +2566,6 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
 	if (!prior_packets)
 		goto no_queue;
 
-	prior_in_flight = tcp_packets_in_flight(tp);
-
 	/* See if we can take anything off of the retransmit queue. */
 	flag |= tcp_clean_rtx_queue(sk, &seq_rtt);