netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dong Fang <yp.fangdong@gmail.com>
To: davem@davemloft.net, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
	yoshfuji@linux-ipv6.org, kaber@trash.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dong Fang <yp.fangdong@gmail.com>
Subject: [PATCH] net/ipv4: fix the conditions of entering TCP_CA_Disorder state
Date: Mon,  5 Aug 2013 20:45:51 -0400	[thread overview]
Message-ID: <1375749951-11230-1-git-send-email-yp.fangdong@gmail.com> (raw)

if have some packets loss by network, the kernel can't reach here, we can see
the tcp_time_to_recover() function:

static bool tcp_time_to_recover(struct sock *sk, int flag)
{
	struct tcp_sock *tp = tcp_sk(sk);
	__u32 packets_out;

	/* Trick#1: The loss is proven. */
	if (tp->lost_out)
		return true;
	//...
}

when it return true, the following condition will be failed:

//...
if (!tcp_time_to_recover(sk, flag)) {
	tcp_try_to_open(sk, flag, prior_unsacked);
	return;
}
//...


Signed-off-by: Dong Fang <yp.fangdong@gmail.com>
---
 net/ipv4/tcp_input.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 28af45a..8ab31c1 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2449,7 +2449,7 @@ static void tcp_try_keep_open(struct sock *sk)
 	struct tcp_sock *tp = tcp_sk(sk);
 	int state = TCP_CA_Open;
 
-	if (tcp_left_out(tp) || tcp_any_retrans_done(sk))
+	if (tp->sacked_out || tcp_any_retrans_done(sk))
 		state = TCP_CA_Disorder;
 
 	if (inet_csk(sk)->icsk_ca_state != state) {
-- 
1.7.1

             reply	other threads:[~2013-08-06  0:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-06  0:45 Dong Fang [this message]
2013-08-05 18:16 ` [PATCH] net/ipv4: fix the conditions of entering TCP_CA_Disorder state Eric Dumazet

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=1375749951-11230-1-git-send-email-yp.fangdong@gmail.com \
    --to=yp.fangdong@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /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;
as well as URLs for NNTP newsgroup(s).