In the TCP Compound article used as a reference for the implementation, we read:
"If a retransmission timeout occurs, dwnd should be reset to zero and
the delay-based component is disabled." at page 5 of
ftp://ftp.research.microsoft.com/pub/tr/TR-2005-86.pdf

The attached patch implements this requirement.

Regards,
Angelo P. Castellani
diff -urd a/net/ipv4/tcp_compound.c b/net/ipv4/tcp_compound.c
--- a/net/ipv4/tcp_compound.c	2006-07-05 17:19:28.000000000 +0200
+++ b/net/ipv4/tcp_compound.c	2006-07-05 17:20:42.000000000 +0200
@@ -221,12 +221,9 @@
 		tcp_compound_init(sk);
 }
 
-static void tcp_compound_cong_avoid(struct sock *sk, u32 ack,
-				    u32 seq_rtt, u32 in_flight, int flag)
-{
+static inline void tcp_compound_synch(struct sock *sk) {
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct compound *vegas = inet_csk_ca(sk);
-	u8 inc = 0;
 
 	if (vegas->cwnd + vegas->dwnd > tp->snd_cwnd) {
 		if (vegas->cwnd > tp->snd_cwnd || vegas->dwnd > tp->snd_cwnd) {
@@ -234,9 +231,19 @@
 			vegas->dwnd = 0;
 		} else
 			vegas->cwnd = tp->snd_cwnd - vegas->dwnd;
-
 	}
 
+}
+
+static void tcp_compound_cong_avoid(struct sock *sk, u32 ack,
+				    u32 seq_rtt, u32 in_flight, int flag)
+{
+	struct tcp_sock *tp = tcp_sk(sk);
+	struct compound *vegas = inet_csk_ca(sk);
+	u8 inc = 0;
+	
+	tcp_compound_synch(sk);
+
 	if (!tcp_is_cwnd_limited(sk, in_flight))
 		return;
 
@@ -415,9 +422,21 @@
 	}
 }
 
+static u32 tcp_compound_ssthresh(struct sock *sk) {
+	struct tcp_sock *tp = tcp_sk(sk);
+	struct compound *vegas = inet_csk_ca(sk);
+
+	tcp_compound_synch(sk);
+	
+	vegas->dwnd = 0;
+	tp->snd_cwnd = vegas->cwnd;
+	
+	return tcp_reno_ssthresh(sk);
+}
+
 static struct tcp_congestion_ops tcp_compound = {
 	.init		= tcp_compound_init,
-	.ssthresh	= tcp_reno_ssthresh,
+	.ssthresh	= tcp_compound_ssthresh,
 	.cong_avoid	= tcp_compound_cong_avoid,
 	.min_cwnd	= tcp_reno_min_cwnd,
 	.rtt_sample	= tcp_compound_rtt_calc,

Reply via email to