]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
TCP: illinois: Incorrect beta usage
authorStephen Hemminger <shemminger@linux-foundation.org>
Tue, 11 Dec 2007 01:39:37 +0000 (09:39 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 Dec 2007 18:31:59 +0000 (10:31 -0800)
[TCP] illinois: Incorrect beta usage

[ Upstream commit: a357dde9df33f28611e6a3d4f88265e39bcc8880 ]

Lachlan Andrew observed that my TCP-Illinois implementation uses the
beta value incorrectly:
The parameter  beta  in the paper specifies the amount to decrease
*by*:  that is, on loss,
 W <-  W -  beta*W
but in   tcp_illinois_ssthresh() uses  beta  as the amount
to decrease  *to*: W <- beta*W

This bug makes the Linux TCP-Illinois get less-aggressive on uncongested network,
hurting performance. Note: since the base beta value is .5, it has no
impact on a congested network.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/tcp_illinois.c

index b2b2256d3b8450c944bc8d3a8869a76aaf2ceb69..31dd8c54e137109f9cf8e420052204e257f7d042 100644 (file)
@@ -300,7 +300,7 @@ static u32 tcp_illinois_ssthresh(struct sock *sk)
        struct illinois *ca = inet_csk_ca(sk);
 
        /* Multiplicative decrease */
-       return max((tp->snd_cwnd * ca->beta) >> BETA_SHIFT, 2U);
+       return max(tp->snd_cwnd - ((tp->snd_cwnd * ca->beta) >> BETA_SHIFT), 2U);
 }