diff options
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index bcfccc5cb8d0..ce4ffe9ed556 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2930,13 +2930,14 @@ static void tcp_enter_recovery(struct sock *sk, bool ece_ack) | |||
2930 | * tcp_xmit_retransmit_queue(). | 2930 | * tcp_xmit_retransmit_queue(). |
2931 | */ | 2931 | */ |
2932 | static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, | 2932 | static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, |
2933 | int newly_acked_sacked, bool is_dupack, | 2933 | int prior_sacked, bool is_dupack, |
2934 | int flag) | 2934 | int flag) |
2935 | { | 2935 | { |
2936 | struct inet_connection_sock *icsk = inet_csk(sk); | 2936 | struct inet_connection_sock *icsk = inet_csk(sk); |
2937 | struct tcp_sock *tp = tcp_sk(sk); | 2937 | struct tcp_sock *tp = tcp_sk(sk); |
2938 | int do_lost = is_dupack || ((flag & FLAG_DATA_SACKED) && | 2938 | int do_lost = is_dupack || ((flag & FLAG_DATA_SACKED) && |
2939 | (tcp_fackets_out(tp) > tp->reordering)); | 2939 | (tcp_fackets_out(tp) > tp->reordering)); |
2940 | int newly_acked_sacked = 0; | ||
2940 | int fast_rexmit = 0; | 2941 | int fast_rexmit = 0; |
2941 | 2942 | ||
2942 | if (WARN_ON(!tp->packets_out && tp->sacked_out)) | 2943 | if (WARN_ON(!tp->packets_out && tp->sacked_out)) |
@@ -2996,6 +2997,7 @@ static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, | |||
2996 | tcp_add_reno_sack(sk); | 2997 | tcp_add_reno_sack(sk); |
2997 | } else | 2998 | } else |
2998 | do_lost = tcp_try_undo_partial(sk, pkts_acked); | 2999 | do_lost = tcp_try_undo_partial(sk, pkts_acked); |
3000 | newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked; | ||
2999 | break; | 3001 | break; |
3000 | case TCP_CA_Loss: | 3002 | case TCP_CA_Loss: |
3001 | if (flag & FLAG_DATA_ACKED) | 3003 | if (flag & FLAG_DATA_ACKED) |
@@ -3017,6 +3019,7 @@ static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, | |||
3017 | if (is_dupack) | 3019 | if (is_dupack) |
3018 | tcp_add_reno_sack(sk); | 3020 | tcp_add_reno_sack(sk); |
3019 | } | 3021 | } |
3022 | newly_acked_sacked = pkts_acked + tp->sacked_out - prior_sacked; | ||
3020 | 3023 | ||
3021 | if (icsk->icsk_ca_state <= TCP_CA_Disorder) | 3024 | if (icsk->icsk_ca_state <= TCP_CA_Disorder) |
3022 | tcp_try_undo_dsack(sk); | 3025 | tcp_try_undo_dsack(sk); |
@@ -3594,7 +3597,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) | |||
3594 | int prior_packets; | 3597 | int prior_packets; |
3595 | int prior_sacked = tp->sacked_out; | 3598 | int prior_sacked = tp->sacked_out; |
3596 | int pkts_acked = 0; | 3599 | int pkts_acked = 0; |
3597 | int newly_acked_sacked = 0; | ||
3598 | bool frto_cwnd = false; | 3600 | bool frto_cwnd = false; |
3599 | 3601 | ||
3600 | /* If the ack is older than previous acks | 3602 | /* If the ack is older than previous acks |
@@ -3670,8 +3672,6 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) | |||
3670 | flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una); | 3672 | flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una); |
3671 | 3673 | ||
3672 | pkts_acked = prior_packets - tp->packets_out; | 3674 | pkts_acked = prior_packets - tp->packets_out; |
3673 | newly_acked_sacked = (prior_packets - prior_sacked) - | ||
3674 | (tp->packets_out - tp->sacked_out); | ||
3675 | 3675 | ||
3676 | if (tp->frto_counter) | 3676 | if (tp->frto_counter) |
3677 | frto_cwnd = tcp_process_frto(sk, flag); | 3677 | frto_cwnd = tcp_process_frto(sk, flag); |
@@ -3685,7 +3685,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) | |||
3685 | tcp_may_raise_cwnd(sk, flag)) | 3685 | tcp_may_raise_cwnd(sk, flag)) |
3686 | tcp_cong_avoid(sk, ack, prior_in_flight); | 3686 | tcp_cong_avoid(sk, ack, prior_in_flight); |
3687 | is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP)); | 3687 | is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP)); |
3688 | tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked, | 3688 | tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, |
3689 | is_dupack, flag); | 3689 | is_dupack, flag); |
3690 | } else { | 3690 | } else { |
3691 | if ((flag & FLAG_DATA_ACKED) && !frto_cwnd) | 3691 | if ((flag & FLAG_DATA_ACKED) && !frto_cwnd) |
@@ -3702,7 +3702,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) | |||
3702 | no_queue: | 3702 | no_queue: |
3703 | /* If data was DSACKed, see if we can undo a cwnd reduction. */ | 3703 | /* If data was DSACKed, see if we can undo a cwnd reduction. */ |
3704 | if (flag & FLAG_DSACKING_ACK) | 3704 | if (flag & FLAG_DSACKING_ACK) |
3705 | tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked, | 3705 | tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, |
3706 | is_dupack, flag); | 3706 | is_dupack, flag); |
3707 | /* If this ack opens up a zero window, clear backoff. It was | 3707 | /* If this ack opens up a zero window, clear backoff. It was |
3708 | * being used to time the probes, and is probably far higher than | 3708 | * being used to time the probes, and is probably far higher than |
@@ -3722,8 +3722,7 @@ old_ack: | |||
3722 | */ | 3722 | */ |
3723 | if (TCP_SKB_CB(skb)->sacked) { | 3723 | if (TCP_SKB_CB(skb)->sacked) { |
3724 | flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una); | 3724 | flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una); |
3725 | newly_acked_sacked = tp->sacked_out - prior_sacked; | 3725 | tcp_fastretrans_alert(sk, pkts_acked, prior_sacked, |
3726 | tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked, | ||
3727 | is_dupack, flag); | 3726 | is_dupack, flag); |
3728 | } | 3727 | } |
3729 | 3728 | ||