]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/sched/sch_netem.c
net-sched: consolidate default fifo qdisc setup
[linux-2.6-omap-h63xx.git] / net / sched / sch_netem.c
index c9c649b26eaa1d943b404ccbd4aea3be98fa661d..24697667247cadca1ccf645b5ce536aa0d3ceec4 100644 (file)
@@ -310,28 +310,6 @@ static void netem_reset(struct Qdisc *sch)
        qdisc_watchdog_cancel(&q->watchdog);
 }
 
-/* Pass size change message down to embedded FIFO */
-static int set_fifo_limit(struct Qdisc *q, int limit)
-{
-       struct nlattr *nla;
-       int ret = -ENOMEM;
-
-       /* Hack to avoid sending change message to non-FIFO */
-       if (strncmp(q->ops->id + 1, "fifo", 4) != 0)
-               return 0;
-
-       nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL);
-       if (nla) {
-               nla->nla_type = RTM_NEWQDISC;
-               nla->nla_len = nla_attr_size(sizeof(struct tc_fifo_qopt));
-               ((struct tc_fifo_qopt *)nla_data(nla))->limit = limit;
-
-               ret = q->ops->change(q, nla);
-               kfree(nla);
-       }
-       return ret;
-}
-
 /*
  * Distribution data is a variable size payload containing
  * signed 16 bit values.
@@ -416,7 +394,7 @@ static int netem_change(struct Qdisc *sch, struct nlattr *opt)
        if (ret < 0)
                return ret;
 
-       ret = set_fifo_limit(q->qdisc, qopt->limit);
+       ret = fifo_set_limit(q->qdisc, qopt->limit);
        if (ret) {
                pr_debug("netem: can't set fifo limit\n");
                return ret;