Skip to content

Commit 0220146

Browse files
Jarek Poplawskidavem330
authored andcommitted
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>
1 parent ae27e98 commit 0220146

File tree

1 file changed

+0
-87
lines changed

1 file changed

+0
-87
lines changed

net/sched/sch_netem.c

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -622,95 +622,8 @@ static int netem_dump(struct Qdisc *sch, struct sk_buff *skb)
622622
return -1;
623623
}
624624

625-
static 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-
639-
static 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-
656-
static 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-
662-
static unsigned long netem_get(struct Qdisc *sch, u32 classid)
663-
{
664-
return 1;
665-
}
666-
667-
static void netem_put(struct Qdisc *sch, unsigned long arg)
668-
{
669-
}
670-
671-
static int netem_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
672-
struct nlattr **tca, unsigned long *arg)
673-
{
674-
return -ENOSYS;
675-
}
676-
677-
static int netem_delete(struct Qdisc *sch, unsigned long arg)
678-
{
679-
return -ENOSYS;
680-
}
681-
682-
static 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-
694-
static struct tcf_proto **netem_find_tcf(struct Qdisc *sch, unsigned long cl)
695-
{
696-
return NULL;
697-
}
698-
699-
static 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-
711625
static struct Qdisc_ops netem_qdisc_ops __read_mostly = {
712626
.id = "netem",
713-
.cl_ops = &netem_class_ops,
714627
.priv_size = sizeof(struct netem_sched_data),
715628
.enqueue = netem_enqueue,
716629
.dequeue = netem_dequeue,

0 commit comments

Comments
 (0)