Lines Matching refs:sch

77 static int ets_quantum_parse(struct Qdisc *sch, const struct nlattr *attr,  in ets_quantum_parse()  argument
90 ets_class_from_arg(struct Qdisc *sch, unsigned long arg) in ets_class_from_arg() argument
92 struct ets_sched *q = qdisc_priv(sch); in ets_class_from_arg()
97 static u32 ets_class_id(struct Qdisc *sch, const struct ets_class *cl) in ets_class_id() argument
99 struct ets_sched *q = qdisc_priv(sch); in ets_class_id()
102 return TC_H_MAKE(sch->handle, band + 1); in ets_class_id()
105 static void ets_offload_change(struct Qdisc *sch) in ets_offload_change() argument
107 struct net_device *dev = qdisc_dev(sch); in ets_offload_change()
108 struct ets_sched *q = qdisc_priv(sch); in ets_offload_change()
122 qopt.handle = sch->handle; in ets_offload_change()
123 qopt.parent = sch->parent; in ets_offload_change()
125 qopt.replace_params.qstats = &sch->qstats; in ets_offload_change()
146 static void ets_offload_destroy(struct Qdisc *sch) in ets_offload_destroy() argument
148 struct net_device *dev = qdisc_dev(sch); in ets_offload_destroy()
155 qopt.handle = sch->handle; in ets_offload_destroy()
156 qopt.parent = sch->parent; in ets_offload_destroy()
160 static void ets_offload_graft(struct Qdisc *sch, struct Qdisc *new, in ets_offload_graft() argument
164 struct net_device *dev = qdisc_dev(sch); in ets_offload_graft()
168 qopt.handle = sch->handle; in ets_offload_graft()
169 qopt.parent = sch->parent; in ets_offload_graft()
173 qdisc_offload_graft_helper(dev, sch, new, old, TC_SETUP_QDISC_ETS, in ets_offload_graft()
177 static int ets_offload_dump(struct Qdisc *sch) in ets_offload_dump() argument
182 qopt.handle = sch->handle; in ets_offload_dump()
183 qopt.parent = sch->parent; in ets_offload_dump()
184 qopt.stats.bstats = &sch->bstats; in ets_offload_dump()
185 qopt.stats.qstats = &sch->qstats; in ets_offload_dump()
187 return qdisc_offload_dump_helper(sch, TC_SETUP_QDISC_ETS, &qopt); in ets_offload_dump()
197 static int ets_class_change(struct Qdisc *sch, u32 classid, u32 parentid, in ets_class_change() argument
201 struct ets_class *cl = ets_class_from_arg(sch, *arg); in ets_class_change()
202 struct ets_sched *q = qdisc_priv(sch); in ets_class_change()
234 err = ets_quantum_parse(sch, tb[TCA_ETS_QUANTA_BAND], &quantum, in ets_class_change()
239 sch_tree_lock(sch); in ets_class_change()
241 sch_tree_unlock(sch); in ets_class_change()
243 ets_offload_change(sch); in ets_class_change()
247 static int ets_class_graft(struct Qdisc *sch, unsigned long arg, in ets_class_graft() argument
251 struct ets_class *cl = ets_class_from_arg(sch, arg); in ets_class_graft()
254 new = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, in ets_class_graft()
255 ets_class_id(sch, cl), NULL); in ets_class_graft()
262 *old = qdisc_replace(sch, new, &cl->qdisc); in ets_class_graft()
263 ets_offload_graft(sch, new, *old, arg, extack); in ets_class_graft()
267 static struct Qdisc *ets_class_leaf(struct Qdisc *sch, unsigned long arg) in ets_class_leaf() argument
269 struct ets_class *cl = ets_class_from_arg(sch, arg); in ets_class_leaf()
274 static unsigned long ets_class_find(struct Qdisc *sch, u32 classid) in ets_class_find() argument
277 struct ets_sched *q = qdisc_priv(sch); in ets_class_find()
284 static void ets_class_qlen_notify(struct Qdisc *sch, unsigned long arg) in ets_class_qlen_notify() argument
286 struct ets_class *cl = ets_class_from_arg(sch, arg); in ets_class_qlen_notify()
287 struct ets_sched *q = qdisc_priv(sch); in ets_class_qlen_notify()
293 if (!ets_class_is_strict(q, cl) && sch->q.qlen) in ets_class_qlen_notify()
297 static int ets_class_dump(struct Qdisc *sch, unsigned long arg, in ets_class_dump() argument
300 struct ets_class *cl = ets_class_from_arg(sch, arg); in ets_class_dump()
301 struct ets_sched *q = qdisc_priv(sch); in ets_class_dump()
305 tcm->tcm_handle = ets_class_id(sch, cl); in ets_class_dump()
322 static int ets_class_dump_stats(struct Qdisc *sch, unsigned long arg, in ets_class_dump_stats() argument
325 struct ets_class *cl = ets_class_from_arg(sch, arg); in ets_class_dump_stats()
335 static void ets_qdisc_walk(struct Qdisc *sch, struct qdisc_walker *arg) in ets_qdisc_walk() argument
337 struct ets_sched *q = qdisc_priv(sch); in ets_qdisc_walk()
348 if (arg->fn(sch, i + 1, arg) < 0) { in ets_qdisc_walk()
357 ets_qdisc_tcf_block(struct Qdisc *sch, unsigned long cl, in ets_qdisc_tcf_block() argument
360 struct ets_sched *q = qdisc_priv(sch); in ets_qdisc_tcf_block()
370 static unsigned long ets_qdisc_bind_tcf(struct Qdisc *sch, unsigned long parent, in ets_qdisc_bind_tcf() argument
373 return ets_class_find(sch, classid); in ets_qdisc_bind_tcf()
376 static void ets_qdisc_unbind_tcf(struct Qdisc *sch, unsigned long arg) in ets_qdisc_unbind_tcf() argument
380 static struct ets_class *ets_classify(struct sk_buff *skb, struct Qdisc *sch, in ets_classify() argument
383 struct ets_sched *q = qdisc_priv(sch); in ets_classify()
390 if (TC_H_MAJ(skb->priority) != sch->handle) { in ets_classify()
417 static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch, in ets_qdisc_enqueue() argument
421 struct ets_sched *q = qdisc_priv(sch); in ets_qdisc_enqueue()
426 cl = ets_classify(skb, sch, &err); in ets_qdisc_enqueue()
429 qdisc_qstats_drop(sch); in ets_qdisc_enqueue()
439 qdisc_qstats_drop(sch); in ets_qdisc_enqueue()
449 sch->qstats.backlog += len; in ets_qdisc_enqueue()
450 sch->q.qlen++; in ets_qdisc_enqueue()
455 ets_qdisc_dequeue_skb(struct Qdisc *sch, struct sk_buff *skb) in ets_qdisc_dequeue_skb() argument
457 qdisc_bstats_update(sch, skb); in ets_qdisc_dequeue_skb()
458 qdisc_qstats_backlog_dec(sch, skb); in ets_qdisc_dequeue_skb()
459 sch->q.qlen--; in ets_qdisc_dequeue_skb()
463 static struct sk_buff *ets_qdisc_dequeue(struct Qdisc *sch) in ets_qdisc_dequeue() argument
465 struct ets_sched *q = qdisc_priv(sch); in ets_qdisc_dequeue()
476 return ets_qdisc_dequeue_skb(sch, skb); in ets_qdisc_dequeue()
497 return ets_qdisc_dequeue_skb(sch, skb); in ets_qdisc_dequeue()
546 static int ets_qdisc_quanta_parse(struct Qdisc *sch, struct nlattr *quanta_attr, in ets_qdisc_quanta_parse() argument
569 err = ets_quantum_parse(sch, attr, &quanta[band++], in ets_qdisc_quanta_parse()
583 static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt, in ets_qdisc_change() argument
588 struct ets_sched *q = qdisc_priv(sch); in ets_qdisc_change()
634 err = ets_qdisc_quanta_parse(sch, tb[TCA_ETS_QUANTA], in ets_qdisc_change()
644 quanta[i] = psched_mtu(qdisc_dev(sch)); in ets_qdisc_change()
649 queues[i] = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, in ets_qdisc_change()
650 ets_class_id(sch, &q->classes[i]), in ets_qdisc_change()
659 sch_tree_lock(sch); in ets_qdisc_change()
685 sch_tree_unlock(sch); in ets_qdisc_change()
687 ets_offload_change(sch); in ets_qdisc_change()
699 static int ets_qdisc_init(struct Qdisc *sch, struct nlattr *opt, in ets_qdisc_init() argument
702 struct ets_sched *q = qdisc_priv(sch); in ets_qdisc_init()
708 err = tcf_block_get(&q->block, &q->filter_list, sch, extack); in ets_qdisc_init()
716 return ets_qdisc_change(sch, opt, extack); in ets_qdisc_init()
719 static void ets_qdisc_reset(struct Qdisc *sch) in ets_qdisc_reset() argument
721 struct ets_sched *q = qdisc_priv(sch); in ets_qdisc_reset()
730 sch->qstats.backlog = 0; in ets_qdisc_reset()
731 sch->q.qlen = 0; in ets_qdisc_reset()
734 static void ets_qdisc_destroy(struct Qdisc *sch) in ets_qdisc_destroy() argument
736 struct ets_sched *q = qdisc_priv(sch); in ets_qdisc_destroy()
739 ets_offload_destroy(sch); in ets_qdisc_destroy()
745 static int ets_qdisc_dump(struct Qdisc *sch, struct sk_buff *skb) in ets_qdisc_dump() argument
747 struct ets_sched *q = qdisc_priv(sch); in ets_qdisc_dump()
754 err = ets_offload_dump(sch); in ets_qdisc_dump()