net_sched: keep backlog updated with qlen
For gso_skb we only update qlen, backlog should be updated too.
Note, it is correct to just update these stats at one layer,
because the gso_skb is cached there.
Reported-by: Stas Nichiporovich <stasn77@gmail.com>
Fixes: 2ccccf5fb4
("net_sched: update hierarchical backlog too")
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
1957598840
commit
a27758ffaf
@@ -691,9 +691,11 @@ static inline struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch)
|
||||
/* we can reuse ->gso_skb because peek isn't called for root qdiscs */
|
||||
if (!sch->gso_skb) {
|
||||
sch->gso_skb = sch->dequeue(sch);
|
||||
if (sch->gso_skb)
|
||||
if (sch->gso_skb) {
|
||||
/* it's still part of the queue */
|
||||
qdisc_qstats_backlog_inc(sch, sch->gso_skb);
|
||||
sch->q.qlen++;
|
||||
}
|
||||
}
|
||||
|
||||
return sch->gso_skb;
|
||||
@@ -706,6 +708,7 @@ static inline struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch)
|
||||
|
||||
if (skb) {
|
||||
sch->gso_skb = NULL;
|
||||
qdisc_qstats_backlog_dec(sch, skb);
|
||||
sch->q.qlen--;
|
||||
} else {
|
||||
skb = sch->dequeue(sch);
|
||||
|
Reference in New Issue
Block a user