arm64: dts: rockchip: add efuse device node for rk3328
[firefly-linux-kernel-4.4.55.git] / net / sched / sch_choke.c
index 02bfd3d1c4f078e8b7da08791ea1069218095d1a..0a08c860eee4f35905907ce1eab38d6152c4487c 100644 (file)
@@ -128,8 +128,8 @@ static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx)
                choke_zap_tail_holes(q);
 
        qdisc_qstats_backlog_dec(sch, skb);
+       qdisc_tree_reduce_backlog(sch, 1, qdisc_pkt_len(skb));
        qdisc_drop(skb, sch);
-       qdisc_tree_decrease_qlen(sch, 1);
        --sch->q.qlen;
 }
 
@@ -456,6 +456,7 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt)
                old = q->tab;
                if (old) {
                        unsigned int oqlen = sch->q.qlen, tail = 0;
+                       unsigned dropped = 0;
 
                        while (q->head != q->tail) {
                                struct sk_buff *skb = q->tab[q->head];
@@ -467,11 +468,12 @@ static int choke_change(struct Qdisc *sch, struct nlattr *opt)
                                        ntab[tail++] = skb;
                                        continue;
                                }
+                               dropped += qdisc_pkt_len(skb);
                                qdisc_qstats_backlog_dec(sch, skb);
                                --sch->q.qlen;
                                qdisc_drop(skb, sch);
                        }
-                       qdisc_tree_decrease_qlen(sch, oqlen - sch->q.qlen);
+                       qdisc_tree_reduce_backlog(sch, oqlen - sch->q.qlen, dropped);
                        q->head = 0;
                        q->tail = tail;
                }
@@ -553,65 +555,6 @@ static void choke_destroy(struct Qdisc *sch)
        choke_free(q->tab);
 }
 
-static struct Qdisc *choke_leaf(struct Qdisc *sch, unsigned long arg)
-{
-       return NULL;
-}
-
-static unsigned long choke_get(struct Qdisc *sch, u32 classid)
-{
-       return 0;
-}
-
-static void choke_put(struct Qdisc *q, unsigned long cl)
-{
-}
-
-static unsigned long choke_bind(struct Qdisc *sch, unsigned long parent,
-                               u32 classid)
-{
-       return 0;
-}
-
-static struct tcf_proto __rcu **choke_find_tcf(struct Qdisc *sch,
-                                              unsigned long cl)
-{
-       struct choke_sched_data *q = qdisc_priv(sch);
-
-       if (cl)
-               return NULL;
-       return &q->filter_list;
-}
-
-static int choke_dump_class(struct Qdisc *sch, unsigned long cl,
-                         struct sk_buff *skb, struct tcmsg *tcm)
-{
-       tcm->tcm_handle |= TC_H_MIN(cl);
-       return 0;
-}
-
-static void choke_walk(struct Qdisc *sch, struct qdisc_walker *arg)
-{
-       if (!arg->stop) {
-               if (arg->fn(sch, 1, arg) < 0) {
-                       arg->stop = 1;
-                       return;
-               }
-               arg->count++;
-       }
-}
-
-static const struct Qdisc_class_ops choke_class_ops = {
-       .leaf           =       choke_leaf,
-       .get            =       choke_get,
-       .put            =       choke_put,
-       .tcf_chain      =       choke_find_tcf,
-       .bind_tcf       =       choke_bind,
-       .unbind_tcf     =       choke_put,
-       .dump           =       choke_dump_class,
-       .walk           =       choke_walk,
-};
-
 static struct sk_buff *choke_peek_head(struct Qdisc *sch)
 {
        struct choke_sched_data *q = qdisc_priv(sch);