aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_choke.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_choke.c')
-rw-r--r--net/sched/sch_choke.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index 5ffb8b8337c7..0a08c860eee4 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -128,8 +128,8 @@ static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx)
128 choke_zap_tail_holes(q); 128 choke_zap_tail_holes(q);
129 129
130 qdisc_qstats_backlog_dec(sch, skb); 130 qdisc_qstats_backlog_dec(sch, skb);
131 qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb));
131 qdisc_drop(skb, sch); 132 qdisc_drop(skb, sch);
132 qdisc_tree_decrease_qlen(sch, 1);
133 --sch->q.qlen; 133 --sch->q.qlen;
134} 134}
135 135
@@ -456,6 +456,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt)
456 old = q->tab; 456 old = q->tab;
457 if (old) { 457 if (old) {
458 unsigned int oqlen = sch->q.qlen, tail = 0; 458 unsigned int oqlen = sch->q.qlen, tail = 0;
459 unsigned dropped = 0;
459 460
460 while (q->head != q->tail) { 461 while (q->head != q->tail) {
461 struct sk_buff *skb = q->tab[q->head]; 462 struct sk_buff *skb = q->tab[q->head];
@@ -467,11 +468,12 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt)
467 ntab[tail++] = skb; 468 ntab[tail++] = skb;
468 continue; 469 continue;
469 } 470 }
471 dropped += qdisc_pkt_len(skb);
470 qdisc_qstats_backlog_dec(sch, skb); 472 qdisc_qstats_backlog_dec(sch, skb);
471 --sch->q.qlen; 473 --sch->q.qlen;
472 qdisc_drop(skb, sch); 474 qdisc_drop(skb, sch);
473 } 475 }
474 qdisc_tree_decrease_qlen(sch, oqlen - sch->q.qlen); 476 qdisc_tree_reduce_backlog(sch, oqlen - sch->q.qlen, dropped);
475 q->head = 0; 477 q->head = 0;
476 q->tail = tail; 478 q->tail = tail;
477 } 479 }