From: Andries.Brouwer@cwi.nl
To: davem@redhat.com
Cc: linux-kernel@vger.kernel.org, linux-net@vger.kernel.org,
torvalds@transmeta.com
Subject: [PATCH] tcp hang solved
Date: Mon, 4 Nov 2002 01:27:26 +0100 (MET) [thread overview]
Message-ID: <UTC200211040027.gA40RQ103595.aeb@smtp.cwi.nl> (raw)
Recent 2.5 kernels were unusable since rlogin sessions would
inexplicably hang for many seconds. tcpdump reveals that
the remote host sends packets A,B,C, the local host acks A,
remote host sends D, local host acks A, sacks C, D, and,
for example 47 seconds later, the remote host retransmits B.
Until 2.5.34 the scenario would be the same, but the retransmission
would occur after less than a second.
If I am not mistaken, the cause of this change in behaviour is
the removal of tcp_store_ts_recent() one place, and addition
three other places. At first sight the three new places seem to
cover the old call, but inspection shows that the conditions
changed. So, the following patch should be appropriate.
Andries
--- linux-2.5.45/linux/net/ipv4/tcp_input.c Thu Oct 31 14:14:51 2002
+++ linux-2.5.45a/linux/net/ipv4/tcp_input.c Mon Nov 4 01:10:27 2002
@@ -3433,6 +3433,7 @@
(sizeof(struct tcphdr) + TCPOLEN_TSTAMP_ALIGNED) &&
tp->rcv_nxt == tp->rcv_wup)
tcp_store_ts_recent(tp);
+
/* We know that such packets are checksummed
* on entry.
*/
@@ -3454,10 +3455,6 @@
__set_current_state(TASK_RUNNING);
if (!tcp_copy_to_iovec(sk, skb, tcp_header_len)) {
- __skb_pull(skb, tcp_header_len);
- tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
- NET_INC_STATS_BH(TCPHPHitsToUser);
- eaten = 1;
/* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to:
@@ -3467,6 +3464,11 @@
TCPOLEN_TSTAMP_ALIGNED) &&
tp->rcv_nxt == tp->rcv_wup)
tcp_store_ts_recent(tp);
+
+ __skb_pull(skb, tcp_header_len);
+ tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
+ NET_INC_STATS_BH(TCPHPHitsToUser);
+ eaten = 1;
}
}
if (!eaten) {
[now that this code+comment occurs three times, an inline function
is perhaps nicer]
next reply other threads:[~2002-11-04 0:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-04 0:27 Andries.Brouwer [this message]
2002-11-04 10:36 ` David S. Miller
2002-11-04 11:38 ` Sebastian Benoit
2002-11-04 13:59 ` David S. Miller
2002-11-04 13:18 ` Sebastian Benoit
2002-11-04 14:39 ` David S. Miller
2002-11-04 16:10 ` Sebastian Benoit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=UTC200211040027.gA40RQ103595.aeb@smtp.cwi.nl \
--to=andries.brouwer@cwi.nl \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®