Lines Matching refs:sch
296 static struct sk_buff *fq_dequeue_head(struct Qdisc *sch, struct fq_flow *flow) in fq_dequeue_head() argument
304 qdisc_qstats_backlog_dec(sch, skb); in fq_dequeue_head()
305 sch->q.qlen--; in fq_dequeue_head()
368 static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch) in fq_enqueue() argument
370 struct fq_sched_data *q = qdisc_priv(sch); in fq_enqueue()
373 if (unlikely(sch->q.qlen >= sch->limit)) in fq_enqueue()
374 return qdisc_drop(skb, sch); in fq_enqueue()
379 return qdisc_drop(skb, sch); in fq_enqueue()
385 qdisc_qstats_backlog_inc(sch, skb); in fq_enqueue()
399 sch->q.qlen++; in fq_enqueue()
425 static struct sk_buff *fq_dequeue(struct Qdisc *sch) in fq_dequeue() argument
427 struct fq_sched_data *q = qdisc_priv(sch); in fq_dequeue()
434 skb = fq_dequeue_head(sch, &q->internal); in fq_dequeue()
467 skb = fq_dequeue_head(sch, f); in fq_dequeue()
511 qdisc_bstats_update(sch, skb); in fq_dequeue()
515 static void fq_reset(struct Qdisc *sch) in fq_reset() argument
517 struct fq_sched_data *q = qdisc_priv(sch); in fq_reset()
524 while ((skb = fq_dequeue_head(sch, &q->internal)) != NULL) in fq_reset()
536 while ((skb = fq_dequeue_head(sch, f)) != NULL) in fq_reset()
610 static int fq_resize(struct Qdisc *sch, u32 log) in fq_resize() argument
612 struct fq_sched_data *q = qdisc_priv(sch); in fq_resize()
622 netdev_queue_numa_node_read(sch->dev_queue)); in fq_resize()
629 sch_tree_lock(sch); in fq_resize()
638 sch_tree_unlock(sch); in fq_resize()
657 static int fq_change(struct Qdisc *sch, struct nlattr *opt) in fq_change() argument
659 struct fq_sched_data *q = qdisc_priv(sch); in fq_change()
671 sch_tree_lock(sch); in fq_change()
684 sch->limit = nla_get_u32(tb[TCA_FQ_PLIMIT]); in fq_change()
727 sch_tree_unlock(sch); in fq_change()
728 err = fq_resize(sch, fq_log); in fq_change()
729 sch_tree_lock(sch); in fq_change()
731 while (sch->q.qlen > sch->limit) { in fq_change()
732 struct sk_buff *skb = fq_dequeue(sch); in fq_change()
739 qdisc_tree_decrease_qlen(sch, drop_count); in fq_change()
741 sch_tree_unlock(sch); in fq_change()
745 static void fq_destroy(struct Qdisc *sch) in fq_destroy() argument
747 struct fq_sched_data *q = qdisc_priv(sch); in fq_destroy()
749 fq_reset(sch); in fq_destroy()
754 static int fq_init(struct Qdisc *sch, struct nlattr *opt) in fq_init() argument
756 struct fq_sched_data *q = qdisc_priv(sch); in fq_init()
759 sch->limit = 10000; in fq_init()
761 q->quantum = 2 * psched_mtu(qdisc_dev(sch)); in fq_init()
762 q->initial_quantum = 10 * psched_mtu(qdisc_dev(sch)); in fq_init()
772 qdisc_watchdog_init(&q->watchdog, sch); in fq_init()
775 err = fq_change(sch, opt); in fq_init()
777 err = fq_resize(sch, q->fq_trees_log); in fq_init()
782 static int fq_dump(struct Qdisc *sch, struct sk_buff *skb) in fq_dump() argument
784 struct fq_sched_data *q = qdisc_priv(sch); in fq_dump()
793 if (nla_put_u32(skb, TCA_FQ_PLIMIT, sch->limit) || in fq_dump()
811 static int fq_dump_stats(struct Qdisc *sch, struct gnet_dump *d) in fq_dump_stats() argument
813 struct fq_sched_data *q = qdisc_priv(sch); in fq_dump_stats()