]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sched/sch_dsmark.c
[IA64] Fix GRU compile error w/o CONFIG_HUGETLB_PAGE
[linux-2.6-omap-h63xx.git] / net / sched / sch_dsmark.c
index 44d347e831cf487d7431dc880e9a3e4f503228ed..ba43aab3a8515ed3a71925254a4a531849665baa 100644 (file)
@@ -202,7 +202,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 
        if (p->set_tc_index) {
                switch (skb->protocol) {
-               case __constant_htons(ETH_P_IP):
+               case htons(ETH_P_IP):
                        if (skb_cow_head(skb, sizeof(struct iphdr)))
                                goto drop;
 
@@ -210,7 +210,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
                                & ~INET_ECN_MASK;
                        break;
 
-               case __constant_htons(ETH_P_IPV6):
+               case htons(ETH_P_IPV6):
                        if (skb_cow_head(skb, sizeof(struct ipv6hdr)))
                                goto drop;
 
@@ -236,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;
@@ -254,11 +254,12 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
 
        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++;
 
@@ -267,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)
@@ -288,11 +289,11 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
        pr_debug("index %d->%d\n", skb->tc_index, index);
 
        switch (skb->protocol) {
-       case __constant_htons(ETH_P_IP):
+       case htons(ETH_P_IP):
                ipv4_change_dsfield(ip_hdr(skb), p->mask[index],
                                    p->value[index]);
                        break;
-       case __constant_htons(ETH_P_IPV6):
+       case htons(ETH_P_IPV6):
                ipv6_change_dsfield(ipv6_hdr(skb), p->mask[index],
                                    p->value[index]);
                        break;
@@ -321,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;
        }