]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.22.15/tcp-illinois-incorrect-beta-usage.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.22.15 / tcp-illinois-incorrect-beta-usage.patch
1 From stable-bounces@linux.kernel.org Mon Dec 10 20:32:29 2007
2 From: Stephen Hemminger <shemminger@linux-foundation.org>
3 Date: Tue, 11 Dec 2007 09:39:37 +0800
4 Subject: TCP: illinois: Incorrect beta usage
5 To: stable@kernel.org, <davem@davemloft.net>
6 Message-ID: <E1J1u5x-0002LB-00@gondolin.me.apana.org.au>
7
8
9 From: Stephen Hemminger <shemminger@linux-foundation.org>
10
11 [TCP] illinois: Incorrect beta usage
12
13 [ Upstream commit: a357dde9df33f28611e6a3d4f88265e39bcc8880 ]
14
15 Lachlan Andrew observed that my TCP-Illinois implementation uses the
16 beta value incorrectly:
17 The parameter beta in the paper specifies the amount to decrease
18 *by*: that is, on loss,
19 W <- W - beta*W
20 but in tcp_illinois_ssthresh() uses beta as the amount
21 to decrease *to*: W <- beta*W
22
23 This bug makes the Linux TCP-Illinois get less-aggressive on uncongested network,
24 hurting performance. Note: since the base beta value is .5, it has no
25 impact on a congested network.
26
27 Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
28 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
29 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
30
31 ---
32 net/ipv4/tcp_illinois.c | 2 +-
33 1 file changed, 1 insertion(+), 1 deletion(-)
34
35 --- a/net/ipv4/tcp_illinois.c
36 +++ b/net/ipv4/tcp_illinois.c
37 @@ -300,7 +300,7 @@ static u32 tcp_illinois_ssthresh(struct
38 struct illinois *ca = inet_csk_ca(sk);
39
40 /* Multiplicative decrease */
41 - return max((tp->snd_cwnd * ca->beta) >> BETA_SHIFT, 2U);
42 + return max(tp->snd_cwnd - ((tp->snd_cwnd * ca->beta) >> BETA_SHIFT), 2U);
43 }
44
45