MAINTAINERS: fix sorting
[pandora-kernel.git] / net / ipv4 / tcp_hybla.c
index bfcbd14..377bc93 100644 (file)
@@ -126,8 +126,8 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
                 * calculate 2^fract in a <<7 value.
                 */
                is_slowstart = 1;
-               increment = ((1 << ca->rho) * hybla_fraction(rho_fractions))
-                       - 128;
+               increment = ((1 << min(ca->rho, 16U)) *
+                       hybla_fraction(rho_fractions)) - 128;
        } else {
                /*
                 * congestion avoidance
@@ -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);