aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_codel.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_codel.c')
-rw-r--r--net/sched/sch_codel.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sched/sch_codel.c b/net/sched/sch_codel.c
index 535007d5f0b5..9b7e2980ee5c 100644
--- a/net/sched/sch_codel.c
+++ b/net/sched/sch_codel.c
@@ -79,12 +79,13 @@ static struct sk_buff *codel_qdisc_dequeue(struct Qdisc *sch)
79 79
80 skb = codel_dequeue(sch, &q->params, &q->vars, &q->stats, dequeue); 80 skb = codel_dequeue(sch, &q->params, &q->vars, &q->stats, dequeue);
81 81
82 /* We cant call qdisc_tree_decrease_qlen() if our qlen is 0, 82 /* We cant call qdisc_tree_reduce_backlog() if our qlen is 0,
83 * or HTB crashes. Defer it for next round. 83 * or HTB crashes. Defer it for next round.
84 */ 84 */
85 if (q->stats.drop_count && sch->q.qlen) { 85 if (q->stats.drop_count && sch->q.qlen) {
86 qdisc_tree_decrease_qlen(sch, q->stats.drop_count); 86 qdisc_tree_reduce_backlog(sch, q->stats.drop_count, q->stats.drop_len);
87 q->stats.drop_count = 0; 87 q->stats.drop_count = 0;
88 q->stats.drop_len = 0;
88 } 89 }
89 if (skb) 90 if (skb)
90 qdisc_bstats_update(sch, skb); 91 qdisc_bstats_update(sch, skb);
@@ -116,7 +117,7 @@ static int codel_change(struct Qdisc *sch, struct nlattr *opt)
116{ 117{
117 struct codel_sched_data *q = qdisc_priv(sch); 118 struct codel_sched_data *q = qdisc_priv(sch);
118 struct nlattr *tb[TCA_CODEL_MAX + 1]; 119 struct nlattr *tb[TCA_CODEL_MAX + 1];
119 unsigned int qlen; 120 unsigned int qlen, dropped = 0;
120 int err; 121 int err;
121 122
122 if (!opt) 123 if (!opt)
@@ -156,10 +157,11 @@ static int codel_change(struct Qdisc *sch, struct nlattr *opt)
156 while (sch->q.qlen > sch->limit) { 157 while (sch->q.qlen > sch->limit) {
157 struct sk_buff *skb = __skb_dequeue(&sch->q); 158 struct sk_buff *skb = __skb_dequeue(&sch->q);
158 159
160 dropped += qdisc_pkt_len(skb);
159 qdisc_qstats_backlog_dec(sch, skb); 161 qdisc_qstats_backlog_dec(sch, skb);
160 qdisc_drop(skb, sch); 162 qdisc_drop(skb, sch);
161 } 163 }
162 qdisc_tree_decrease_qlen(sch, qlen - sch->q.qlen); 164 qdisc_tree_reduce_backlog(sch, qlen - sch->q.qlen, dropped);
163 165
164 sch_tree_unlock(sch); 166 sch_tree_unlock(sch);
165 return 0; 167 return 0;