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