Lines Matching refs:cl
220 struct htb_class *cl; in htb_classify() local
231 cl = htb_find(skb->priority, sch); in htb_classify()
232 if (cl) { in htb_classify()
233 if (cl->level == 0) in htb_classify()
234 return cl; in htb_classify()
236 tcf = rcu_dereference_bh(cl->filter_list); in htb_classify()
254 cl = (void *)res.class; in htb_classify()
255 if (!cl) { in htb_classify()
258 cl = htb_find(res.classid, sch); in htb_classify()
259 if (!cl) in htb_classify()
262 if (!cl->level) in htb_classify()
263 return cl; /* we hit leaf; return it */ in htb_classify()
266 tcf = rcu_dereference_bh(cl->filter_list); in htb_classify()
269 cl = htb_find(TC_H_MAKE(TC_H_MAJ(sch->handle), q->defcls), sch); in htb_classify()
270 if (!cl || cl->level) in htb_classify()
272 return cl; in htb_classify()
285 struct htb_class *cl, int prio) in htb_add_to_id_tree() argument
294 if (cl->common.classid > c->common.classid) in htb_add_to_id_tree()
299 rb_link_node(&cl->node[prio], parent, p); in htb_add_to_id_tree()
300 rb_insert_color(&cl->node[prio], root); in htb_add_to_id_tree()
314 struct htb_class *cl, s64 delay) in htb_add_to_wait_tree() argument
316 struct rb_node **p = &q->hlevel[cl->level].wait_pq.rb_node, *parent = NULL; in htb_add_to_wait_tree()
318 cl->pq_key = q->now + delay; in htb_add_to_wait_tree()
319 if (cl->pq_key == q->now) in htb_add_to_wait_tree()
320 cl->pq_key++; in htb_add_to_wait_tree()
323 if (q->near_ev_cache[cl->level] > cl->pq_key) in htb_add_to_wait_tree()
324 q->near_ev_cache[cl->level] = cl->pq_key; in htb_add_to_wait_tree()
330 if (cl->pq_key >= c->pq_key) in htb_add_to_wait_tree()
335 rb_link_node(&cl->pq_node, parent, p); in htb_add_to_wait_tree()
336 rb_insert_color(&cl->pq_node, &q->hlevel[cl->level].wait_pq); in htb_add_to_wait_tree()
361 struct htb_class *cl, int mask) in htb_add_class_to_row() argument
363 q->row_mask[cl->level] |= mask; in htb_add_class_to_row()
367 htb_add_to_id_tree(&q->hlevel[cl->level].hprio[prio].row, cl, prio); in htb_add_class_to_row()
393 struct htb_class *cl, int mask) in htb_remove_class_from_row() argument
396 struct htb_level *hlevel = &q->hlevel[cl->level]; in htb_remove_class_from_row()
403 if (hprio->ptr == cl->node + prio) in htb_remove_class_from_row()
406 htb_safe_rb_erase(cl->node + prio, &hprio->row); in htb_remove_class_from_row()
410 q->row_mask[cl->level] &= ~m; in htb_remove_class_from_row()
422 static void htb_activate_prios(struct htb_sched *q, struct htb_class *cl) in htb_activate_prios() argument
424 struct htb_class *p = cl->parent; in htb_activate_prios()
425 long m, mask = cl->prio_activity; in htb_activate_prios()
427 while (cl->cmode == HTB_MAY_BORROW && p && mask) { in htb_activate_prios()
442 htb_add_to_id_tree(&p->inner.clprio[prio].feed, cl, prio); in htb_activate_prios()
445 cl = p; in htb_activate_prios()
446 p = cl->parent; in htb_activate_prios()
449 if (cl->cmode == HTB_CAN_SEND && mask) in htb_activate_prios()
450 htb_add_class_to_row(q, cl, mask); in htb_activate_prios()
462 static void htb_deactivate_prios(struct htb_sched *q, struct htb_class *cl) in htb_deactivate_prios() argument
464 struct htb_class *p = cl->parent; in htb_deactivate_prios()
465 long m, mask = cl->prio_activity; in htb_deactivate_prios()
467 while (cl->cmode == HTB_MAY_BORROW && p && mask) { in htb_deactivate_prios()
474 if (p->inner.clprio[prio].ptr == cl->node + prio) { in htb_deactivate_prios()
479 p->inner.clprio[prio].last_ptr_id = cl->common.classid; in htb_deactivate_prios()
483 htb_safe_rb_erase(cl->node + prio, in htb_deactivate_prios()
491 cl = p; in htb_deactivate_prios()
492 p = cl->parent; in htb_deactivate_prios()
495 if (cl->cmode == HTB_CAN_SEND && mask) in htb_deactivate_prios()
496 htb_remove_class_from_row(q, cl, mask); in htb_deactivate_prios()
499 static inline s64 htb_lowater(const struct htb_class *cl) in htb_lowater() argument
502 return cl->cmode != HTB_CANT_SEND ? -cl->cbuffer : 0; in htb_lowater()
506 static inline s64 htb_hiwater(const struct htb_class *cl) in htb_hiwater() argument
509 return cl->cmode == HTB_CAN_SEND ? -cl->buffer : 0; in htb_hiwater()
529 htb_class_mode(struct htb_class *cl, s64 *diff) in htb_class_mode() argument
533 if ((toks = (cl->ctokens + *diff)) < htb_lowater(cl)) { in htb_class_mode()
538 if ((toks = (cl->tokens + *diff)) >= htb_hiwater(cl)) in htb_class_mode()
558 htb_change_class_mode(struct htb_sched *q, struct htb_class *cl, s64 *diff) in htb_change_class_mode() argument
560 enum htb_cmode new_mode = htb_class_mode(cl, diff); in htb_change_class_mode()
562 if (new_mode == cl->cmode) in htb_change_class_mode()
566 cl->overlimits++; in htb_change_class_mode()
570 if (cl->prio_activity) { /* not necessary: speed optimization */ in htb_change_class_mode()
571 if (cl->cmode != HTB_CANT_SEND) in htb_change_class_mode()
572 htb_deactivate_prios(q, cl); in htb_change_class_mode()
573 cl->cmode = new_mode; in htb_change_class_mode()
575 htb_activate_prios(q, cl); in htb_change_class_mode()
577 cl->cmode = new_mode; in htb_change_class_mode()
589 static inline void htb_activate(struct htb_sched *q, struct htb_class *cl) in htb_activate() argument
591 WARN_ON(cl->level || !cl->leaf.q || !cl->leaf.q->q.qlen); in htb_activate()
593 if (!cl->prio_activity) { in htb_activate()
594 cl->prio_activity = 1 << cl->prio; in htb_activate()
595 htb_activate_prios(q, cl); in htb_activate()
607 static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl) in htb_deactivate() argument
609 WARN_ON(!cl->prio_activity); in htb_deactivate()
611 htb_deactivate_prios(q, cl); in htb_deactivate()
612 cl->prio_activity = 0; in htb_deactivate()
621 struct htb_class *cl = htb_classify(skb, sch, &ret); in htb_enqueue() local
623 if (cl == HTB_DIRECT) { in htb_enqueue()
632 } else if (!cl) { in htb_enqueue()
638 } else if ((ret = qdisc_enqueue(skb, cl->leaf.q, in htb_enqueue()
642 cl->drops++; in htb_enqueue()
646 htb_activate(q, cl); in htb_enqueue()
654 static inline void htb_accnt_tokens(struct htb_class *cl, int bytes, s64 diff) in htb_accnt_tokens() argument
656 s64 toks = diff + cl->tokens; in htb_accnt_tokens()
658 if (toks > cl->buffer) in htb_accnt_tokens()
659 toks = cl->buffer; in htb_accnt_tokens()
660 toks -= (s64) psched_l2t_ns(&cl->rate, bytes); in htb_accnt_tokens()
661 if (toks <= -cl->mbuffer) in htb_accnt_tokens()
662 toks = 1 - cl->mbuffer; in htb_accnt_tokens()
664 cl->tokens = toks; in htb_accnt_tokens()
667 static inline void htb_accnt_ctokens(struct htb_class *cl, int bytes, s64 diff) in htb_accnt_ctokens() argument
669 s64 toks = diff + cl->ctokens; in htb_accnt_ctokens()
671 if (toks > cl->cbuffer) in htb_accnt_ctokens()
672 toks = cl->cbuffer; in htb_accnt_ctokens()
673 toks -= (s64) psched_l2t_ns(&cl->ceil, bytes); in htb_accnt_ctokens()
674 if (toks <= -cl->mbuffer) in htb_accnt_ctokens()
675 toks = 1 - cl->mbuffer; in htb_accnt_ctokens()
677 cl->ctokens = toks; in htb_accnt_ctokens()
695 static void htb_charge_class(struct htb_sched *q, struct htb_class *cl, in htb_charge_class() argument
702 while (cl) { in htb_charge_class()
703 diff = min_t(s64, q->now - cl->t_c, cl->mbuffer); in htb_charge_class()
704 if (cl->level >= level) { in htb_charge_class()
705 if (cl->level == level) in htb_charge_class()
706 cl->xstats.lends++; in htb_charge_class()
707 htb_accnt_tokens(cl, bytes, diff); in htb_charge_class()
709 cl->xstats.borrows++; in htb_charge_class()
710 cl->tokens += diff; /* we moved t_c; update tokens */ in htb_charge_class()
712 htb_accnt_ctokens(cl, bytes, diff); in htb_charge_class()
713 cl->t_c = q->now; in htb_charge_class()
715 old_mode = cl->cmode; in htb_charge_class()
717 htb_change_class_mode(q, cl, &diff); in htb_charge_class()
718 if (old_mode != cl->cmode) { in htb_charge_class()
720 htb_safe_rb_erase(&cl->pq_node, &q->hlevel[cl->level].wait_pq); in htb_charge_class()
721 if (cl->cmode != HTB_CAN_SEND) in htb_charge_class()
722 htb_add_to_wait_tree(q, cl, diff); in htb_charge_class()
726 if (cl->level) in htb_charge_class()
727 bstats_update(&cl->bstats, skb); in htb_charge_class()
729 cl = cl->parent; in htb_charge_class()
754 struct htb_class *cl; in htb_do_events() local
761 cl = rb_entry(p, struct htb_class, pq_node); in htb_do_events()
762 if (cl->pq_key > q->now) in htb_do_events()
763 return cl->pq_key; in htb_do_events()
766 diff = min_t(s64, q->now - cl->t_c, cl->mbuffer); in htb_do_events()
767 htb_change_class_mode(q, cl, &diff); in htb_do_events()
768 if (cl->cmode != HTB_CAN_SEND) in htb_do_events()
769 htb_add_to_wait_tree(q, cl, diff); in htb_do_events()
789 struct htb_class *cl = in htb_id_find_next_upper() local
792 if (id > cl->common.classid) { in htb_id_find_next_upper()
794 } else if (id < cl->common.classid) { in htb_id_find_next_upper()
849 struct htb_class *cl; in htb_lookup_leaf() local
852 cl = rb_entry(*sp->pptr, struct htb_class, node[prio]); in htb_lookup_leaf()
853 if (!cl->level) in htb_lookup_leaf()
854 return cl; in htb_lookup_leaf()
855 clp = &cl->inner.clprio[prio]; in htb_lookup_leaf()
872 struct htb_class *cl, *start; in htb_dequeue_tree() local
877 start = cl = htb_lookup_leaf(hprio, prio); in htb_dequeue_tree()
881 if (unlikely(!cl)) in htb_dequeue_tree()
889 if (unlikely(cl->leaf.q->q.qlen == 0)) { in htb_dequeue_tree()
891 htb_deactivate(q, cl); in htb_dequeue_tree()
899 if (cl == start) /* fix start if we just deleted it */ in htb_dequeue_tree()
901 cl = next; in htb_dequeue_tree()
905 skb = cl->leaf.q->dequeue(cl->leaf.q); in htb_dequeue_tree()
909 qdisc_warn_nonwc("htb", cl->leaf.q); in htb_dequeue_tree()
910 htb_next_rb_node(level ? &cl->parent->inner.clprio[prio].ptr: in htb_dequeue_tree()
912 cl = htb_lookup_leaf(hprio, prio); in htb_dequeue_tree()
914 } while (cl != start); in htb_dequeue_tree()
917 bstats_update(&cl->bstats, skb); in htb_dequeue_tree()
918 cl->leaf.deficit[level] -= qdisc_pkt_len(skb); in htb_dequeue_tree()
919 if (cl->leaf.deficit[level] < 0) { in htb_dequeue_tree()
920 cl->leaf.deficit[level] += cl->quantum; in htb_dequeue_tree()
921 htb_next_rb_node(level ? &cl->parent->inner.clprio[prio].ptr : in htb_dequeue_tree()
927 if (!cl->leaf.q->q.qlen) in htb_dequeue_tree()
928 htb_deactivate(q, cl); in htb_dequeue_tree()
929 htb_charge_class(q, cl, level, skb); in htb_dequeue_tree()
997 struct htb_class *cl; in htb_reset() local
1001 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { in htb_reset()
1002 if (cl->level) in htb_reset()
1003 memset(&cl->inner, 0, sizeof(cl->inner)); in htb_reset()
1005 if (cl->leaf.q && !q->offload) in htb_reset()
1006 qdisc_reset(cl->leaf.q); in htb_reset()
1008 cl->prio_activity = 0; in htb_reset()
1009 cl->cmode = HTB_CAN_SEND; in htb_reset()
1263 struct htb_class *cl = (struct htb_class *)arg; in htb_dump_class() local
1271 tcm->tcm_parent = cl->parent ? cl->parent->common.classid : TC_H_ROOT; in htb_dump_class()
1272 tcm->tcm_handle = cl->common.classid; in htb_dump_class()
1273 if (!cl->level && cl->leaf.q) in htb_dump_class()
1274 tcm->tcm_info = cl->leaf.q->handle; in htb_dump_class()
1282 psched_ratecfg_getrate(&opt.rate, &cl->rate); in htb_dump_class()
1283 opt.buffer = PSCHED_NS2TICKS(cl->buffer); in htb_dump_class()
1284 psched_ratecfg_getrate(&opt.ceil, &cl->ceil); in htb_dump_class()
1285 opt.cbuffer = PSCHED_NS2TICKS(cl->cbuffer); in htb_dump_class()
1286 opt.quantum = cl->quantum; in htb_dump_class()
1287 opt.prio = cl->prio; in htb_dump_class()
1288 opt.level = cl->level; in htb_dump_class()
1293 if ((cl->rate.rate_bytes_ps >= (1ULL << 32)) && in htb_dump_class()
1294 nla_put_u64_64bit(skb, TCA_HTB_RATE64, cl->rate.rate_bytes_ps, in htb_dump_class()
1297 if ((cl->ceil.rate_bytes_ps >= (1ULL << 32)) && in htb_dump_class()
1298 nla_put_u64_64bit(skb, TCA_HTB_CEIL64, cl->ceil.rate_bytes_ps, in htb_dump_class()
1310 struct htb_class *cl) in htb_offload_aggregate_stats() argument
1315 memset(&cl->bstats, 0, sizeof(cl->bstats)); in htb_offload_aggregate_stats()
1321 while (p && p->level < cl->level) in htb_offload_aggregate_stats()
1324 if (p != cl) in htb_offload_aggregate_stats()
1327 cl->bstats.bytes += c->bstats_bias.bytes; in htb_offload_aggregate_stats()
1328 cl->bstats.packets += c->bstats_bias.packets; in htb_offload_aggregate_stats()
1330 cl->bstats.bytes += c->leaf.q->bstats.bytes; in htb_offload_aggregate_stats()
1331 cl->bstats.packets += c->leaf.q->bstats.packets; in htb_offload_aggregate_stats()
1340 struct htb_class *cl = (struct htb_class *)arg; in htb_dump_class_stats() local
1343 .drops = cl->drops, in htb_dump_class_stats()
1344 .overlimits = cl->overlimits, in htb_dump_class_stats()
1348 if (!cl->level && cl->leaf.q) in htb_dump_class_stats()
1349 qdisc_qstats_qlen_backlog(cl->leaf.q, &qlen, &qs.backlog); in htb_dump_class_stats()
1351 cl->xstats.tokens = clamp_t(s64, PSCHED_NS2TICKS(cl->tokens), in htb_dump_class_stats()
1353 cl->xstats.ctokens = clamp_t(s64, PSCHED_NS2TICKS(cl->ctokens), in htb_dump_class_stats()
1357 if (!cl->level) { in htb_dump_class_stats()
1358 if (cl->leaf.q) in htb_dump_class_stats()
1359 cl->bstats = cl->leaf.q->bstats; in htb_dump_class_stats()
1361 memset(&cl->bstats, 0, sizeof(cl->bstats)); in htb_dump_class_stats()
1362 cl->bstats.bytes += cl->bstats_bias.bytes; in htb_dump_class_stats()
1363 cl->bstats.packets += cl->bstats_bias.packets; in htb_dump_class_stats()
1365 htb_offload_aggregate_stats(q, cl); in htb_dump_class_stats()
1370 d, NULL, &cl->bstats) < 0 || in htb_dump_class_stats()
1371 gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 || in htb_dump_class_stats()
1375 return gnet_stats_copy_app(d, &cl->xstats, sizeof(cl->xstats)); in htb_dump_class_stats()
1416 static struct netdev_queue *htb_offload_get_queue(struct htb_class *cl) in htb_offload_get_queue() argument
1420 queue = cl->leaf.offload_queue; in htb_offload_get_queue()
1421 if (!(cl->leaf.q->flags & TCQ_F_BUILTIN)) in htb_offload_get_queue()
1422 WARN_ON(cl->leaf.q->dev_queue != queue); in htb_offload_get_queue()
1463 struct htb_class *cl = (struct htb_class *)arg; in htb_graft() local
1467 if (cl->level) in htb_graft()
1471 dev_queue = htb_offload_get_queue(cl); in htb_graft()
1475 cl->common.classid, extack); in htb_graft()
1487 *old = qdisc_replace(sch, new, &cl->leaf.q); in htb_graft()
1499 struct htb_class *cl = (struct htb_class *)arg; in htb_leaf() local
1500 return !cl->level ? cl->leaf.q : NULL; in htb_leaf()
1505 struct htb_class *cl = (struct htb_class *)arg; in htb_qlen_notify() local
1507 htb_deactivate(qdisc_priv(sch), cl); in htb_qlen_notify()
1510 static inline int htb_parent_last_child(struct htb_class *cl) in htb_parent_last_child() argument
1512 if (!cl->parent) in htb_parent_last_child()
1515 if (cl->parent->children > 1) in htb_parent_last_child()
1521 static void htb_parent_to_leaf(struct Qdisc *sch, struct htb_class *cl, in htb_parent_to_leaf() argument
1525 struct htb_class *parent = cl->parent; in htb_parent_to_leaf()
1527 WARN_ON(cl->level || !cl->leaf.q || cl->prio_activity); in htb_parent_to_leaf()
1541 parent->leaf.offload_queue = cl->leaf.offload_queue; in htb_parent_to_leaf()
1557 static int htb_destroy_class_offload(struct Qdisc *sch, struct htb_class *cl, in htb_destroy_class_offload() argument
1563 struct Qdisc *q = cl->leaf.q; in htb_destroy_class_offload()
1567 if (cl->level) in htb_destroy_class_offload()
1571 dev_queue = htb_offload_get_queue(cl); in htb_destroy_class_offload()
1584 if (cl->parent) { in htb_destroy_class_offload()
1585 cl->parent->bstats_bias.bytes += q->bstats.bytes; in htb_destroy_class_offload()
1586 cl->parent->bstats_bias.packets += q->bstats.packets; in htb_destroy_class_offload()
1593 .classid = cl->common.classid, in htb_destroy_class_offload()
1608 if (!err && offload_opt.classid != TC_H_MIN(cl->common.classid)) { in htb_destroy_class_offload()
1613 htb_offload_move_qdisc(sch, moved_cl, cl, destroying); in htb_destroy_class_offload()
1619 static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl) in htb_destroy_class() argument
1621 if (!cl->level) { in htb_destroy_class()
1622 WARN_ON(!cl->leaf.q); in htb_destroy_class()
1623 qdisc_put(cl->leaf.q); in htb_destroy_class()
1625 gen_kill_estimator(&cl->rate_est); in htb_destroy_class()
1626 tcf_block_put(cl->block); in htb_destroy_class()
1627 kfree(cl); in htb_destroy_class()
1637 struct htb_class *cl; in htb_destroy() local
1650 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { in htb_destroy()
1651 tcf_block_put(cl->block); in htb_destroy()
1652 cl->block = NULL; in htb_destroy()
1660 hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i], in htb_destroy()
1665 htb_destroy_class(sch, cl); in htb_destroy()
1671 if (cl->level) in htb_destroy()
1676 last_child = htb_parent_last_child(cl); in htb_destroy()
1677 htb_destroy_class_offload(sch, cl, last_child, in htb_destroy()
1680 &cl->common); in htb_destroy()
1681 if (cl->parent) in htb_destroy()
1682 cl->parent->children--; in htb_destroy()
1684 htb_parent_to_leaf(sch, cl, NULL); in htb_destroy()
1685 htb_destroy_class(sch, cl); in htb_destroy()
1713 struct htb_class *cl = (struct htb_class *)arg; in htb_delete() local
1722 if (cl->children || cl->filter_cnt) in htb_delete()
1725 if (!cl->level && htb_parent_last_child(cl)) in htb_delete()
1729 err = htb_destroy_class_offload(sch, cl, last_child, false, in htb_delete()
1739 dev_queue = htb_offload_get_queue(cl); in htb_delete()
1742 cl->parent->common.classid, in htb_delete()
1753 if (!cl->level) in htb_delete()
1754 qdisc_purge_queue(cl->leaf.q); in htb_delete()
1757 qdisc_class_hash_remove(&q->clhash, &cl->common); in htb_delete()
1758 if (cl->parent) in htb_delete()
1759 cl->parent->children--; in htb_delete()
1761 if (cl->prio_activity) in htb_delete()
1762 htb_deactivate(q, cl); in htb_delete()
1764 if (cl->cmode != HTB_CAN_SEND) in htb_delete()
1765 htb_safe_rb_erase(&cl->pq_node, in htb_delete()
1766 &q->hlevel[cl->level].wait_pq); in htb_delete()
1769 htb_parent_to_leaf(sch, cl, new_q); in htb_delete()
1773 htb_destroy_class(sch, cl); in htb_delete()
1783 struct htb_class *cl = (struct htb_class *)*arg, *parent; in htb_change_class() local
1844 if (!cl) { /* new class */ in htb_change_class()
1874 cl = kzalloc(sizeof(*cl), GFP_KERNEL); in htb_change_class()
1875 if (!cl) in htb_change_class()
1878 err = tcf_block_get(&cl->block, &cl->filter_list, sch, extack); in htb_change_class()
1880 kfree(cl); in htb_change_class()
1884 err = gen_new_estimator(&cl->bstats, NULL, in htb_change_class()
1885 &cl->rate_est, in htb_change_class()
1893 cl->children = 0; in htb_change_class()
1894 RB_CLEAR_NODE(&cl->pq_node); in htb_change_class()
1897 RB_CLEAR_NODE(&cl->node[prio]); in htb_change_class()
1899 cl->common.classid = classid; in htb_change_class()
1916 .classid = cl->common.classid, in htb_change_class()
1937 .classid = cl->common.classid, in htb_change_class()
1988 cl->leaf.q = new_q ? new_q : &noop_qdisc; in htb_change_class()
1990 cl->leaf.offload_queue = dev_queue; in htb_change_class()
1992 cl->parent = parent; in htb_change_class()
1995 cl->tokens = PSCHED_TICKS2NS(hopt->buffer); in htb_change_class()
1996 cl->ctokens = PSCHED_TICKS2NS(hopt->cbuffer); in htb_change_class()
1997 cl->mbuffer = 60ULL * NSEC_PER_SEC; /* 1min */ in htb_change_class()
1998 cl->t_c = ktime_get_ns(); in htb_change_class()
1999 cl->cmode = HTB_CAN_SEND; in htb_change_class()
2002 qdisc_class_hash_insert(&q->clhash, &cl->common); in htb_change_class()
2005 if (cl->leaf.q != &noop_qdisc) in htb_change_class()
2006 qdisc_hash_add(cl->leaf.q, true); in htb_change_class()
2009 err = gen_replace_estimator(&cl->bstats, NULL, in htb_change_class()
2010 &cl->rate_est, in htb_change_class()
2023 .classid = cl->common.classid, in htb_change_class()
2042 psched_ratecfg_precompute(&cl->rate, &hopt->rate, rate64); in htb_change_class()
2043 psched_ratecfg_precompute(&cl->ceil, &hopt->ceil, ceil64); in htb_change_class()
2048 if (!cl->level) { in htb_change_class()
2049 u64 quantum = cl->rate.rate_bytes_ps; in htb_change_class()
2052 cl->quantum = min_t(u64, quantum, INT_MAX); in htb_change_class()
2054 if (!hopt->quantum && cl->quantum < 1000) { in htb_change_class()
2056 cl->quantum = 1000; in htb_change_class()
2058 if (!hopt->quantum && cl->quantum > 200000) { in htb_change_class()
2060 cl->quantum = 200000; in htb_change_class()
2063 cl->quantum = hopt->quantum; in htb_change_class()
2064 if ((cl->prio = hopt->prio) >= TC_HTB_NUMPRIO) in htb_change_class()
2065 cl->prio = TC_HTB_NUMPRIO - 1; in htb_change_class()
2068 cl->buffer = PSCHED_TICKS2NS(hopt->buffer); in htb_change_class()
2069 cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer); in htb_change_class()
2076 cl->common.classid, (warn == -1 ? "small" : "big")); in htb_change_class()
2080 *arg = (unsigned long)cl; in htb_change_class()
2084 gen_kill_estimator(&cl->rate_est); in htb_change_class()
2086 tcf_block_put(cl->block); in htb_change_class()
2087 kfree(cl); in htb_change_class()
2096 struct htb_class *cl = (struct htb_class *)arg; in htb_tcf_block() local
2098 return cl ? cl->block : q->block; in htb_tcf_block()
2104 struct htb_class *cl = htb_find(classid, sch); in htb_bind_filter() local
2115 if (cl) in htb_bind_filter()
2116 cl->filter_cnt++; in htb_bind_filter()
2117 return (unsigned long)cl; in htb_bind_filter()
2122 struct htb_class *cl = (struct htb_class *)arg; in htb_unbind_filter() local
2124 if (cl) in htb_unbind_filter()
2125 cl->filter_cnt--; in htb_unbind_filter()
2131 struct htb_class *cl; in htb_walk() local
2138 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { in htb_walk()
2143 if (arg->fn(sch, (unsigned long)cl, arg) < 0) { in htb_walk()