Skip to content
Snippets Groups Projects
Commit 145a42b3 authored by David Ward's avatar David Ward Committed by David S. Miller
Browse files

net_sched: gred: use correct backlog value in WRED mode


In WRED mode, the backlog for a single virtual queue (VQ) should not be
used to determine queue behavior; instead the backlog is summed across
all VQs. This sum is currently used when calculating the average queue
lengths. It also needs to be used when determining if the queue's hard
limit has been reached, or when reporting each VQ's backlog via netlink.
q->backlog will only be used if the queue switches out of WRED mode.

Signed-off-by: default avatarDavid Ward <david.ward@ll.mit.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 665a6cd8
No related branches found
No related tags found
No related merge requests found
...@@ -229,7 +229,7 @@ static int gred_enqueue(struct sk_buff *skb, struct Qdisc *sch) ...@@ -229,7 +229,7 @@ static int gred_enqueue(struct sk_buff *skb, struct Qdisc *sch)
break; break;
} }
if (q->backlog + qdisc_pkt_len(skb) <= q->limit) { if (gred_backlog(t, q, sch) + qdisc_pkt_len(skb) <= q->limit) {
q->backlog += qdisc_pkt_len(skb); q->backlog += qdisc_pkt_len(skb);
return qdisc_enqueue_tail(skb, sch); return qdisc_enqueue_tail(skb, sch);
} }
...@@ -553,7 +553,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb) ...@@ -553,7 +553,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
opt.limit = q->limit; opt.limit = q->limit;
opt.DP = q->DP; opt.DP = q->DP;
opt.backlog = q->backlog; opt.backlog = gred_backlog(table, q, sch);
opt.prio = q->prio; opt.prio = q->prio;
opt.qth_min = q->parms.qth_min >> q->parms.Wlog; opt.qth_min = q->parms.qth_min >> q->parms.Wlog;
opt.qth_max = q->parms.qth_max >> q->parms.Wlog; opt.qth_max = q->parms.qth_max >> q->parms.Wlog;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment