Skip to contentSkip to conversation

Fix tcp_hybla zero congestion window growth with small rho and large cwnd

PATCH In review Daniele Lacamera 2 participants 2 messages Oct 4, 2008 – Oct 7, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix tcp_hybla zero congestion window growth with small rho and large cwnd

Because of rounding, in certain conditions, i.e. when in congestion avoidance state rho is smaller than 1/128 of the current cwnd, TCP Hybla congestion control starves and the cwnd is kept constant forever.

This patch forces an increment by one segment after #send_cwnd calls without increments(newreno behavior).

Please apply.

net/ipv4/tcp_hybla.c +6 -1
diff -ruN a/net/ipv4/tcp_hybla.c b/net/ipv4/tcp_hybla.c
@@ -150,7 +150,12 @@
 		ca->snd_cwnd_cents -= 128;
 		tp->snd_cwnd_cnt = 0;
 	}
-
+	/* check when cwnd has not been incremented for a while */
+	if (increment == 0 && odd == 0 && tp->snd_cwnd_cnt >= tp->snd_cwnd)
+	{
+		tp->snd_cwnd++;
+		tp->snd_cwnd_cnt = 0;
+	}
 	/* clamp down slowstart cwnd to ssthresh value. */
 	if (is_slowstart)
 		tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh);
maintainer
#1 lore raw

From: Daniele Lacamera <[email protected]>
Date: Sat, 04 Oct 2008 17:34:57 +0200

Quoted 9 lines

Because of rounding, in certain conditions, i.e. when in congestion avoidance state rho is smaller than 1/128 of the current cwnd, TCP Hybla congestion control starves and the cwnd is kept constant forever.

This patch forces an increment by one segment after #send_cwnd calls without increments(newreno behavior).

I mad a slight coding style fix and then applied
your patch to net-2.6 as follows.

tcp: Fix tcp_hybla zero congestion window growth with small rho and large cwnd.

Because of rounding, in certain conditions, i.e. when in congestion avoidance state rho is smaller than 1/128 of the current cwnd, TCP Hybla congestion control starves and the cwnd is kept constant forever.

This patch forces an increment by one segment after #send_cwnd calls without increments(newreno behavior).

net/ipv4/tcp_hybla.c +5 -1
index bfcbd14..c209e05 100644
@@ -150,7 +150,11 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
 		ca->snd_cwnd_cents -= 128;
 		tp->snd_cwnd_cnt = 0;
 	}
-
+	/* check when cwnd has not been incremented for a while */
+	if (increment == 0 && odd == 0 && tp->snd_cwnd_cnt >= tp->snd_cwnd) {
+		tp->snd_cwnd++;
+		tp->snd_cwnd_cnt = 0;
+	}
 	/* clamp down slowstart cwnd to ssthresh value. */
 	if (is_slowstart)
 		tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh);