Lines Matching refs:cl

317 			   struct qfq_class *cl)
319 cl->agg = agg;
322 if (cl->qdisc->q.qlen > 0) { /* adding an active class */
323 list_add_tail(&cl->alist, &agg->active);
325 cl && q->in_serv_agg != agg) /* agg was inactive */
345 static void qfq_deactivate_class(struct qfq_sched *q, struct qfq_class *cl)
347 struct qfq_aggregate *agg = cl->agg;
350 list_del(&cl->alist); /* remove from RR queue of the aggregate */
356 static void qfq_rm_from_agg(struct qfq_sched *q, struct qfq_class *cl)
358 struct qfq_aggregate *agg = cl->agg;
360 cl->agg = NULL;
369 static void qfq_deact_rm_from_agg(struct qfq_sched *q, struct qfq_class *cl)
371 if (cl->qdisc->q.qlen > 0) /* class is active */
372 qfq_deactivate_class(q, cl);
374 qfq_rm_from_agg(q, cl);
378 static int qfq_change_agg(struct Qdisc *sch, struct qfq_class *cl, u32 weight,
395 qfq_deact_rm_from_agg(q, cl);
396 qfq_add_to_agg(q, new_agg, cl);
406 struct qfq_class *cl = (struct qfq_class *)*arg;
444 if (cl != NULL &&
445 lmax == cl->agg->lmax &&
446 weight == cl->agg->class_weight)
449 delta_w = weight - (cl ? cl->agg->class_weight : 0);
458 if (cl != NULL) { /* modify existing class */
460 err = gen_replace_estimator(&cl->bstats, NULL,
461 &cl->rate_est,
473 cl = kzalloc(sizeof(struct qfq_class), GFP_KERNEL);
474 if (cl == NULL)
477 gnet_stats_basic_sync_init(&cl->bstats);
478 cl->common.classid = classid;
479 cl->deficit = lmax;
481 cl->qdisc = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
483 if (cl->qdisc == NULL)
484 cl->qdisc = &noop_qdisc;
487 err = gen_new_estimator(&cl->bstats, NULL,
488 &cl->rate_est,
496 if (cl->qdisc != &noop_qdisc)
497 qdisc_hash_add(cl->qdisc, true);
507 gen_kill_estimator(&cl->rate_est);
514 qfq_deact_rm_from_agg(q, cl);
516 qdisc_class_hash_insert(&q->clhash, &cl->common);
517 qfq_add_to_agg(q, new_agg, cl);
521 *arg = (unsigned long)cl;
525 qdisc_put(cl->qdisc);
526 kfree(cl);
530 static void qfq_destroy_class(struct Qdisc *sch, struct qfq_class *cl)
534 qfq_rm_from_agg(q, cl);
535 gen_kill_estimator(&cl->rate_est);
536 qdisc_put(cl->qdisc);
537 kfree(cl);
544 struct qfq_class *cl = (struct qfq_class *)arg;
546 if (qdisc_class_in_use(&cl->common)) {
553 qdisc_purge_queue(cl->qdisc);
554 qdisc_class_hash_remove(&q->clhash, &cl->common);
558 qfq_destroy_class(sch, cl);
567 static struct tcf_block *qfq_tcf_block(struct Qdisc *sch, unsigned long cl,
572 if (cl)
581 struct qfq_class *cl = qfq_find_class(sch, classid);
583 if (cl)
584 qdisc_class_get(&cl->common);
586 return (unsigned long)cl;
591 struct qfq_class *cl = (struct qfq_class *)arg;
593 qdisc_class_put(&cl->common);
600 struct qfq_class *cl = (struct qfq_class *)arg;
604 cl->common.classid, NULL);
609 *old = qdisc_replace(sch, new, &cl->qdisc);
615 struct qfq_class *cl = (struct qfq_class *)arg;
617 return cl->qdisc;
623 struct qfq_class *cl = (struct qfq_class *)arg;
627 tcm->tcm_handle = cl->common.classid;
628 tcm->tcm_info = cl->qdisc->handle;
633 if (nla_put_u32(skb, TCA_QFQ_WEIGHT, cl->agg->class_weight) ||
634 nla_put_u32(skb, TCA_QFQ_LMAX, cl->agg->lmax))
646 struct qfq_class *cl = (struct qfq_class *)arg;
651 xstats.weight = cl->agg->class_weight;
652 xstats.lmax = cl->agg->lmax;
654 if (gnet_stats_copy_basic(d, NULL, &cl->bstats, true) < 0 ||
655 gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 ||
656 qdisc_qstats_copy(d, cl->qdisc) < 0)
665 struct qfq_class *cl;
672 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
673 if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg))
683 struct qfq_class *cl;
690 cl = qfq_find_class(sch, skb->priority);
691 if (cl != NULL)
692 return cl;
710 cl = (struct qfq_class *)res.class;
711 if (cl == NULL)
712 cl = qfq_find_class(sch, res.classid);
713 return cl;
978 struct qfq_class *cl, unsigned int len)
980 struct sk_buff *skb = qdisc_dequeue_peeked(cl->qdisc);
985 cl->deficit -= (int) len;
987 if (cl->qdisc->q.qlen == 0) /* no more packets, remove from list */
988 list_del(&cl->alist);
989 else if (cl->deficit < qdisc_pkt_len(cl->qdisc->ops->peek(cl->qdisc))) {
990 cl->deficit += agg->lmax;
991 list_move_tail(&cl->alist, &agg->active);
998 struct qfq_class **cl,
1003 *cl = list_first_entry(&agg->active, struct qfq_class, alist);
1004 skb = (*cl)->qdisc->ops->peek((*cl)->qdisc);
1006 qdisc_warn_nonwc("qfq_dequeue", (*cl)->qdisc);
1089 struct qfq_class *cl;
1098 skb = qfq_peek_skb(in_serv_agg, &cl, &len);
1135 skb = qfq_peek_skb(in_serv_agg, &cl, &len);
1142 skb = agg_dequeue(in_serv_agg, cl, len);
1217 struct qfq_class *cl;
1222 cl = qfq_classify(skb, sch, &err);
1223 if (cl == NULL) {
1229 pr_debug("qfq_enqueue: cl = %x\n", cl->common.classid);
1231 if (unlikely(cl->agg->lmax < len)) {
1233 cl->agg->lmax, len, cl->common.classid);
1234 err = qfq_change_agg(sch, cl, cl->agg->class_weight, len);
1236 cl->qstats.drops++;
1242 first = !cl->qdisc->q.qlen;
1243 err = qdisc_enqueue(skb, cl->qdisc, to_free);
1247 cl->qstats.drops++;
1253 _bstats_update(&cl->bstats, len, gso_segs);
1257 agg = cl->agg;
1260 if (unlikely(skb == cl->qdisc->ops->peek(cl->qdisc)) &&
1262 == cl && cl->deficit < len)
1263 list_move_tail(&cl->alist, &agg->active);
1269 cl->deficit = agg->lmax;
1270 list_add_tail(&cl->alist, &agg->active);
1272 if (list_first_entry(&agg->active, struct qfq_class, alist) != cl ||
1419 struct qfq_class *cl = (struct qfq_class *)arg;
1421 qfq_deactivate_class(q, cl);
1466 struct qfq_class *cl;
1470 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) {
1471 if (cl->qdisc->q.qlen > 0)
1472 qfq_deactivate_class(q, cl);
1474 qdisc_reset(cl->qdisc);
1482 struct qfq_class *cl;
1489 hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i],
1491 qfq_destroy_class(sch, cl);