aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-11-02 02:35:24 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-02 02:35:24 -0500
commit02201464119334690fe209849843881b8e9cfa9f (patch)
treed568246166f5f3b6c194993fadf2681b2e11c39f /net
parentae27e98a51526595837ab7498b23d6478a198960 (diff)
sch_netem: Remove classful functionality
Patrick McHardy noticed that: "a lot of the functionality of netem requires the inner tfifo anyways and rate-limiting is usually done on top of netem. So I would suggest so either hard-wire the tfifo qdisc or at least make the assumption that inner qdiscs are work-conserving.", and later: "- a lot of other qdiscs still don't work as inner qdiscs of netem [...]". So, according to his suggestion, this patch removes classful options of netem. The main reason of this change is to remove ops->requeue() method, which is currently used only by netem. Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_netem.c87
1 files changed, 0 insertions, 87 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 3080bd6ee332..2ad09594c8bc 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -622,95 +622,8 @@ nla_put_failure:
622 return -1; 622 return -1;
623} 623}
624 624
625static int netem_dump_class(struct Qdisc *sch, unsigned long cl,
626 struct sk_buff *skb, struct tcmsg *tcm)
627{
628 struct netem_sched_data *q = qdisc_priv(sch);
629
630 if (cl != 1) /* only one class */
631 return -ENOENT;
632
633 tcm->tcm_handle |= TC_H_MIN(1);
634 tcm->tcm_info = q->qdisc->handle;
635
636 return 0;
637}
638
639static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
640 struct Qdisc **old)
641{
642 struct netem_sched_data *q = qdisc_priv(sch);
643
644 if (new == NULL)
645 new = &noop_qdisc;
646
647 sch_tree_lock(sch);
648 *old = xchg(&q->qdisc, new);
649 qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
650 qdisc_reset(*old);
651 sch_tree_unlock(sch);
652
653 return 0;
654}
655
656static struct Qdisc *netem_leaf(struct Qdisc *sch, unsigned long arg)
657{
658 struct netem_sched_data *q = qdisc_priv(sch);
659 return q->qdisc;
660}
661
662static unsigned long netem_get(struct Qdisc *sch, u32 classid)
663{
664 return 1;
665}
666
667static void netem_put(struct Qdisc *sch, unsigned long arg)
668{
669}
670
671static int netem_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
672 struct nlattr **tca, unsigned long *arg)
673{
674 return -ENOSYS;
675}
676
677static int netem_delete(struct Qdisc *sch, unsigned long arg)
678{
679 return -ENOSYS;
680}
681
682static void netem_walk(struct Qdisc *sch, struct qdisc_walker *walker)
683{
684 if (!walker->stop) {
685 if (walker->count >= walker->skip)
686 if (walker->fn(sch, 1, walker) < 0) {
687 walker->stop = 1;
688 return;
689 }
690 walker->count++;
691 }
692}
693
694static struct tcf_proto **netem_find_tcf(struct Qdisc *sch, unsigned long cl)
695{
696 return NULL;
697}
698
699static const struct Qdisc_class_ops netem_class_ops = {
700 .graft = netem_graft,
701 .leaf = netem_leaf,
702 .get = netem_get,
703 .put = netem_put,
704 .change = netem_change_class,
705 .delete = netem_delete,
706 .walk = netem_walk,
707 .tcf_chain = netem_find_tcf,
708 .dump = netem_dump_class,
709};
710
711static struct Qdisc_ops netem_qdisc_ops __read_mostly = { 625static struct Qdisc_ops netem_qdisc_ops __read_mostly = {
712 .id = "netem", 626 .id = "netem",
713 .cl_ops = &netem_class_ops,
714 .priv_size = sizeof(struct netem_sched_data), 627 .priv_size = sizeof(struct netem_sched_data),
715 .enqueue = netem_enqueue, 628 .enqueue = netem_enqueue,
716 .dequeue = netem_dequeue, 629 .dequeue = netem_dequeue,