aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorNeal Cardwell <ncardwell@google.com>2011-11-16 03:58:01 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-27 18:54:08 -0500
commit7d2b55f80d62b6b4b72d9ef4318a2a49df3e2830 (patch)
tree9829f83bb4ed7babe787f8cea4f0bae2646af83f /net/ipv4
parentc140d769c2b6d87148203a78aa0d72595a19b2de (diff)
tcp: make is_dupack a parameter to tcp_fastretrans_alert()
Allow callers to decide whether an ACK is a duplicate ACK. This is a prerequisite to allowing fastretrans_alert to be called from new contexts, such as the no_queue and old_ack code paths, from which we have extra info that tells us whether an ACK is a dupack. Signed-off-by: Neal Cardwell <ncardwell@google.com> Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_input.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 52b5c2d0ecd0..f772aaa4319e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -3009,11 +3009,11 @@ static void tcp_update_cwnd_in_recovery(struct sock *sk, int newly_acked_sacked,
3009 * tcp_xmit_retransmit_queue(). 3009 * tcp_xmit_retransmit_queue().
3010 */ 3010 */
3011static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked, 3011static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked,
3012 int newly_acked_sacked, int flag) 3012 int newly_acked_sacked, bool is_dupack,
3013 int flag)
3013{ 3014{
3014 struct inet_connection_sock *icsk = inet_csk(sk); 3015 struct inet_connection_sock *icsk = inet_csk(sk);
3015 struct tcp_sock *tp = tcp_sk(sk); 3016 struct tcp_sock *tp = tcp_sk(sk);
3016 int is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP));
3017 int do_lost = is_dupack || ((flag & FLAG_DATA_SACKED) && 3017 int do_lost = is_dupack || ((flag & FLAG_DATA_SACKED) &&
3018 (tcp_fackets_out(tp) > tp->reordering)); 3018 (tcp_fackets_out(tp) > tp->reordering));
3019 int fast_rexmit = 0, mib_idx; 3019 int fast_rexmit = 0, mib_idx;
@@ -3681,10 +3681,12 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
3681 u32 prior_snd_una = tp->snd_una; 3681 u32 prior_snd_una = tp->snd_una;
3682 u32 ack_seq = TCP_SKB_CB(skb)->seq; 3682 u32 ack_seq = TCP_SKB_CB(skb)->seq;
3683 u32 ack = TCP_SKB_CB(skb)->ack_seq; 3683 u32 ack = TCP_SKB_CB(skb)->ack_seq;
3684 bool is_dupack = false;
3684 u32 prior_in_flight; 3685 u32 prior_in_flight;
3685 u32 prior_fackets; 3686 u32 prior_fackets;
3686 int prior_packets; 3687 int prior_packets;
3687 int prior_sacked = tp->sacked_out; 3688 int prior_sacked = tp->sacked_out;
3689 int pkts_acked = 0;
3688 int newly_acked_sacked = 0; 3690 int newly_acked_sacked = 0;
3689 int frto_cwnd = 0; 3691 int frto_cwnd = 0;
3690 3692
@@ -3757,6 +3759,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
3757 /* See if we can take anything off of the retransmit queue. */ 3759 /* See if we can take anything off of the retransmit queue. */
3758 flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una); 3760 flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una);
3759 3761
3762 pkts_acked = prior_packets - tp->packets_out;
3760 newly_acked_sacked = (prior_packets - prior_sacked) - 3763 newly_acked_sacked = (prior_packets - prior_sacked) -
3761 (tp->packets_out - tp->sacked_out); 3764 (tp->packets_out - tp->sacked_out);
3762 3765
@@ -3771,8 +3774,9 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
3771 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd && 3774 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd &&
3772 tcp_may_raise_cwnd(sk, flag)) 3775 tcp_may_raise_cwnd(sk, flag))
3773 tcp_cong_avoid(sk, ack, prior_in_flight); 3776 tcp_cong_avoid(sk, ack, prior_in_flight);
3774 tcp_fastretrans_alert(sk, prior_packets - tp->packets_out, 3777 is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP));
3775 newly_acked_sacked, flag); 3778 tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked,
3779 is_dupack, flag);
3776 } else { 3780 } else {
3777 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd) 3781 if ((flag & FLAG_DATA_ACKED) && !frto_cwnd)
3778 tcp_cong_avoid(sk, ack, prior_in_flight); 3782 tcp_cong_avoid(sk, ack, prior_in_flight);