diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2016-06-03 18:05:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-06 21:14:29 -0400 |
commit | a27758ffaf96f89002129eedb2cc172d254099f8 (patch) | |
tree | a773e569d26b1c5b364d12cd69a76615d3090af7 /include/net/sch_generic.h | |
parent | 1957598840f47d42bb0b7f8a871717a780708686 (diff) |
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: 2ccccf5fb43f ("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>
Diffstat (limited to 'include/net/sch_generic.h')
-rw-r--r-- | include/net/sch_generic.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index a1fd76c22a59..6803af17dfcf 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -691,9 +691,11 @@ static inline struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch) | |||
691 | /* we can reuse ->gso_skb because peek isn't called for root qdiscs */ | 691 | /* we can reuse ->gso_skb because peek isn't called for root qdiscs */ |
692 | if (!sch->gso_skb) { | 692 | if (!sch->gso_skb) { |
693 | sch->gso_skb = sch->dequeue(sch); | 693 | sch->gso_skb = sch->dequeue(sch); |
694 | if (sch->gso_skb) | 694 | if (sch->gso_skb) { |
695 | /* it's still part of the queue */ | 695 | /* it's still part of the queue */ |
696 | qdisc_qstats_backlog_inc(sch, sch->gso_skb); | ||
696 | sch->q.qlen++; | 697 | sch->q.qlen++; |
698 | } | ||
697 | } | 699 | } |
698 | 700 | ||
699 | return sch->gso_skb; | 701 | return sch->gso_skb; |
@@ -706,6 +708,7 @@ static inline struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch) | |||
706 | 708 | ||
707 | if (skb) { | 709 | if (skb) { |
708 | sch->gso_skb = NULL; | 710 | sch->gso_skb = NULL; |
711 | qdisc_qstats_backlog_dec(sch, skb); | ||
709 | sch->q.qlen--; | 712 | sch->q.qlen--; |
710 | } else { | 713 | } else { |
711 | skb = sch->dequeue(sch); | 714 | skb = sch->dequeue(sch); |