X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fsched%2Fsch_dsmark.c;h=8a3db9d95bab238b99a7018a73b5e9ddbd189835;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=e0831a4a44576b5405c4bf393fa5529fde0f2dce;hpb=9bf4aaab3e101692164d49b7ca357651eb691cb6;p=linux-2.6.git diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index e0831a4a4..8a3db9d95 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -124,8 +125,7 @@ static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent, "arg 0x%lx\n",sch,p,classid,parent,*arg); if (*arg > p->indices) return -ENOENT; - if (!opt || rtattr_parse(tb, TCA_DSMARK_MAX, RTA_DATA(opt), - RTA_PAYLOAD(opt))) + if (!opt || rtattr_parse_nested(tb, TCA_DSMARK_MAX, opt)) return -EINVAL; if (tb[TCA_DSMARK_MASK-1]) { if (!RTA_PAYLOAD(tb[TCA_DSMARK_MASK-1])) @@ -198,10 +198,12 @@ static int dsmark_enqueue(struct sk_buff *skb,struct Qdisc *sch) /* FIXME: Safe with non-linear skbs? --RR */ switch (skb->protocol) { case __constant_htons(ETH_P_IP): - skb->tc_index = ipv4_get_dsfield(skb->nh.iph); + skb->tc_index = ipv4_get_dsfield(skb->nh.iph) + & ~INET_ECN_MASK; break; case __constant_htons(ETH_P_IPV6): - skb->tc_index = ipv6_get_dsfield(skb->nh.ipv6h); + skb->tc_index = ipv6_get_dsfield(skb->nh.ipv6h) + & ~INET_ECN_MASK; break; default: skb->tc_index = 0; @@ -241,11 +243,11 @@ static int dsmark_enqueue(struct sk_buff *skb,struct Qdisc *sch) #endif ((ret = p->q->enqueue(skb,p->q)) != 0)) { - sch->stats.drops++; + sch->qstats.drops++; return ret; } - sch->stats.bytes += skb->len; - sch->stats.packets++; + sch->bstats.bytes += skb->len; + sch->bstats.packets++; sch->q.qlen++; return ret; } @@ -297,9 +299,10 @@ static int dsmark_requeue(struct sk_buff *skb,struct Qdisc *sch) D2PRINTK("dsmark_requeue(skb %p,sch %p,[qdisc %p])\n",skb,sch,p); if ((ret = p->q->ops->requeue(skb, p->q)) == 0) { sch->q.qlen++; + sch->qstats.requeues++; return 0; } - sch->stats.drops++; + sch->qstats.drops++; return ret; } @@ -319,7 +322,7 @@ static unsigned int dsmark_drop(struct Qdisc *sch) } -int dsmark_init(struct Qdisc *sch,struct rtattr *opt) +static int dsmark_init(struct Qdisc *sch,struct rtattr *opt) { struct dsmark_qdisc_data *p = PRIV(sch); struct rtattr *tb[TCA_DSMARK_MAX]; @@ -331,8 +334,6 @@ int dsmark_init(struct Qdisc *sch,struct rtattr *opt) !tb[TCA_DSMARK_INDICES-1] || RTA_PAYLOAD(tb[TCA_DSMARK_INDICES-1]) < sizeof(__u16)) return -EINVAL; - memset(p,0,sizeof(*p)); - p->filter_list = NULL; p->indices = *(__u16 *) RTA_DATA(tb[TCA_DSMARK_INDICES-1]); if (!p->indices) return -EINVAL;