]>
Commit | Line | Data |
---|---|---|
7d5e6075 GKH |
1 | From cc0683457108aa68db39aa51caf530beebc6cb85 Mon Sep 17 00:00:00 2001 |
2 | From: Eric Dumazet <eric.dumazet@gmail.com> | |
3 | Date: Thu, 1 Dec 2011 11:06:34 +0000 | |
4 | Subject: sch_red: fix red_change | |
5 | ||
6 | ||
7 | From: Eric Dumazet <eric.dumazet@gmail.com> | |
8 | ||
9 | [ Upstream commit 1ee5fa1e9970a16036e37c7b9d5ce81c778252fc ] | |
10 | ||
11 | Le mercredi 30 novembre 2011 à 14:36 -0800, Stephen Hemminger a écrit : | |
12 | ||
13 | > (Almost) nobody uses RED because they can't figure it out. | |
14 | > According to Wikipedia, VJ says that: | |
15 | > "there are not one, but two bugs in classic RED." | |
16 | ||
17 | RED is useful for high throughput routers, I doubt many linux machines | |
18 | act as such devices. | |
19 | ||
20 | I was considering adding Adaptative RED (Sally Floyd, Ramakrishna | |
21 | Gummadi, Scott Shender), August 2001 | |
22 | ||
23 | In this version, maxp is dynamic (from 1% to 50%), and user only have to | |
24 | setup min_th (target average queue size) | |
25 | (max_th and wq (burst in linux RED) are automatically setup) | |
26 | ||
27 | By the way it seems we have a small bug in red_change() | |
28 | ||
29 | if (skb_queue_empty(&sch->q)) | |
30 | red_end_of_idle_period(&q->parms); | |
31 | ||
32 | First, if queue is empty, we should call | |
33 | red_start_of_idle_period(&q->parms); | |
34 | ||
35 | Second, since we dont use anymore sch->q, but q->qdisc, the test is | |
36 | meaningless. | |
37 | ||
38 | Oh well... | |
39 | ||
40 | [PATCH] sch_red: fix red_change() | |
41 | ||
42 | Now RED is classful, we must check q->qdisc->q.qlen, and if queue is empty, | |
43 | we start an idle period, not end it. | |
44 | ||
45 | Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> | |
46 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
47 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
48 | --- | |
49 | net/sched/sch_red.c | 4 ++-- | |
50 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
51 | ||
52 | --- a/net/sched/sch_red.c | |
53 | +++ b/net/sched/sch_red.c | |
54 | @@ -209,8 +209,8 @@ static int red_change(struct Qdisc *sch, | |
55 | ctl->Plog, ctl->Scell_log, | |
56 | nla_data(tb[TCA_RED_STAB])); | |
57 | ||
58 | - if (skb_queue_empty(&sch->q)) | |
59 | - red_end_of_idle_period(&q->parms); | |
60 | + if (!q->qdisc->q.qlen) | |
61 | + red_start_of_idle_period(&q->parms); | |
62 | ||
63 | sch_tree_unlock(sch); | |
64 | return 0; |