Lines Matching refs:sch

44 	struct Qdisc		*sch;  member
70 static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch, in red_enqueue() argument
73 struct red_sched_data *q = qdisc_priv(sch); in red_enqueue()
89 qdisc_qstats_overlimit(sch); in red_enqueue()
97 skb = tcf_qevent_handle(&q->qe_mark, sch, skb, to_free, &ret); in red_enqueue()
109 qdisc_qstats_overlimit(sch); in red_enqueue()
117 skb = tcf_qevent_handle(&q->qe_mark, sch, skb, to_free, &ret); in red_enqueue()
131 qdisc_qstats_backlog_inc(sch, skb); in red_enqueue()
132 sch->q.qlen++; in red_enqueue()
135 qdisc_qstats_drop(sch); in red_enqueue()
140 skb = tcf_qevent_handle(&q->qe_early_drop, sch, skb, to_free, &ret); in red_enqueue()
144 qdisc_drop(skb, sch, to_free); in red_enqueue()
148 static struct sk_buff *red_dequeue(struct Qdisc *sch) in red_dequeue() argument
151 struct red_sched_data *q = qdisc_priv(sch); in red_dequeue()
156 qdisc_bstats_update(sch, skb); in red_dequeue()
157 qdisc_qstats_backlog_dec(sch, skb); in red_dequeue()
158 sch->q.qlen--; in red_dequeue()
166 static struct sk_buff *red_peek(struct Qdisc *sch) in red_peek() argument
168 struct red_sched_data *q = qdisc_priv(sch); in red_peek()
174 static void red_reset(struct Qdisc *sch) in red_reset() argument
176 struct red_sched_data *q = qdisc_priv(sch); in red_reset()
179 sch->qstats.backlog = 0; in red_reset()
180 sch->q.qlen = 0; in red_reset()
184 static int red_offload(struct Qdisc *sch, bool enable) in red_offload() argument
186 struct red_sched_data *q = qdisc_priv(sch); in red_offload()
187 struct net_device *dev = qdisc_dev(sch); in red_offload()
189 .handle = sch->handle, in red_offload()
190 .parent = sch->parent, in red_offload()
205 opt.set.qstats = &sch->qstats; in red_offload()
213 static void red_destroy(struct Qdisc *sch) in red_destroy() argument
215 struct red_sched_data *q = qdisc_priv(sch); in red_destroy()
217 tcf_qevent_destroy(&q->qe_mark, sch); in red_destroy()
218 tcf_qevent_destroy(&q->qe_early_drop, sch); in red_destroy()
220 red_offload(sch, false); in red_destroy()
234 static int __red_change(struct Qdisc *sch, struct nlattr **tb, in __red_change() argument
238 struct red_sched_data *q = qdisc_priv(sch); in __red_change()
266 child = fifo_create_dflt(sch, &bfifo_qdisc_ops, ctl->limit, in __red_change()
275 sch_tree_lock(sch); in __red_change()
305 sch_tree_unlock(sch); in __red_change()
307 red_offload(sch, true); in __red_change()
314 sch_tree_unlock(sch); in __red_change()
323 struct Qdisc *sch = q->sch; in red_adaptative_timer() local
324 spinlock_t *root_lock = qdisc_lock(qdisc_root_sleeping(sch)); in red_adaptative_timer()
332 static int red_init(struct Qdisc *sch, struct nlattr *opt, in red_init() argument
335 struct red_sched_data *q = qdisc_priv(sch); in red_init()
340 q->sch = sch; in red_init()
351 err = __red_change(sch, tb, extack); in red_init()
355 err = tcf_qevent_init(&q->qe_early_drop, sch, in red_init()
361 return tcf_qevent_init(&q->qe_mark, sch, in red_init()
366 static int red_change(struct Qdisc *sch, struct nlattr *opt, in red_change() argument
369 struct red_sched_data *q = qdisc_priv(sch); in red_change()
391 return __red_change(sch, tb, extack); in red_change()
394 static int red_dump_offload_stats(struct Qdisc *sch) in red_dump_offload_stats() argument
398 .handle = sch->handle, in red_dump_offload_stats()
399 .parent = sch->parent, in red_dump_offload_stats()
401 .stats.bstats = &sch->bstats, in red_dump_offload_stats()
402 .stats.qstats = &sch->qstats, in red_dump_offload_stats()
406 return qdisc_offload_dump_helper(sch, TC_SETUP_QDISC_RED, &hw_stats); in red_dump_offload_stats()
409 static int red_dump(struct Qdisc *sch, struct sk_buff *skb) in red_dump() argument
411 struct red_sched_data *q = qdisc_priv(sch); in red_dump()
425 err = red_dump_offload_stats(sch); in red_dump()
446 static int red_dump_stats(struct Qdisc *sch, struct gnet_dump *d) in red_dump_stats() argument
448 struct red_sched_data *q = qdisc_priv(sch); in red_dump_stats()
449 struct net_device *dev = qdisc_dev(sch); in red_dump_stats()
452 if (sch->flags & TCQ_F_OFFLOADED) { in red_dump_stats()
455 .handle = sch->handle, in red_dump_stats()
456 .parent = sch->parent, in red_dump_stats()
472 static int red_dump_class(struct Qdisc *sch, unsigned long cl, in red_dump_class() argument
475 struct red_sched_data *q = qdisc_priv(sch); in red_dump_class()
482 static void red_graft_offload(struct Qdisc *sch, in red_graft_offload() argument
487 .handle = sch->handle, in red_graft_offload()
488 .parent = sch->parent, in red_graft_offload()
493 qdisc_offload_graft_helper(qdisc_dev(sch), sch, new, old, in red_graft_offload()
497 static int red_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new, in red_graft() argument
500 struct red_sched_data *q = qdisc_priv(sch); in red_graft()
505 *old = qdisc_replace(sch, new, &q->qdisc); in red_graft()
507 red_graft_offload(sch, new, *old, extack); in red_graft()
511 static struct Qdisc *red_leaf(struct Qdisc *sch, unsigned long arg) in red_leaf() argument
513 struct red_sched_data *q = qdisc_priv(sch); in red_leaf()
517 static unsigned long red_find(struct Qdisc *sch, u32 classid) in red_find() argument
522 static void red_walk(struct Qdisc *sch, struct qdisc_walker *walker) in red_walk() argument
526 if (walker->fn(sch, 1, walker) < 0) { in red_walk()