Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

David Ward and committed by
David S. Miller
145a42b3 665a6cd8

+2 -2
+2 -2
net/sched/sch_gred.c
··· 229 229 break; 230 230 } 231 231 232 - if (q->backlog + qdisc_pkt_len(skb) <= q->limit) { 232 + if (gred_backlog(t, q, sch) + qdisc_pkt_len(skb) <= q->limit) { 233 233 q->backlog += qdisc_pkt_len(skb); 234 234 return qdisc_enqueue_tail(skb, sch); 235 235 } ··· 553 553 554 554 opt.limit = q->limit; 555 555 opt.DP = q->DP; 556 - opt.backlog = q->backlog; 556 + opt.backlog = gred_backlog(table, q, sch); 557 557 opt.prio = q->prio; 558 558 opt.qth_min = q->parms.qth_min >> q->parms.Wlog; 559 559 opt.qth_max = q->parms.qth_max >> q->parms.Wlog;