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()
1248 struct htb_class *cl = (struct htb_class *)arg; in htb_dump_class() local
1256 tcm->tcm_parent = cl->parent ? cl->parent->common.classid : TC_H_ROOT; in htb_dump_class()
1257 tcm->tcm_handle = cl->common.classid; in htb_dump_class()
1258 if (!cl->level && cl->leaf.q) in htb_dump_class()
1259 tcm->tcm_info = cl->leaf.q->handle; in htb_dump_class()
1267 psched_ratecfg_getrate(&opt.rate, &cl->rate); in htb_dump_class()
1268 opt.buffer = PSCHED_NS2TICKS(cl->buffer); in htb_dump_class()
1269 psched_ratecfg_getrate(&opt.ceil, &cl->ceil); in htb_dump_class()
1270 opt.cbuffer = PSCHED_NS2TICKS(cl->cbuffer); in htb_dump_class()
1271 opt.quantum = cl->quantum; in htb_dump_class()
1272 opt.prio = cl->prio; in htb_dump_class()
1273 opt.level = cl->level; in htb_dump_class()
1278 if ((cl->rate.rate_bytes_ps >= (1ULL << 32)) && in htb_dump_class()
1279 nla_put_u64_64bit(skb, TCA_HTB_RATE64, cl->rate.rate_bytes_ps, in htb_dump_class()
1282 if ((cl->ceil.rate_bytes_ps >= (1ULL << 32)) && in htb_dump_class()
1283 nla_put_u64_64bit(skb, TCA_HTB_CEIL64, cl->ceil.rate_bytes_ps, in htb_dump_class()
1295 struct htb_class *cl) in htb_offload_aggregate_stats() argument
1301 gnet_stats_basic_sync_init(&cl->bstats); in htb_offload_aggregate_stats()
1307 while (p && p->level < cl->level) in htb_offload_aggregate_stats()
1310 if (p != cl) in htb_offload_aggregate_stats()
1321 _bstats_update(&cl->bstats, bytes, packets); in htb_offload_aggregate_stats()
1327 struct htb_class *cl = (struct htb_class *)arg; in htb_dump_class_stats() local
1330 .drops = cl->drops, in htb_dump_class_stats()
1331 .overlimits = cl->overlimits, in htb_dump_class_stats()
1335 if (!cl->level && cl->leaf.q) in htb_dump_class_stats()
1336 qdisc_qstats_qlen_backlog(cl->leaf.q, &qlen, &qs.backlog); in htb_dump_class_stats()
1338 cl->xstats.tokens = clamp_t(s64, PSCHED_NS2TICKS(cl->tokens), in htb_dump_class_stats()
1340 cl->xstats.ctokens = clamp_t(s64, PSCHED_NS2TICKS(cl->ctokens), in htb_dump_class_stats()
1344 if (!cl->level) { in htb_dump_class_stats()
1345 if (cl->leaf.q) in htb_dump_class_stats()
1346 cl->bstats = cl->leaf.q->bstats; in htb_dump_class_stats()
1348 gnet_stats_basic_sync_init(&cl->bstats); in htb_dump_class_stats()
1349 _bstats_update(&cl->bstats, in htb_dump_class_stats()
1350 u64_stats_read(&cl->bstats_bias.bytes), in htb_dump_class_stats()
1351 u64_stats_read(&cl->bstats_bias.packets)); in htb_dump_class_stats()
1353 htb_offload_aggregate_stats(q, cl); in htb_dump_class_stats()
1357 if (gnet_stats_copy_basic(d, NULL, &cl->bstats, true) < 0 || in htb_dump_class_stats()
1358 gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 || in htb_dump_class_stats()
1362 return gnet_stats_copy_app(d, &cl->xstats, sizeof(cl->xstats)); in htb_dump_class_stats()
1403 static struct netdev_queue *htb_offload_get_queue(struct htb_class *cl) in htb_offload_get_queue() argument
1407 queue = cl->leaf.offload_queue; in htb_offload_get_queue()
1408 if (!(cl->leaf.q->flags & TCQ_F_BUILTIN)) in htb_offload_get_queue()
1409 WARN_ON(cl->leaf.q->dev_queue != queue); in htb_offload_get_queue()
1450 struct htb_class *cl = (struct htb_class *)arg; in htb_graft() local
1454 if (cl->level) in htb_graft()
1458 dev_queue = htb_offload_get_queue(cl); in htb_graft()
1462 cl->common.classid, extack); in htb_graft()
1474 *old = qdisc_replace(sch, new, &cl->leaf.q); in htb_graft()
1486 struct htb_class *cl = (struct htb_class *)arg; in htb_leaf() local
1487 return !cl->level ? cl->leaf.q : NULL; in htb_leaf()
1492 struct htb_class *cl = (struct htb_class *)arg; in htb_qlen_notify() local
1494 htb_deactivate(qdisc_priv(sch), cl); in htb_qlen_notify()
1497 static inline int htb_parent_last_child(struct htb_class *cl) in htb_parent_last_child() argument
1499 if (!cl->parent) in htb_parent_last_child()
1502 if (cl->parent->children > 1) in htb_parent_last_child()
1508 static void htb_parent_to_leaf(struct Qdisc *sch, struct htb_class *cl, in htb_parent_to_leaf() argument
1512 struct htb_class *parent = cl->parent; in htb_parent_to_leaf()
1514 WARN_ON(cl->level || !cl->leaf.q || cl->prio_activity); in htb_parent_to_leaf()
1528 parent->leaf.offload_queue = cl->leaf.offload_queue; in htb_parent_to_leaf()
1544 static int htb_destroy_class_offload(struct Qdisc *sch, struct htb_class *cl, in htb_destroy_class_offload() argument
1550 struct Qdisc *q = cl->leaf.q; in htb_destroy_class_offload()
1554 if (cl->level) in htb_destroy_class_offload()
1558 dev_queue = htb_offload_get_queue(cl); in htb_destroy_class_offload()
1571 if (cl->parent) { in htb_destroy_class_offload()
1572 _bstats_update(&cl->parent->bstats_bias, in htb_destroy_class_offload()
1581 .classid = cl->common.classid, in htb_destroy_class_offload()
1596 if (!err && offload_opt.classid != TC_H_MIN(cl->common.classid)) { in htb_destroy_class_offload()
1601 htb_offload_move_qdisc(sch, moved_cl, cl, destroying); in htb_destroy_class_offload()
1607 static void htb_destroy_class(struct Qdisc *sch, struct htb_class *cl) in htb_destroy_class() argument
1609 if (!cl->level) { in htb_destroy_class()
1610 WARN_ON(!cl->leaf.q); in htb_destroy_class()
1611 qdisc_put(cl->leaf.q); in htb_destroy_class()
1613 gen_kill_estimator(&cl->rate_est); in htb_destroy_class()
1614 tcf_block_put(cl->block); in htb_destroy_class()
1615 kfree(cl); in htb_destroy_class()
1625 struct htb_class *cl; in htb_destroy() local
1638 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { in htb_destroy()
1639 tcf_block_put(cl->block); in htb_destroy()
1640 cl->block = NULL; in htb_destroy()
1648 hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i], in htb_destroy()
1653 htb_destroy_class(sch, cl); in htb_destroy()
1659 if (cl->level) in htb_destroy()
1664 last_child = htb_parent_last_child(cl); in htb_destroy()
1665 htb_destroy_class_offload(sch, cl, last_child, in htb_destroy()
1668 &cl->common); in htb_destroy()
1669 if (cl->parent) in htb_destroy()
1670 cl->parent->children--; in htb_destroy()
1672 htb_parent_to_leaf(sch, cl, NULL); in htb_destroy()
1673 htb_destroy_class(sch, cl); in htb_destroy()
1700 struct htb_class *cl = (struct htb_class *)arg; in htb_delete() local
1709 if (cl->children || cl->filter_cnt) in htb_delete()
1712 if (!cl->level && htb_parent_last_child(cl)) in htb_delete()
1716 err = htb_destroy_class_offload(sch, cl, last_child, false, in htb_delete()
1726 dev_queue = htb_offload_get_queue(cl); in htb_delete()
1729 cl->parent->common.classid, in htb_delete()
1740 if (!cl->level) in htb_delete()
1741 qdisc_purge_queue(cl->leaf.q); in htb_delete()
1744 qdisc_class_hash_remove(&q->clhash, &cl->common); in htb_delete()
1745 if (cl->parent) in htb_delete()
1746 cl->parent->children--; in htb_delete()
1748 if (cl->prio_activity) in htb_delete()
1749 htb_deactivate(q, cl); in htb_delete()
1751 if (cl->cmode != HTB_CAN_SEND) in htb_delete()
1752 htb_safe_rb_erase(&cl->pq_node, in htb_delete()
1753 &q->hlevel[cl->level].wait_pq); in htb_delete()
1756 htb_parent_to_leaf(sch, cl, new_q); in htb_delete()
1760 htb_destroy_class(sch, cl); in htb_delete()
1770 struct htb_class *cl = (struct htb_class *)*arg, *parent; in htb_change_class() local
1831 if (!cl) { /* new class */ in htb_change_class()
1861 cl = kzalloc(sizeof(*cl), GFP_KERNEL); in htb_change_class()
1862 if (!cl) in htb_change_class()
1865 gnet_stats_basic_sync_init(&cl->bstats); in htb_change_class()
1866 gnet_stats_basic_sync_init(&cl->bstats_bias); in htb_change_class()
1868 err = tcf_block_get(&cl->block, &cl->filter_list, sch, extack); in htb_change_class()
1870 kfree(cl); in htb_change_class()
1874 err = gen_new_estimator(&cl->bstats, NULL, in htb_change_class()
1875 &cl->rate_est, in htb_change_class()
1883 cl->children = 0; in htb_change_class()
1884 RB_CLEAR_NODE(&cl->pq_node); in htb_change_class()
1887 RB_CLEAR_NODE(&cl->node[prio]); in htb_change_class()
1889 cl->common.classid = classid; in htb_change_class()
1906 .classid = cl->common.classid, in htb_change_class()
1927 .classid = cl->common.classid, in htb_change_class()
1979 cl->leaf.q = new_q ? new_q : &noop_qdisc; in htb_change_class()
1981 cl->leaf.offload_queue = dev_queue; in htb_change_class()
1983 cl->parent = parent; in htb_change_class()
1986 cl->tokens = PSCHED_TICKS2NS(hopt->buffer); in htb_change_class()
1987 cl->ctokens = PSCHED_TICKS2NS(hopt->cbuffer); in htb_change_class()
1988 cl->mbuffer = 60ULL * NSEC_PER_SEC; /* 1min */ in htb_change_class()
1989 cl->t_c = ktime_get_ns(); in htb_change_class()
1990 cl->cmode = HTB_CAN_SEND; in htb_change_class()
1993 qdisc_class_hash_insert(&q->clhash, &cl->common); in htb_change_class()
1996 if (cl->leaf.q != &noop_qdisc) in htb_change_class()
1997 qdisc_hash_add(cl->leaf.q, true); in htb_change_class()
2000 err = gen_replace_estimator(&cl->bstats, NULL, in htb_change_class()
2001 &cl->rate_est, in htb_change_class()
2014 .classid = cl->common.classid, in htb_change_class()
2033 psched_ratecfg_precompute(&cl->rate, &hopt->rate, rate64); in htb_change_class()
2034 psched_ratecfg_precompute(&cl->ceil, &hopt->ceil, ceil64); in htb_change_class()
2039 if (!cl->level) { in htb_change_class()
2040 u64 quantum = cl->rate.rate_bytes_ps; in htb_change_class()
2043 cl->quantum = min_t(u64, quantum, INT_MAX); in htb_change_class()
2045 if (!hopt->quantum && cl->quantum < 1000) { in htb_change_class()
2047 cl->quantum = 1000; in htb_change_class()
2049 if (!hopt->quantum && cl->quantum > 200000) { in htb_change_class()
2051 cl->quantum = 200000; in htb_change_class()
2054 cl->quantum = hopt->quantum; in htb_change_class()
2055 if ((cl->prio = hopt->prio) >= TC_HTB_NUMPRIO) in htb_change_class()
2056 cl->prio = TC_HTB_NUMPRIO - 1; in htb_change_class()
2059 cl->buffer = PSCHED_TICKS2NS(hopt->buffer); in htb_change_class()
2060 cl->cbuffer = PSCHED_TICKS2NS(hopt->cbuffer); in htb_change_class()
2067 cl->common.classid, (warn == -1 ? "small" : "big")); in htb_change_class()
2071 *arg = (unsigned long)cl; in htb_change_class()
2075 gen_kill_estimator(&cl->rate_est); in htb_change_class()
2077 tcf_block_put(cl->block); in htb_change_class()
2078 kfree(cl); in htb_change_class()
2087 struct htb_class *cl = (struct htb_class *)arg; in htb_tcf_block() local
2089 return cl ? cl->block : q->block; in htb_tcf_block()
2095 struct htb_class *cl = htb_find(classid, sch); in htb_bind_filter() local
2106 if (cl) in htb_bind_filter()
2107 cl->filter_cnt++; in htb_bind_filter()
2108 return (unsigned long)cl; in htb_bind_filter()
2113 struct htb_class *cl = (struct htb_class *)arg; in htb_unbind_filter() local
2115 if (cl) in htb_unbind_filter()
2116 cl->filter_cnt--; in htb_unbind_filter()
2122 struct htb_class *cl; in htb_walk() local
2129 hlist_for_each_entry(cl, &q->clhash.hash[i], common.hnode) { in htb_walk()
2130 if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg)) in htb_walk()