Lines Matching refs:sch

19 static int bfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch,  in bfifo_enqueue()  argument
22 if (likely(sch->qstats.backlog + qdisc_pkt_len(skb) <= sch->limit)) in bfifo_enqueue()
23 return qdisc_enqueue_tail(skb, sch); in bfifo_enqueue()
25 return qdisc_drop(skb, sch, to_free); in bfifo_enqueue()
28 static int pfifo_enqueue(struct sk_buff *skb, struct Qdisc *sch, in pfifo_enqueue() argument
31 if (likely(sch->q.qlen < sch->limit)) in pfifo_enqueue()
32 return qdisc_enqueue_tail(skb, sch); in pfifo_enqueue()
34 return qdisc_drop(skb, sch, to_free); in pfifo_enqueue()
37 static int pfifo_tail_enqueue(struct sk_buff *skb, struct Qdisc *sch, in pfifo_tail_enqueue() argument
42 if (likely(sch->q.qlen < sch->limit)) in pfifo_tail_enqueue()
43 return qdisc_enqueue_tail(skb, sch); in pfifo_tail_enqueue()
45 prev_backlog = sch->qstats.backlog; in pfifo_tail_enqueue()
47 __qdisc_queue_drop_head(sch, &sch->q, to_free); in pfifo_tail_enqueue()
48 qdisc_qstats_drop(sch); in pfifo_tail_enqueue()
49 qdisc_enqueue_tail(skb, sch); in pfifo_tail_enqueue()
51 qdisc_tree_reduce_backlog(sch, 0, prev_backlog - sch->qstats.backlog); in pfifo_tail_enqueue()
55 static void fifo_offload_init(struct Qdisc *sch) in fifo_offload_init() argument
57 struct net_device *dev = qdisc_dev(sch); in fifo_offload_init()
64 qopt.handle = sch->handle; in fifo_offload_init()
65 qopt.parent = sch->parent; in fifo_offload_init()
69 static void fifo_offload_destroy(struct Qdisc *sch) in fifo_offload_destroy() argument
71 struct net_device *dev = qdisc_dev(sch); in fifo_offload_destroy()
78 qopt.handle = sch->handle; in fifo_offload_destroy()
79 qopt.parent = sch->parent; in fifo_offload_destroy()
83 static int fifo_offload_dump(struct Qdisc *sch) in fifo_offload_dump() argument
88 qopt.handle = sch->handle; in fifo_offload_dump()
89 qopt.parent = sch->parent; in fifo_offload_dump()
90 qopt.stats.bstats = &sch->bstats; in fifo_offload_dump()
91 qopt.stats.qstats = &sch->qstats; in fifo_offload_dump()
93 return qdisc_offload_dump_helper(sch, TC_SETUP_QDISC_FIFO, &qopt); in fifo_offload_dump()
96 static int __fifo_init(struct Qdisc *sch, struct nlattr *opt, in __fifo_init() argument
100 bool is_bfifo = sch->ops == &bfifo_qdisc_ops; in __fifo_init()
103 u32 limit = qdisc_dev(sch)->tx_queue_len; in __fifo_init()
106 limit *= psched_mtu(qdisc_dev(sch)); in __fifo_init()
108 sch->limit = limit; in __fifo_init()
115 sch->limit = ctl->limit; in __fifo_init()
119 bypass = sch->limit >= psched_mtu(qdisc_dev(sch)); in __fifo_init()
121 bypass = sch->limit >= 1; in __fifo_init()
124 sch->flags |= TCQ_F_CAN_BYPASS; in __fifo_init()
126 sch->flags &= ~TCQ_F_CAN_BYPASS; in __fifo_init()
131 static int fifo_init(struct Qdisc *sch, struct nlattr *opt, in fifo_init() argument
136 err = __fifo_init(sch, opt, extack); in fifo_init()
140 fifo_offload_init(sch); in fifo_init()
144 static int fifo_hd_init(struct Qdisc *sch, struct nlattr *opt, in fifo_hd_init() argument
147 return __fifo_init(sch, opt, extack); in fifo_hd_init()
150 static void fifo_destroy(struct Qdisc *sch) in fifo_destroy() argument
152 fifo_offload_destroy(sch); in fifo_destroy()
155 static int __fifo_dump(struct Qdisc *sch, struct sk_buff *skb) in __fifo_dump() argument
157 struct tc_fifo_qopt opt = { .limit = sch->limit }; in __fifo_dump()
167 static int fifo_dump(struct Qdisc *sch, struct sk_buff *skb) in fifo_dump() argument
171 err = fifo_offload_dump(sch); in fifo_dump()
175 return __fifo_dump(sch, skb); in fifo_dump()
178 static int fifo_hd_dump(struct Qdisc *sch, struct sk_buff *skb) in fifo_hd_dump() argument
180 return __fifo_dump(sch, skb); in fifo_hd_dump()
252 struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops, in fifo_create_dflt() argument
259 q = qdisc_create_dflt(sch->dev_queue, ops, TC_H_MAKE(sch->handle, 1), in fifo_create_dflt()