diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2016-06-01 19:15:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-03 19:24:04 -0400 |
commit | 6529d75ad9228f4d8a8f6c5c5244ceb945ac9bc2 (patch) | |
tree | 1209dce72e740f58c2aa21bda0b80d5a30fd6eb2 /net | |
parent | 357cc9b4a8a7a0cd0e662537b76e6fa4670b6798 (diff) |
sch_prio: update backlog as well
We need to update backlog too when we update qlen.
Joint work with Stas.
Reported-by: Stas Nichiporovich <stasn77@gmail.com>
Tested-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 'net')
-rw-r--r-- | net/sched/sch_prio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index fee1b15506b2..4b0a82191bc4 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -85,6 +85,7 @@ prio_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
85 | 85 | ||
86 | ret = qdisc_enqueue(skb, qdisc); | 86 | ret = qdisc_enqueue(skb, qdisc); |
87 | if (ret == NET_XMIT_SUCCESS) { | 87 | if (ret == NET_XMIT_SUCCESS) { |
88 | qdisc_qstats_backlog_inc(sch, skb); | ||
88 | sch->q.qlen++; | 89 | sch->q.qlen++; |
89 | return NET_XMIT_SUCCESS; | 90 | return NET_XMIT_SUCCESS; |
90 | } | 91 | } |
@@ -117,6 +118,7 @@ static struct sk_buff *prio_dequeue(struct Qdisc *sch) | |||
117 | struct sk_buff *skb = qdisc_dequeue_peeked(qdisc); | 118 | struct sk_buff *skb = qdisc_dequeue_peeked(qdisc); |
118 | if (skb) { | 119 | if (skb) { |
119 | qdisc_bstats_update(sch, skb); | 120 | qdisc_bstats_update(sch, skb); |
121 | qdisc_qstats_backlog_dec(sch, skb); | ||
120 | sch->q.qlen--; | 122 | sch->q.qlen--; |
121 | return skb; | 123 | return skb; |
122 | } | 124 | } |
@@ -135,6 +137,7 @@ static unsigned int prio_drop(struct Qdisc *sch) | |||
135 | for (prio = q->bands-1; prio >= 0; prio--) { | 137 | for (prio = q->bands-1; prio >= 0; prio--) { |
136 | qdisc = q->queues[prio]; | 138 | qdisc = q->queues[prio]; |
137 | if (qdisc->ops->drop && (len = qdisc->ops->drop(qdisc)) != 0) { | 139 | if (qdisc->ops->drop && (len = qdisc->ops->drop(qdisc)) != 0) { |
140 | sch->qstats.backlog -= len; | ||
138 | sch->q.qlen--; | 141 | sch->q.qlen--; |
139 | return len; | 142 | return len; |
140 | } | 143 | } |
@@ -151,6 +154,7 @@ prio_reset(struct Qdisc *sch) | |||
151 | 154 | ||
152 | for (prio = 0; prio < q->bands; prio++) | 155 | for (prio = 0; prio < q->bands; prio++) |
153 | qdisc_reset(q->queues[prio]); | 156 | qdisc_reset(q->queues[prio]); |
157 | sch->qstats.backlog = 0; | ||
154 | sch->q.qlen = 0; | 158 | sch->q.qlen = 0; |
155 | } | 159 | } |
156 | 160 | ||