diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2010-10-13 21:52:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-17 16:46:33 -0400 |
commit | c60ce4e265404ca42ba860401f4b0f1e97332a67 (patch) | |
tree | 7a71a183c1512e32257f9ec66d74e8544c772bec /net/ipv4/tcp_timer.c | |
parent | 1fdb936101637c91819efea47e921bb592e07e34 (diff) |
tcp: use correct counters in CA_CWR state too
As CWR is stronger than CA_Disorder state, we can miscount
SACK/Reno failure into other timeouts. Not a bad problem as
it can happen only due to ECN, FRTO detecting spurious RTO
or xmit error which are the only callers of tcp_enter_cwr.
And even then losses and RTO must still follow thereafter
to actually end up into the relevant code paths.
Compile tested.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r-- | net/ipv4/tcp_timer.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index f3c8c6c019ae..74a6aa003657 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -367,18 +367,19 @@ void tcp_retransmit_timer(struct sock *sk) | |||
367 | if (icsk->icsk_retransmits == 0) { | 367 | if (icsk->icsk_retransmits == 0) { |
368 | int mib_idx; | 368 | int mib_idx; |
369 | 369 | ||
370 | if (icsk->icsk_ca_state == TCP_CA_Disorder) { | 370 | if (icsk->icsk_ca_state == TCP_CA_Recovery) { |
371 | if (tcp_is_sack(tp)) | ||
372 | mib_idx = LINUX_MIB_TCPSACKFAILURES; | ||
373 | else | ||
374 | mib_idx = LINUX_MIB_TCPRENOFAILURES; | ||
375 | } else if (icsk->icsk_ca_state == TCP_CA_Recovery) { | ||
376 | if (tcp_is_sack(tp)) | 371 | if (tcp_is_sack(tp)) |
377 | mib_idx = LINUX_MIB_TCPSACKRECOVERYFAIL; | 372 | mib_idx = LINUX_MIB_TCPSACKRECOVERYFAIL; |
378 | else | 373 | else |
379 | mib_idx = LINUX_MIB_TCPRENORECOVERYFAIL; | 374 | mib_idx = LINUX_MIB_TCPRENORECOVERYFAIL; |
380 | } else if (icsk->icsk_ca_state == TCP_CA_Loss) { | 375 | } else if (icsk->icsk_ca_state == TCP_CA_Loss) { |
381 | mib_idx = LINUX_MIB_TCPLOSSFAILURES; | 376 | mib_idx = LINUX_MIB_TCPLOSSFAILURES; |
377 | } else if ((icsk->icsk_ca_state == TCP_CA_Disorder) || | ||
378 | tp->sacked_out) { | ||
379 | if (tcp_is_sack(tp)) | ||
380 | mib_idx = LINUX_MIB_TCPSACKFAILURES; | ||
381 | else | ||
382 | mib_idx = LINUX_MIB_TCPRENOFAILURES; | ||
382 | } else { | 383 | } else { |
383 | mib_idx = LINUX_MIB_TCPTIMEOUTS; | 384 | mib_idx = LINUX_MIB_TCPTIMEOUTS; |
384 | } | 385 | } |