Lines Matching refs:cl
313 struct qfq_class *cl) in qfq_add_to_agg() argument
315 cl->agg = agg; in qfq_add_to_agg()
318 if (cl->qdisc->q.qlen > 0) { /* adding an active class */ in qfq_add_to_agg()
319 list_add_tail(&cl->alist, &agg->active); in qfq_add_to_agg()
321 cl && q->in_serv_agg != agg) /* agg was inactive */ in qfq_add_to_agg()
341 static void qfq_deactivate_class(struct qfq_sched *q, struct qfq_class *cl) in qfq_deactivate_class() argument
343 struct qfq_aggregate *agg = cl->agg; in qfq_deactivate_class()
346 list_del(&cl->alist); /* remove from RR queue of the aggregate */ in qfq_deactivate_class()
352 static void qfq_rm_from_agg(struct qfq_sched *q, struct qfq_class *cl) in qfq_rm_from_agg() argument
354 struct qfq_aggregate *agg = cl->agg; in qfq_rm_from_agg()
356 cl->agg = NULL; in qfq_rm_from_agg()
365 static void qfq_deact_rm_from_agg(struct qfq_sched *q, struct qfq_class *cl) in qfq_deact_rm_from_agg() argument
367 if (cl->qdisc->q.qlen > 0) /* class is active */ in qfq_deact_rm_from_agg()
368 qfq_deactivate_class(q, cl); in qfq_deact_rm_from_agg()
370 qfq_rm_from_agg(q, cl); in qfq_deact_rm_from_agg()
374 static int qfq_change_agg(struct Qdisc *sch, struct qfq_class *cl, u32 weight, in qfq_change_agg() argument
386 qfq_deact_rm_from_agg(q, cl); in qfq_change_agg()
387 qfq_add_to_agg(q, new_agg, cl); in qfq_change_agg()
397 struct qfq_class *cl = (struct qfq_class *)*arg; in qfq_change_class() local
436 if (cl != NULL && in qfq_change_class()
437 lmax == cl->agg->lmax && in qfq_change_class()
438 weight == cl->agg->class_weight) in qfq_change_class()
441 delta_w = weight - (cl ? cl->agg->class_weight : 0); in qfq_change_class()
449 if (cl != NULL) { /* modify existing class */ in qfq_change_class()
451 err = gen_replace_estimator(&cl->bstats, NULL, in qfq_change_class()
452 &cl->rate_est, in qfq_change_class()
464 cl = kzalloc(sizeof(struct qfq_class), GFP_KERNEL); in qfq_change_class()
465 if (cl == NULL) in qfq_change_class()
468 gnet_stats_basic_sync_init(&cl->bstats); in qfq_change_class()
469 cl->common.classid = classid; in qfq_change_class()
470 cl->deficit = lmax; in qfq_change_class()
472 cl->qdisc = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, in qfq_change_class()
474 if (cl->qdisc == NULL) in qfq_change_class()
475 cl->qdisc = &noop_qdisc; in qfq_change_class()
478 err = gen_new_estimator(&cl->bstats, NULL, in qfq_change_class()
479 &cl->rate_est, in qfq_change_class()
487 if (cl->qdisc != &noop_qdisc) in qfq_change_class()
488 qdisc_hash_add(cl->qdisc, true); in qfq_change_class()
498 gen_kill_estimator(&cl->rate_est); in qfq_change_class()
505 qfq_deact_rm_from_agg(q, cl); in qfq_change_class()
507 qdisc_class_hash_insert(&q->clhash, &cl->common); in qfq_change_class()
508 qfq_add_to_agg(q, new_agg, cl); in qfq_change_class()
512 *arg = (unsigned long)cl; in qfq_change_class()
516 qdisc_put(cl->qdisc); in qfq_change_class()
517 kfree(cl); in qfq_change_class()
521 static void qfq_destroy_class(struct Qdisc *sch, struct qfq_class *cl) in qfq_destroy_class() argument
525 qfq_rm_from_agg(q, cl); in qfq_destroy_class()
526 gen_kill_estimator(&cl->rate_est); in qfq_destroy_class()
527 qdisc_put(cl->qdisc); in qfq_destroy_class()
528 kfree(cl); in qfq_destroy_class()
535 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_delete_class() local
537 if (cl->filter_cnt > 0) in qfq_delete_class()
542 qdisc_purge_queue(cl->qdisc); in qfq_delete_class()
543 qdisc_class_hash_remove(&q->clhash, &cl->common); in qfq_delete_class()
547 qfq_destroy_class(sch, cl); in qfq_delete_class()
556 static struct tcf_block *qfq_tcf_block(struct Qdisc *sch, unsigned long cl, in qfq_tcf_block() argument
561 if (cl) in qfq_tcf_block()
570 struct qfq_class *cl = qfq_find_class(sch, classid); in qfq_bind_tcf() local
572 if (cl != NULL) in qfq_bind_tcf()
573 cl->filter_cnt++; in qfq_bind_tcf()
575 return (unsigned long)cl; in qfq_bind_tcf()
580 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_unbind_tcf() local
582 cl->filter_cnt--; in qfq_unbind_tcf()
589 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_graft_class() local
593 cl->common.classid, NULL); in qfq_graft_class()
598 *old = qdisc_replace(sch, new, &cl->qdisc); in qfq_graft_class()
604 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_class_leaf() local
606 return cl->qdisc; in qfq_class_leaf()
612 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_dump_class() local
616 tcm->tcm_handle = cl->common.classid; in qfq_dump_class()
617 tcm->tcm_info = cl->qdisc->handle; in qfq_dump_class()
622 if (nla_put_u32(skb, TCA_QFQ_WEIGHT, cl->agg->class_weight) || in qfq_dump_class()
623 nla_put_u32(skb, TCA_QFQ_LMAX, cl->agg->lmax)) in qfq_dump_class()
635 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_dump_class_stats() local
640 xstats.weight = cl->agg->class_weight; in qfq_dump_class_stats()
641 xstats.lmax = cl->agg->lmax; in qfq_dump_class_stats()
643 if (gnet_stats_copy_basic(d, NULL, &cl->bstats, true) < 0 || in qfq_dump_class_stats()
644 gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 || in qfq_dump_class_stats()
645 qdisc_qstats_copy(d, cl->qdisc) < 0) in qfq_dump_class_stats()
654 struct qfq_class *cl; in qfq_walk() local
661 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { in qfq_walk()
662 if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg)) in qfq_walk()
672 struct qfq_class *cl; in qfq_classify() local
679 cl = qfq_find_class(sch, skb->priority); in qfq_classify()
680 if (cl != NULL) in qfq_classify()
681 return cl; in qfq_classify()
699 cl = (struct qfq_class *)res.class; in qfq_classify()
700 if (cl == NULL) in qfq_classify()
701 cl = qfq_find_class(sch, res.classid); in qfq_classify()
702 return cl; in qfq_classify()
967 struct qfq_class *cl, unsigned int len) in agg_dequeue() argument
969 qdisc_dequeue_peeked(cl->qdisc); in agg_dequeue()
971 cl->deficit -= (int) len; in agg_dequeue()
973 if (cl->qdisc->q.qlen == 0) /* no more packets, remove from list */ in agg_dequeue()
974 list_del(&cl->alist); in agg_dequeue()
975 else if (cl->deficit < qdisc_pkt_len(cl->qdisc->ops->peek(cl->qdisc))) { in agg_dequeue()
976 cl->deficit += agg->lmax; in agg_dequeue()
977 list_move_tail(&cl->alist, &agg->active); in agg_dequeue()
982 struct qfq_class **cl, in qfq_peek_skb() argument
987 *cl = list_first_entry(&agg->active, struct qfq_class, alist); in qfq_peek_skb()
988 skb = (*cl)->qdisc->ops->peek((*cl)->qdisc); in qfq_peek_skb()
1073 struct qfq_class *cl; in qfq_dequeue() local
1082 skb = qfq_peek_skb(in_serv_agg, &cl, &len); in qfq_dequeue()
1119 skb = qfq_peek_skb(in_serv_agg, &cl, &len); in qfq_dequeue()
1128 agg_dequeue(in_serv_agg, cl, len); in qfq_dequeue()
1194 struct qfq_class *cl; in qfq_enqueue() local
1199 cl = qfq_classify(skb, sch, &err); in qfq_enqueue()
1200 if (cl == NULL) { in qfq_enqueue()
1206 pr_debug("qfq_enqueue: cl = %x\n", cl->common.classid); in qfq_enqueue()
1208 if (unlikely(cl->agg->lmax < len)) { in qfq_enqueue()
1210 cl->agg->lmax, len, cl->common.classid); in qfq_enqueue()
1211 err = qfq_change_agg(sch, cl, cl->agg->class_weight, len); in qfq_enqueue()
1213 cl->qstats.drops++; in qfq_enqueue()
1219 first = !cl->qdisc->q.qlen; in qfq_enqueue()
1220 err = qdisc_enqueue(skb, cl->qdisc, to_free); in qfq_enqueue()
1224 cl->qstats.drops++; in qfq_enqueue()
1230 _bstats_update(&cl->bstats, len, gso_segs); in qfq_enqueue()
1234 agg = cl->agg; in qfq_enqueue()
1237 if (unlikely(skb == cl->qdisc->ops->peek(cl->qdisc)) && in qfq_enqueue()
1239 == cl && cl->deficit < len) in qfq_enqueue()
1240 list_move_tail(&cl->alist, &agg->active); in qfq_enqueue()
1246 cl->deficit = agg->lmax; in qfq_enqueue()
1247 list_add_tail(&cl->alist, &agg->active); in qfq_enqueue()
1249 if (list_first_entry(&agg->active, struct qfq_class, alist) != cl || in qfq_enqueue()
1396 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_qlen_notify() local
1398 qfq_deactivate_class(q, cl); in qfq_qlen_notify()
1443 struct qfq_class *cl; in qfq_reset_qdisc() local
1447 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { in qfq_reset_qdisc()
1448 if (cl->qdisc->q.qlen > 0) in qfq_reset_qdisc()
1449 qfq_deactivate_class(q, cl); in qfq_reset_qdisc()
1451 qdisc_reset(cl->qdisc); in qfq_reset_qdisc()
1459 struct qfq_class *cl; in qfq_destroy_qdisc() local
1466 hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i], in qfq_destroy_qdisc()
1468 qfq_destroy_class(sch, cl); in qfq_destroy_qdisc()