Merge branch 'for-jeff' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux...
[pandora-kernel.git] / net / sched / sch_dsmark.c
index c4c1317..edd1298 100644 (file)
@@ -60,7 +60,8 @@ static int dsmark_graft(struct Qdisc *sch, unsigned long arg,
                sch, p, new, old);
 
        if (new == NULL) {
-               new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops,
+               new = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue,
+                                       &pfifo_qdisc_ops,
                                        sch->handle);
                if (new == NULL)
                        new = &noop_qdisc;
@@ -235,7 +236,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
                case TC_ACT_QUEUED:
                case TC_ACT_STOLEN:
                        kfree_skb(skb);
-                       return NET_XMIT_SUCCESS;
+                       return NET_XMIT_SUCCESS | __NET_XMIT_STOLEN;
 
                case TC_ACT_SHOT:
                        goto drop;
@@ -251,13 +252,14 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
                }
        }
 
-       err = p->q->enqueue(skb, p->q);
+       err = qdisc_enqueue(skb, p->q);
        if (err != NET_XMIT_SUCCESS) {
-               sch->qstats.drops++;
+               if (net_xmit_drop_count(err))
+                       sch->qstats.drops++;
                return err;
        }
 
-       sch->bstats.bytes += skb->len;
+       sch->bstats.bytes += qdisc_pkt_len(skb);
        sch->bstats.packets++;
        sch->q.qlen++;
 
@@ -266,7 +268,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 drop:
        kfree_skb(skb);
        sch->qstats.drops++;
-       return NET_XMIT_BYPASS;
+       return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
 }
 
 static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
@@ -320,7 +322,8 @@ static int dsmark_requeue(struct sk_buff *skb, struct Qdisc *sch)
 
        err = p->q->ops->requeue(skb, p->q);
        if (err != NET_XMIT_SUCCESS) {
-               sch->qstats.drops++;
+               if (net_xmit_drop_count(err))
+                       sch->qstats.drops++;
                return err;
        }
 
@@ -390,7 +393,8 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
        p->default_index = default_index;
        p->set_tc_index = nla_get_flag(tb[TCA_DSMARK_SET_TC_INDEX]);
 
-       p->q = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops, sch->handle);
+       p->q = qdisc_create_dflt(qdisc_dev(sch), sch->dev_queue,
+                                &pfifo_qdisc_ops, sch->handle);
        if (p->q == NULL)
                p->q = &noop_qdisc;