Skip to contentSkip to conversation

net/ipv4: fix the conditions of entering TCP_CA_Disorder state

PATCH In review Dong Fang 2 participants 2 messages Aug 5, 2013

Subsystems (3)
lore
Share & tools
lore

Dong Fang

author
#0 lore raw

PATCH 1/1 net/ipv4: fix the conditions of entering TCP_CA_Disorder state

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;
}

//...

---
 net/ipv4/tcp_input.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/tcp_input.c +1 -1
index 28af45a..8ab31c1 100644
@@ -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) {
Signature · 1 line
1.7.1
#1 lore raw
Quoted 14 lines · Dong Fang

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;
	//...
}
Quoted 9 lines

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;
}

//...

I honestly do not understand this changelog, and how it is related to the patch.

Also its not 'net/ipv4:' issue but 'tcp:' one

Could you please explain the issue again ?

Thanks !