netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] tcp: make is_dupack a parameter to tcp_fastretrans_alert()
@ 2011-11-16 18:58 Neal Cardwell
  2011-11-16 18:58 ` [PATCH 2/5] tcp: use DSACKs that arrive when packets_out is 0 Neal Cardwell
                   ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Neal Cardwell @ 2011-11-16 18:58 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, ilpo.jarvinen, Nandita Dukkipati, Yuchung Cheng,
	Tom Herbert, Neal Cardwell

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>
---
 net/ipv4/tcp_input.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 52b5c2d..f772aaa 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,
  * tcp_xmit_retransmit_queue().
  */
 static void tcp_fastretrans_alert(struct sock *sk, int pkts_acked,
-				  int newly_acked_sacked, int flag)
+				  int newly_acked_sacked, bool is_dupack,
+				  int flag)
 {
 	struct inet_connection_sock *icsk = inet_csk(sk);
 	struct tcp_sock *tp = tcp_sk(sk);
-	int is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP));
 	int do_lost = is_dupack || ((flag & FLAG_DATA_SACKED) &&
 				    (tcp_fackets_out(tp) > tp->reordering));
 	int fast_rexmit = 0, mib_idx;
@@ -3681,10 +3681,12 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 	u32 prior_snd_una = tp->snd_una;
 	u32 ack_seq = TCP_SKB_CB(skb)->seq;
 	u32 ack = TCP_SKB_CB(skb)->ack_seq;
+	bool is_dupack = false;
 	u32 prior_in_flight;
 	u32 prior_fackets;
 	int prior_packets;
 	int prior_sacked = tp->sacked_out;
+	int pkts_acked = 0;
 	int newly_acked_sacked = 0;
 	int frto_cwnd = 0;
 
@@ -3757,6 +3759,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 	/* See if we can take anything off of the retransmit queue. */
 	flag |= tcp_clean_rtx_queue(sk, prior_fackets, prior_snd_una);
 
+	pkts_acked = prior_packets - tp->packets_out;
 	newly_acked_sacked = (prior_packets - prior_sacked) -
 			     (tp->packets_out - tp->sacked_out);
 
@@ -3771,8 +3774,9 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
 		if ((flag & FLAG_DATA_ACKED) && !frto_cwnd &&
 		    tcp_may_raise_cwnd(sk, flag))
 			tcp_cong_avoid(sk, ack, prior_in_flight);
-		tcp_fastretrans_alert(sk, prior_packets - tp->packets_out,
-				      newly_acked_sacked, flag);
+		is_dupack = !(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP));
+		tcp_fastretrans_alert(sk, pkts_acked, newly_acked_sacked,
+				      is_dupack, flag);
 	} else {
 		if ((flag & FLAG_DATA_ACKED) && !frto_cwnd)
 			tcp_cong_avoid(sk, ack, prior_in_flight);
-- 
1.7.3.1

^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2011-12-18 18:23 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 18:58 [PATCH 1/5] tcp: make is_dupack a parameter to tcp_fastretrans_alert() Neal Cardwell
2011-11-16 18:58 ` [PATCH 2/5] tcp: use DSACKs that arrive when packets_out is 0 Neal Cardwell
2011-11-17  1:34   ` Ilpo Järvinen
2011-11-27 23:55     ` David Miller
2011-11-16 18:58 ` [PATCH 3/5] tcp: use SACKs and DSACKs that arrive on ACKs below snd_una Neal Cardwell
2011-11-17  1:52   ` Ilpo Järvinen
2011-11-27 23:57     ` David Miller
2011-11-16 18:58 ` [PATCH 4/5] tcp: allow undo from reordered DSACKs Neal Cardwell
2011-11-17  5:18   ` Ilpo Järvinen
2011-11-17 20:49     ` Neal Cardwell
2011-11-22 12:44       ` Ilpo Järvinen
2011-11-27 23:58         ` David Miller
2011-11-28 17:31           ` Neal Cardwell
2011-12-12 12:05             ` [PATCH 1/1] tcp: fix spurious undos in CA_Open Ilpo Järvinen
2011-12-12 19:40               ` Neal Cardwell
2011-12-14  8:57                 ` Ilpo Järvinen
2011-12-18 18:23                   ` Neal Cardwell
2011-11-16 18:58 ` [PATCH 5/5] tcp: skip cwnd moderation in TCP_CA_Open in tcp_try_to_open Neal Cardwell
2011-11-17  5:14   ` Ilpo Järvinen
2011-11-19 21:08     ` Neal Cardwell
2011-11-20  8:38       ` Ilpo Järvinen
2011-11-21 22:57         ` Yuchung Cheng
2011-11-22 11:47           ` Ilpo Järvinen
2011-11-28  0:01             ` David Miller
2011-11-28 17:35               ` Neal Cardwell
2011-11-28 20:33                 ` Yuchung Cheng
2011-11-29 10:33                   ` Ilpo Järvinen
2011-11-20 10:19       ` Alexander Zimmermann
2011-11-17  1:23 ` [PATCH 1/5] tcp: make is_dupack a parameter to tcp_fastretrans_alert() Ilpo Järvinen
2011-11-27 23:55   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).