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 cl->common.classid = classid; in qfq_change_class()
469 cl->deficit = lmax; in qfq_change_class()
471 cl->qdisc = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, in qfq_change_class()
473 if (cl->qdisc == NULL) in qfq_change_class()
474 cl->qdisc = &noop_qdisc; in qfq_change_class()
477 err = gen_new_estimator(&cl->bstats, NULL, in qfq_change_class()
478 &cl->rate_est, in qfq_change_class()
486 if (cl->qdisc != &noop_qdisc) in qfq_change_class()
487 qdisc_hash_add(cl->qdisc, true); in qfq_change_class()
497 gen_kill_estimator(&cl->rate_est); in qfq_change_class()
504 qfq_deact_rm_from_agg(q, cl); in qfq_change_class()
506 qdisc_class_hash_insert(&q->clhash, &cl->common); in qfq_change_class()
507 qfq_add_to_agg(q, new_agg, cl); in qfq_change_class()
511 *arg = (unsigned long)cl; in qfq_change_class()
515 qdisc_put(cl->qdisc); in qfq_change_class()
516 kfree(cl); in qfq_change_class()
520 static void qfq_destroy_class(struct Qdisc *sch, struct qfq_class *cl) in qfq_destroy_class() argument
524 qfq_rm_from_agg(q, cl); in qfq_destroy_class()
525 gen_kill_estimator(&cl->rate_est); in qfq_destroy_class()
526 qdisc_put(cl->qdisc); in qfq_destroy_class()
527 kfree(cl); in qfq_destroy_class()
533 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_delete_class() local
535 if (cl->filter_cnt > 0) in qfq_delete_class()
540 qdisc_purge_queue(cl->qdisc); in qfq_delete_class()
541 qdisc_class_hash_remove(&q->clhash, &cl->common); in qfq_delete_class()
545 qfq_destroy_class(sch, cl); in qfq_delete_class()
554 static struct tcf_block *qfq_tcf_block(struct Qdisc *sch, unsigned long cl, in qfq_tcf_block() argument
559 if (cl) in qfq_tcf_block()
568 struct qfq_class *cl = qfq_find_class(sch, classid); in qfq_bind_tcf() local
570 if (cl != NULL) in qfq_bind_tcf()
571 cl->filter_cnt++; in qfq_bind_tcf()
573 return (unsigned long)cl; in qfq_bind_tcf()
578 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_unbind_tcf() local
580 cl->filter_cnt--; in qfq_unbind_tcf()
587 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_graft_class() local
591 cl->common.classid, NULL); in qfq_graft_class()
596 *old = qdisc_replace(sch, new, &cl->qdisc); in qfq_graft_class()
602 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_class_leaf() local
604 return cl->qdisc; in qfq_class_leaf()
610 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_dump_class() local
614 tcm->tcm_handle = cl->common.classid; in qfq_dump_class()
615 tcm->tcm_info = cl->qdisc->handle; in qfq_dump_class()
620 if (nla_put_u32(skb, TCA_QFQ_WEIGHT, cl->agg->class_weight) || in qfq_dump_class()
621 nla_put_u32(skb, TCA_QFQ_LMAX, cl->agg->lmax)) in qfq_dump_class()
633 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_dump_class_stats() local
638 xstats.weight = cl->agg->class_weight; in qfq_dump_class_stats()
639 xstats.lmax = cl->agg->lmax; in qfq_dump_class_stats()
642 d, NULL, &cl->bstats) < 0 || in qfq_dump_class_stats()
643 gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 || in qfq_dump_class_stats()
644 qdisc_qstats_copy(d, cl->qdisc) < 0) in qfq_dump_class_stats()
653 struct qfq_class *cl; in qfq_walk() local
660 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { in qfq_walk()
665 if (arg->fn(sch, (unsigned long)cl, arg) < 0) { in qfq_walk()
678 struct qfq_class *cl; in qfq_classify() local
685 cl = qfq_find_class(sch, skb->priority); in qfq_classify()
686 if (cl != NULL) in qfq_classify()
687 return cl; in qfq_classify()
705 cl = (struct qfq_class *)res.class; in qfq_classify()
706 if (cl == NULL) in qfq_classify()
707 cl = qfq_find_class(sch, res.classid); in qfq_classify()
708 return cl; in qfq_classify()
973 struct qfq_class *cl, unsigned int len) in agg_dequeue() argument
975 qdisc_dequeue_peeked(cl->qdisc); in agg_dequeue()
977 cl->deficit -= (int) len; in agg_dequeue()
979 if (cl->qdisc->q.qlen == 0) /* no more packets, remove from list */ in agg_dequeue()
980 list_del(&cl->alist); in agg_dequeue()
981 else if (cl->deficit < qdisc_pkt_len(cl->qdisc->ops->peek(cl->qdisc))) { in agg_dequeue()
982 cl->deficit += agg->lmax; in agg_dequeue()
983 list_move_tail(&cl->alist, &agg->active); in agg_dequeue()
988 struct qfq_class **cl, in qfq_peek_skb() argument
993 *cl = list_first_entry(&agg->active, struct qfq_class, alist); in qfq_peek_skb()
994 skb = (*cl)->qdisc->ops->peek((*cl)->qdisc); in qfq_peek_skb()
1079 struct qfq_class *cl; in qfq_dequeue() local
1088 skb = qfq_peek_skb(in_serv_agg, &cl, &len); in qfq_dequeue()
1125 skb = qfq_peek_skb(in_serv_agg, &cl, &len); in qfq_dequeue()
1134 agg_dequeue(in_serv_agg, cl, len); in qfq_dequeue()
1200 struct qfq_class *cl; in qfq_enqueue() local
1205 cl = qfq_classify(skb, sch, &err); in qfq_enqueue()
1206 if (cl == NULL) { in qfq_enqueue()
1212 pr_debug("qfq_enqueue: cl = %x\n", cl->common.classid); in qfq_enqueue()
1214 if (unlikely(cl->agg->lmax < len)) { in qfq_enqueue()
1216 cl->agg->lmax, len, cl->common.classid); in qfq_enqueue()
1217 err = qfq_change_agg(sch, cl, cl->agg->class_weight, len); in qfq_enqueue()
1219 cl->qstats.drops++; in qfq_enqueue()
1225 first = !cl->qdisc->q.qlen; in qfq_enqueue()
1226 err = qdisc_enqueue(skb, cl->qdisc, to_free); in qfq_enqueue()
1230 cl->qstats.drops++; in qfq_enqueue()
1236 cl->bstats.bytes += len; in qfq_enqueue()
1237 cl->bstats.packets += gso_segs; in qfq_enqueue()
1241 agg = cl->agg; in qfq_enqueue()
1244 if (unlikely(skb == cl->qdisc->ops->peek(cl->qdisc)) && in qfq_enqueue()
1246 == cl && cl->deficit < len) in qfq_enqueue()
1247 list_move_tail(&cl->alist, &agg->active); in qfq_enqueue()
1253 cl->deficit = agg->lmax; in qfq_enqueue()
1254 list_add_tail(&cl->alist, &agg->active); in qfq_enqueue()
1256 if (list_first_entry(&agg->active, struct qfq_class, alist) != cl || in qfq_enqueue()
1403 struct qfq_class *cl = (struct qfq_class *)arg; in qfq_qlen_notify() local
1405 qfq_deactivate_class(q, cl); in qfq_qlen_notify()
1450 struct qfq_class *cl; in qfq_reset_qdisc() local
1454 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { in qfq_reset_qdisc()
1455 if (cl->qdisc->q.qlen > 0) in qfq_reset_qdisc()
1456 qfq_deactivate_class(q, cl); in qfq_reset_qdisc()
1458 qdisc_reset(cl->qdisc); in qfq_reset_qdisc()
1466 struct qfq_class *cl; in qfq_destroy_qdisc() local
1473 hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i], in qfq_destroy_qdisc()
1475 qfq_destroy_class(sch, cl); in qfq_destroy_qdisc()