Lines Matching refs:sch
24 static int mq_offload(struct Qdisc *sch, enum tc_mq_command cmd) in mq_offload() argument
26 struct net_device *dev = qdisc_dev(sch); in mq_offload()
29 .handle = sch->handle, in mq_offload()
38 static int mq_offload_stats(struct Qdisc *sch) in mq_offload_stats() argument
42 .handle = sch->handle, in mq_offload_stats()
44 .bstats = &sch->bstats, in mq_offload_stats()
45 .qstats = &sch->qstats, in mq_offload_stats()
49 return qdisc_offload_dump_helper(sch, TC_SETUP_QDISC_MQ, &opt); in mq_offload_stats()
52 static void mq_destroy(struct Qdisc *sch) in mq_destroy() argument
54 struct net_device *dev = qdisc_dev(sch); in mq_destroy()
55 struct mq_sched *priv = qdisc_priv(sch); in mq_destroy()
58 mq_offload(sch, TC_MQ_DESTROY); in mq_destroy()
67 static int mq_init(struct Qdisc *sch, struct nlattr *opt, in mq_init() argument
70 struct net_device *dev = qdisc_dev(sch); in mq_init()
71 struct mq_sched *priv = qdisc_priv(sch); in mq_init()
76 if (sch->parent != TC_H_ROOT) in mq_init()
91 TC_H_MAKE(TC_H_MAJ(sch->handle), in mq_init()
100 sch->flags |= TCQ_F_MQROOT; in mq_init()
102 mq_offload(sch, TC_MQ_CREATE); in mq_init()
106 static void mq_attach(struct Qdisc *sch) in mq_attach() argument
108 struct net_device *dev = qdisc_dev(sch); in mq_attach()
109 struct mq_sched *priv = qdisc_priv(sch); in mq_attach()
128 static int mq_dump(struct Qdisc *sch, struct sk_buff *skb) in mq_dump() argument
130 struct net_device *dev = qdisc_dev(sch); in mq_dump()
134 sch->q.qlen = 0; in mq_dump()
135 gnet_stats_basic_sync_init(&sch->bstats); in mq_dump()
136 memset(&sch->qstats, 0, sizeof(sch->qstats)); in mq_dump()
147 gnet_stats_add_basic(&sch->bstats, qdisc->cpu_bstats, in mq_dump()
149 gnet_stats_add_queue(&sch->qstats, qdisc->cpu_qstats, in mq_dump()
151 sch->q.qlen += qdisc_qlen(qdisc); in mq_dump()
156 return mq_offload_stats(sch); in mq_dump()
159 static struct netdev_queue *mq_queue_get(struct Qdisc *sch, unsigned long cl) in mq_queue_get() argument
161 struct net_device *dev = qdisc_dev(sch); in mq_queue_get()
169 static struct netdev_queue *mq_select_queue(struct Qdisc *sch, in mq_select_queue() argument
172 return mq_queue_get(sch, TC_H_MIN(tcm->tcm_parent)); in mq_select_queue()
175 static int mq_graft(struct Qdisc *sch, unsigned long cl, struct Qdisc *new, in mq_graft() argument
178 struct netdev_queue *dev_queue = mq_queue_get(sch, cl); in mq_graft()
180 struct net_device *dev = qdisc_dev(sch); in mq_graft()
191 graft_offload.handle = sch->handle; in mq_graft()
196 qdisc_offload_graft_helper(qdisc_dev(sch), sch, new, *old, in mq_graft()
201 static struct Qdisc *mq_leaf(struct Qdisc *sch, unsigned long cl) in mq_leaf() argument
203 struct netdev_queue *dev_queue = mq_queue_get(sch, cl); in mq_leaf()
208 static unsigned long mq_find(struct Qdisc *sch, u32 classid) in mq_find() argument
212 if (!mq_queue_get(sch, ntx)) in mq_find()
217 static int mq_dump_class(struct Qdisc *sch, unsigned long cl, in mq_dump_class() argument
220 struct netdev_queue *dev_queue = mq_queue_get(sch, cl); in mq_dump_class()
228 static int mq_dump_class_stats(struct Qdisc *sch, unsigned long cl, in mq_dump_class_stats() argument
231 struct netdev_queue *dev_queue = mq_queue_get(sch, cl); in mq_dump_class_stats()
233 sch = dev_queue->qdisc_sleeping; in mq_dump_class_stats()
234 if (gnet_stats_copy_basic(d, sch->cpu_bstats, &sch->bstats, true) < 0 || in mq_dump_class_stats()
235 qdisc_qstats_copy(d, sch) < 0) in mq_dump_class_stats()
240 static void mq_walk(struct Qdisc *sch, struct qdisc_walker *arg) in mq_walk() argument
242 struct net_device *dev = qdisc_dev(sch); in mq_walk()
250 if (arg->fn(sch, ntx + 1, arg) < 0) { in mq_walk()