Lines Matching refs:cl
58 struct drr_class *cl = (struct drr_class *)*arg;
83 if (cl != NULL) {
85 err = gen_replace_estimator(&cl->bstats, NULL,
86 &cl->rate_est,
97 cl->quantum = quantum;
103 cl = kzalloc(sizeof(struct drr_class), GFP_KERNEL);
104 if (cl == NULL)
107 gnet_stats_basic_sync_init(&cl->bstats);
108 cl->common.classid = classid;
109 cl->quantum = quantum;
110 cl->qdisc = qdisc_create_dflt(sch->dev_queue,
113 if (cl->qdisc == NULL)
114 cl->qdisc = &noop_qdisc;
116 qdisc_hash_add(cl->qdisc, true);
119 err = gen_replace_estimator(&cl->bstats, NULL, &cl->rate_est,
123 qdisc_put(cl->qdisc);
124 kfree(cl);
130 qdisc_class_hash_insert(&q->clhash, &cl->common);
135 *arg = (unsigned long)cl;
139 static void drr_destroy_class(struct Qdisc *sch, struct drr_class *cl)
141 gen_kill_estimator(&cl->rate_est);
142 qdisc_put(cl->qdisc);
143 kfree(cl);
150 struct drr_class *cl = (struct drr_class *)arg;
152 if (qdisc_class_in_use(&cl->common)) {
159 qdisc_purge_queue(cl->qdisc);
160 qdisc_class_hash_remove(&q->clhash, &cl->common);
164 drr_destroy_class(sch, cl);
173 static struct tcf_block *drr_tcf_block(struct Qdisc *sch, unsigned long cl,
178 if (cl) {
189 struct drr_class *cl = drr_find_class(sch, classid);
191 if (cl)
192 qdisc_class_get(&cl->common);
194 return (unsigned long)cl;
199 struct drr_class *cl = (struct drr_class *)arg;
201 qdisc_class_put(&cl->common);
208 struct drr_class *cl = (struct drr_class *)arg;
212 cl->common.classid, NULL);
217 *old = qdisc_replace(sch, new, &cl->qdisc);
223 struct drr_class *cl = (struct drr_class *)arg;
225 return cl->qdisc;
230 struct drr_class *cl = (struct drr_class *)arg;
232 list_del(&cl->alist);
238 struct drr_class *cl = (struct drr_class *)arg;
242 tcm->tcm_handle = cl->common.classid;
243 tcm->tcm_info = cl->qdisc->handle;
248 if (nla_put_u32(skb, TCA_DRR_QUANTUM, cl->quantum))
260 struct drr_class *cl = (struct drr_class *)arg;
261 __u32 qlen = qdisc_qlen_sum(cl->qdisc);
262 struct Qdisc *cl_q = cl->qdisc;
267 xstats.deficit = cl->deficit;
269 if (gnet_stats_copy_basic(d, NULL, &cl->bstats, true) < 0 ||
270 gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
280 struct drr_class *cl;
287 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
288 if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg))
298 struct drr_class *cl;
304 cl = drr_find_class(sch, skb->priority);
305 if (cl != NULL)
306 return cl;
324 cl = (struct drr_class *)res.class;
325 if (cl == NULL)
326 cl = drr_find_class(sch, res.classid);
327 return cl;
337 struct drr_class *cl;
341 cl = drr_classify(skb, sch, &err);
342 if (cl == NULL) {
349 first = !cl->qdisc->q.qlen;
350 err = qdisc_enqueue(skb, cl->qdisc, to_free);
353 cl->qstats.drops++;
360 list_add_tail(&cl->alist, &q->active);
361 cl->deficit = cl->quantum;
372 struct drr_class *cl;
379 cl = list_first_entry(&q->active, struct drr_class, alist);
380 skb = cl->qdisc->ops->peek(cl->qdisc);
382 qdisc_warn_nonwc(__func__, cl->qdisc);
387 if (len <= cl->deficit) {
388 cl->deficit -= len;
389 skb = qdisc_dequeue_peeked(cl->qdisc);
392 if (cl->qdisc->q.qlen == 0)
393 list_del(&cl->alist);
395 bstats_update(&cl->bstats, skb);
402 cl->deficit += cl->quantum;
403 list_move_tail(&cl->alist, &q->active);
428 struct drr_class *cl;
432 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
433 if (cl->qdisc->q.qlen)
434 list_del(&cl->alist);
435 qdisc_reset(cl->qdisc);
443 struct drr_class *cl;
450 hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i],
452 drr_destroy_class(sch, cl);