Lines Matching refs:sch
299 static struct sk_buff *fq_dequeue_head(struct Qdisc *sch, struct fq_flow *flow) in fq_dequeue_head() argument
307 qdisc_qstats_backlog_dec(sch, skb); in fq_dequeue_head()
308 sch->q.qlen--; in fq_dequeue_head()
371 static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch) in fq_enqueue() argument
373 struct fq_sched_data *q = qdisc_priv(sch); in fq_enqueue()
376 if (unlikely(sch->q.qlen >= sch->limit)) in fq_enqueue()
377 return qdisc_drop(skb, sch); in fq_enqueue()
382 return qdisc_drop(skb, sch); in fq_enqueue()
388 qdisc_qstats_backlog_inc(sch, skb); in fq_enqueue()
402 sch->q.qlen++; in fq_enqueue()
428 static struct sk_buff *fq_dequeue(struct Qdisc *sch) in fq_dequeue() argument
430 struct fq_sched_data *q = qdisc_priv(sch); in fq_dequeue()
437 skb = fq_dequeue_head(sch, &q->internal); in fq_dequeue()
470 skb = fq_dequeue_head(sch, f); in fq_dequeue()
514 qdisc_bstats_update(sch, skb); in fq_dequeue()
518 static void fq_reset(struct Qdisc *sch) in fq_reset() argument
520 struct fq_sched_data *q = qdisc_priv(sch); in fq_reset()
527 while ((skb = fq_dequeue_head(sch, &q->internal)) != NULL) in fq_reset()
539 while ((skb = fq_dequeue_head(sch, f)) != NULL) in fq_reset()
613 static int fq_resize(struct Qdisc *sch, u32 log) in fq_resize() argument
615 struct fq_sched_data *q = qdisc_priv(sch); in fq_resize()
625 netdev_queue_numa_node_read(sch->dev_queue)); in fq_resize()
632 sch_tree_lock(sch); in fq_resize()
641 sch_tree_unlock(sch); in fq_resize()
660 static int fq_change(struct Qdisc *sch, struct nlattr *opt) in fq_change() argument
662 struct fq_sched_data *q = qdisc_priv(sch); in fq_change()
675 sch_tree_lock(sch); in fq_change()
688 sch->limit = nla_get_u32(tb[TCA_FQ_PLIMIT]); in fq_change()
731 sch_tree_unlock(sch); in fq_change()
732 err = fq_resize(sch, fq_log); in fq_change()
733 sch_tree_lock(sch); in fq_change()
735 while (sch->q.qlen > sch->limit) { in fq_change()
736 struct sk_buff *skb = fq_dequeue(sch); in fq_change()
744 qdisc_tree_reduce_backlog(sch, drop_count, drop_len); in fq_change()
746 sch_tree_unlock(sch); in fq_change()
750 static void fq_destroy(struct Qdisc *sch) in fq_destroy() argument
752 struct fq_sched_data *q = qdisc_priv(sch); in fq_destroy()
754 fq_reset(sch); in fq_destroy()
759 static int fq_init(struct Qdisc *sch, struct nlattr *opt) in fq_init() argument
761 struct fq_sched_data *q = qdisc_priv(sch); in fq_init()
764 sch->limit = 10000; in fq_init()
766 q->quantum = 2 * psched_mtu(qdisc_dev(sch)); in fq_init()
767 q->initial_quantum = 10 * psched_mtu(qdisc_dev(sch)); in fq_init()
777 qdisc_watchdog_init(&q->watchdog, sch); in fq_init()
780 err = fq_change(sch, opt); in fq_init()
782 err = fq_resize(sch, q->fq_trees_log); in fq_init()
787 static int fq_dump(struct Qdisc *sch, struct sk_buff *skb) in fq_dump() argument
789 struct fq_sched_data *q = qdisc_priv(sch); in fq_dump()
798 if (nla_put_u32(skb, TCA_FQ_PLIMIT, sch->limit) || in fq_dump()
816 static int fq_dump_stats(struct Qdisc *sch, struct gnet_dump *d) in fq_dump_stats() argument
818 struct fq_sched_data *q = qdisc_priv(sch); in fq_dump_stats()