]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.1.5/sch_red-fix-red_change.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.1.5 / sch_red-fix-red_change.patch
CommitLineData
7d5e6075
GKH
1From cc0683457108aa68db39aa51caf530beebc6cb85 Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <eric.dumazet@gmail.com>
3Date: Thu, 1 Dec 2011 11:06:34 +0000
4Subject: sch_red: fix red_change
5
6
7From: Eric Dumazet <eric.dumazet@gmail.com>
8
9[ Upstream commit 1ee5fa1e9970a16036e37c7b9d5ce81c778252fc ]
10
11Le 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
17RED is useful for high throughput routers, I doubt many linux machines
18act as such devices.
19
20I was considering adding Adaptative RED (Sally Floyd, Ramakrishna
21Gummadi, Scott Shender), August 2001
22
23In this version, maxp is dynamic (from 1% to 50%), and user only have to
24setup min_th (target average queue size)
25(max_th and wq (burst in linux RED) are automatically setup)
26
27By the way it seems we have a small bug in red_change()
28
29if (skb_queue_empty(&sch->q))
30 red_end_of_idle_period(&q->parms);
31
32First, if queue is empty, we should call
33red_start_of_idle_period(&q->parms);
34
35Second, since we dont use anymore sch->q, but q->qdisc, the test is
36meaningless.
37
38Oh well...
39
40[PATCH] sch_red: fix red_change()
41
42Now RED is classful, we must check q->qdisc->q.qlen, and if queue is empty,
43we start an idle period, not end it.
44
45Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
46Signed-off-by: David S. Miller <davem@davemloft.net>
47Signed-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;