diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 575d3c1fb6e8..9a1b3c1c1c14 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -1971,11 +1971,6 @@ void tcp_enter_loss(struct sock *sk) | |||
1971 | /* F-RTO RFC5682 sec 3.1 step 1: retransmit SND.UNA if no previous | 1971 | /* F-RTO RFC5682 sec 3.1 step 1: retransmit SND.UNA if no previous |
1972 | * loss recovery is underway except recurring timeout(s) on | 1972 | * loss recovery is underway except recurring timeout(s) on |
1973 | * the same SND.UNA (sec 3.2). Disable F-RTO on path MTU probing | 1973 | * the same SND.UNA (sec 3.2). Disable F-RTO on path MTU probing |
1974 | * | ||
1975 | * In theory F-RTO can be used repeatedly during loss recovery. | ||
1976 | * In practice this interacts badly with broken middle-boxes that | ||
1977 | * falsely raise the receive window, which results in repeated | ||
1978 | * timeouts and stop-and-go behavior. | ||
1979 | */ | 1974 | */ |
1980 | tp->frto = net->ipv4.sysctl_tcp_frto && | 1975 | tp->frto = net->ipv4.sysctl_tcp_frto && |
1981 | (new_recovery || icsk->icsk_retransmits) && | 1976 | (new_recovery || icsk->icsk_retransmits) && |
@@ -2631,18 +2626,14 @@ static void tcp_process_loss(struct sock *sk, int flag, bool is_dupack, | |||
2631 | tcp_try_undo_loss(sk, false)) | 2626 | tcp_try_undo_loss(sk, false)) |
2632 | return; | 2627 | return; |
2633 | 2628 | ||
2634 | /* The ACK (s)acks some never-retransmitted data meaning not all | ||
2635 | * the data packets before the timeout were lost. Therefore we | ||
2636 | * undo the congestion window and state. This is essentially | ||
2637 | * the operation in F-RTO (RFC5682 section 3.1 step 3.b). Since | ||
2638 | * a retransmitted skb is permantly marked, we can apply such an | ||
2639 | * operation even if F-RTO was not used. | ||
2640 | */ | ||
2641 | if ((flag & FLAG_ORIG_SACK_ACKED) && | ||
2642 | tcp_try_undo_loss(sk, tp->undo_marker)) | ||
2643 | return; | ||
2644 | |||
2645 | if (tp->frto) { /* F-RTO RFC5682 sec 3.1 (sack enhanced version). */ | 2629 | if (tp->frto) { /* F-RTO RFC5682 sec 3.1 (sack enhanced version). */ |
2630 | /* Step 3.b. A timeout is spurious if not all data are | ||
2631 | * lost, i.e., never-retransmitted data are (s)acked. | ||
2632 | */ | ||
2633 | if ((flag & FLAG_ORIG_SACK_ACKED) && | ||
2634 | tcp_try_undo_loss(sk, true)) | ||
2635 | return; | ||
2636 | |||
2646 | if (after(tp->snd_nxt, tp->high_seq)) { | 2637 | if (after(tp->snd_nxt, tp->high_seq)) { |
2647 | if (flag & FLAG_DATA_SACKED || is_dupack) | 2638 | if (flag & FLAG_DATA_SACKED || is_dupack) |
2648 | tp->frto = 0; /* Step 3.a. loss was real */ | 2639 | tp->frto = 0; /* Step 3.a. loss was real */ |
@@ -4001,6 +3992,7 @@ void tcp_reset(struct sock *sk) | |||
4001 | /* This barrier is coupled with smp_rmb() in tcp_poll() */ | 3992 | /* This barrier is coupled with smp_rmb() in tcp_poll() */ |
4002 | smp_wmb(); | 3993 | smp_wmb(); |
4003 | 3994 | ||
3995 | tcp_write_queue_purge(sk); | ||
4004 | tcp_done(sk); | 3996 | tcp_done(sk); |
4005 | 3997 | ||
4006 | if (!sock_flag(sk, SOCK_DEAD)) | 3998 | if (!sock_flag(sk, SOCK_DEAD)) |