net/mlx4_en: Fix mixed PFC and Global pause user control requests
[pandora-kernel.git] / net / sched / sch_htb.c
index 29b942c..3f93a5c 100644 (file)
@@ -86,7 +86,7 @@ struct htb_class {
        unsigned int children;
        struct htb_class *parent;       /* parent class */
 
-       int prio;               /* these two are used only by leaves... */
+       u32 prio;               /* these two are used only by leaves... */
        int quantum;            /* but stored for parent-to-leaf return */
 
        union {
@@ -580,6 +580,7 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch)
                htb_activate(q, cl);
        }
 
+       sch->qstats.backlog += qdisc_pkt_len(skb);
        sch->q.qlen++;
        return NET_XMIT_SUCCESS;
 }
@@ -867,6 +868,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch)
 ok:
                qdisc_bstats_update(sch, skb);
                qdisc_unthrottled(sch);
+               sch->qstats.backlog -= qdisc_pkt_len(skb);
                sch->q.qlen--;
                return skb;
        }
@@ -876,7 +878,7 @@ ok:
        q->now = psched_get_time();
        start_at = jiffies;
 
-       next_event = q->now + 5 * PSCHED_TICKS_PER_SEC;
+       next_event = q->now + 5LLU * PSCHED_TICKS_PER_SEC;
 
        for (level = 0; level < TC_HTB_MAXDEPTH; level++) {
                /* common case optimization - skip event handler quickly */
@@ -927,6 +929,7 @@ static unsigned int htb_drop(struct Qdisc *sch)
                        unsigned int len;
                        if (cl->un.leaf.q->ops->drop &&
                            (len = cl->un.leaf.q->ops->drop(cl->un.leaf.q))) {
+                               sch->qstats.backlog -= len;
                                sch->q.qlen--;
                                if (!cl->un.leaf.q->q.qlen)
                                        htb_deactivate(q, cl);
@@ -957,12 +960,12 @@ static void htb_reset(struct Qdisc *sch)
                        }
                        cl->prio_activity = 0;
                        cl->cmode = HTB_CAN_SEND;
-
                }
        }
        qdisc_watchdog_cancel(&q->watchdog);
        __skb_queue_purge(&q->direct_queue);
        sch->q.qlen = 0;
+       sch->qstats.backlog = 0;
        memset(q->row, 0, sizeof(q->row));
        memset(q->row_mask, 0, sizeof(q->row_mask));
        memset(q->wait_pq, 0, sizeof(q->wait_pq));
@@ -994,6 +997,9 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)
        int err;
        int i;
 
+       qdisc_watchdog_init(&q->watchdog, sch);
+       INIT_WORK(&q->work, htb_work_func);
+
        if (!opt)
                return -EINVAL;
 
@@ -1018,8 +1024,6 @@ static int htb_init(struct Qdisc *sch, struct nlattr *opt)
        for (i = 0; i < TC_HTB_NUMPRIO; i++)
                INIT_LIST_HEAD(q->drops + i);
 
-       qdisc_watchdog_init(&q->watchdog, sch);
-       INIT_WORK(&q->work, htb_work_func);
        skb_queue_head_init(&q->direct_queue);
 
        q->direct_qlen = qdisc_dev(sch)->tx_queue_len;