Lines Matching refs:cl

185 eltree_insert(struct hfsc_class *cl)  in eltree_insert()  argument
187 struct rb_node **p = &cl->sched->eligible.rb_node; in eltree_insert()
194 if (cl->cl_e >= cl1->cl_e) in eltree_insert()
199 rb_link_node(&cl->el_node, parent, p); in eltree_insert()
200 rb_insert_color(&cl->el_node, &cl->sched->eligible); in eltree_insert()
204 eltree_remove(struct hfsc_class *cl) in eltree_remove() argument
206 rb_erase(&cl->el_node, &cl->sched->eligible); in eltree_remove()
210 eltree_update(struct hfsc_class *cl) in eltree_update() argument
212 eltree_remove(cl); in eltree_update()
213 eltree_insert(cl); in eltree_update()
220 struct hfsc_class *p, *cl = NULL; in eltree_get_mindl() local
227 if (cl == NULL || p->cl_d < cl->cl_d) in eltree_get_mindl()
228 cl = p; in eltree_get_mindl()
230 return cl; in eltree_get_mindl()
250 vttree_insert(struct hfsc_class *cl) in vttree_insert() argument
252 struct rb_node **p = &cl->cl_parent->vt_tree.rb_node; in vttree_insert()
259 if (cl->cl_vt >= cl1->cl_vt) in vttree_insert()
264 rb_link_node(&cl->vt_node, parent, p); in vttree_insert()
265 rb_insert_color(&cl->vt_node, &cl->cl_parent->vt_tree); in vttree_insert()
269 vttree_remove(struct hfsc_class *cl) in vttree_remove() argument
271 rb_erase(&cl->vt_node, &cl->cl_parent->vt_tree); in vttree_remove()
275 vttree_update(struct hfsc_class *cl) in vttree_update() argument
277 vttree_remove(cl); in vttree_update()
278 vttree_insert(cl); in vttree_update()
282 vttree_firstfit(struct hfsc_class *cl, u64 cur_time) in vttree_firstfit() argument
287 for (n = rb_first(&cl->vt_tree); n != NULL; n = rb_next(n)) { in vttree_firstfit()
299 vttree_get_minvt(struct hfsc_class *cl, u64 cur_time) in vttree_get_minvt() argument
302 if (cl->cl_cfmin > cur_time) in vttree_get_minvt()
305 while (cl->level > 0) { in vttree_get_minvt()
306 cl = vttree_firstfit(cl, cur_time); in vttree_get_minvt()
307 if (cl == NULL) in vttree_get_minvt()
312 if (cl->cl_parent->cl_cvtmin < cl->cl_vt) in vttree_get_minvt()
313 cl->cl_parent->cl_cvtmin = cl->cl_vt; in vttree_get_minvt()
315 return cl; in vttree_get_minvt()
319 cftree_insert(struct hfsc_class *cl) in cftree_insert() argument
321 struct rb_node **p = &cl->cl_parent->cf_tree.rb_node; in cftree_insert()
328 if (cl->cl_f >= cl1->cl_f) in cftree_insert()
333 rb_link_node(&cl->cf_node, parent, p); in cftree_insert()
334 rb_insert_color(&cl->cf_node, &cl->cl_parent->cf_tree); in cftree_insert()
338 cftree_remove(struct hfsc_class *cl) in cftree_remove() argument
340 rb_erase(&cl->cf_node, &cl->cl_parent->cf_tree); in cftree_remove()
344 cftree_update(struct hfsc_class *cl) in cftree_update() argument
346 cftree_remove(cl); in cftree_update()
347 cftree_insert(cl); in cftree_update()
609 init_ed(struct hfsc_class *cl, unsigned int next_len) in init_ed() argument
614 rtsc_min(&cl->cl_deadline, &cl->cl_rsc, cur_time, cl->cl_cumul); in init_ed()
621 cl->cl_eligible = cl->cl_deadline; in init_ed()
622 if (cl->cl_rsc.sm1 <= cl->cl_rsc.sm2) { in init_ed()
623 cl->cl_eligible.dx = 0; in init_ed()
624 cl->cl_eligible.dy = 0; in init_ed()
628 cl->cl_e = rtsc_y2x(&cl->cl_eligible, cl->cl_cumul); in init_ed()
629 cl->cl_d = rtsc_y2x(&cl->cl_deadline, cl->cl_cumul + next_len); in init_ed()
631 eltree_insert(cl); in init_ed()
635 update_ed(struct hfsc_class *cl, unsigned int next_len) in update_ed() argument
637 cl->cl_e = rtsc_y2x(&cl->cl_eligible, cl->cl_cumul); in update_ed()
638 cl->cl_d = rtsc_y2x(&cl->cl_deadline, cl->cl_cumul + next_len); in update_ed()
640 eltree_update(cl); in update_ed()
644 update_d(struct hfsc_class *cl, unsigned int next_len) in update_d() argument
646 cl->cl_d = rtsc_y2x(&cl->cl_deadline, cl->cl_cumul + next_len); in update_d()
650 update_cfmin(struct hfsc_class *cl) in update_cfmin() argument
652 struct rb_node *n = rb_first(&cl->cf_tree); in update_cfmin()
656 cl->cl_cfmin = 0; in update_cfmin()
660 cl->cl_cfmin = p->cl_f; in update_cfmin()
664 init_vf(struct hfsc_class *cl, unsigned int len) in init_vf() argument
673 for (; cl->cl_parent != NULL; cl = cl->cl_parent) { in init_vf()
674 if (go_active && cl->cl_nactive++ == 0) in init_vf()
680 n = rb_last(&cl->cl_parent->vt_tree); in init_vf()
689 if (cl->cl_parent->cl_cvtmin != 0) in init_vf()
690 vt = (cl->cl_parent->cl_cvtmin + vt)/2; in init_vf()
692 if (cl->cl_parent->cl_vtperiod != in init_vf()
693 cl->cl_parentperiod || vt > cl->cl_vt) in init_vf()
694 cl->cl_vt = vt; in init_vf()
702 cl->cl_vt = cl->cl_parent->cl_cvtoff; in init_vf()
703 cl->cl_parent->cl_cvtmin = 0; in init_vf()
707 rtsc_min(&cl->cl_virtual, &cl->cl_fsc, cl->cl_vt, cl->cl_total); in init_vf()
708 cl->cl_vtadj = 0; in init_vf()
710 cl->cl_vtperiod++; /* increment vt period */ in init_vf()
711 cl->cl_parentperiod = cl->cl_parent->cl_vtperiod; in init_vf()
712 if (cl->cl_parent->cl_nactive == 0) in init_vf()
713 cl->cl_parentperiod++; in init_vf()
714 cl->cl_f = 0; in init_vf()
716 vttree_insert(cl); in init_vf()
717 cftree_insert(cl); in init_vf()
719 if (cl->cl_flags & HFSC_USC) { in init_vf()
725 rtsc_min(&cl->cl_ulimit, &cl->cl_usc, cur_time, in init_vf()
726 cl->cl_total); in init_vf()
728 cl->cl_myf = rtsc_y2x(&cl->cl_ulimit, in init_vf()
729 cl->cl_total); in init_vf()
733 f = max(cl->cl_myf, cl->cl_cfmin); in init_vf()
734 if (f != cl->cl_f) { in init_vf()
735 cl->cl_f = f; in init_vf()
736 cftree_update(cl); in init_vf()
738 update_cfmin(cl->cl_parent); in init_vf()
743 update_vf(struct hfsc_class *cl, unsigned int len, u64 cur_time) in update_vf() argument
748 if (cl->qdisc->q.qlen == 0 && cl->cl_flags & HFSC_FSC) in update_vf()
751 for (; cl->cl_parent != NULL; cl = cl->cl_parent) { in update_vf()
752 cl->cl_total += len; in update_vf()
754 if (!(cl->cl_flags & HFSC_FSC) || cl->cl_nactive == 0) in update_vf()
757 if (go_passive && --cl->cl_nactive == 0) in update_vf()
763 cl->cl_vt = rtsc_y2x(&cl->cl_virtual, cl->cl_total) + cl->cl_vtadj; in update_vf()
770 if (cl->cl_vt < cl->cl_parent->cl_cvtmin) { in update_vf()
771 cl->cl_vtadj += cl->cl_parent->cl_cvtmin - cl->cl_vt; in update_vf()
772 cl->cl_vt = cl->cl_parent->cl_cvtmin; in update_vf()
779 if (cl->cl_vt > cl->cl_parent->cl_cvtoff) in update_vf()
780 cl->cl_parent->cl_cvtoff = cl->cl_vt; in update_vf()
783 vttree_remove(cl); in update_vf()
785 cftree_remove(cl); in update_vf()
786 update_cfmin(cl->cl_parent); in update_vf()
792 vttree_update(cl); in update_vf()
795 if (cl->cl_flags & HFSC_USC) { in update_vf()
796 cl->cl_myf = rtsc_y2x(&cl->cl_ulimit, cl->cl_total); in update_vf()
798 cl->cl_myf = cl->cl_myfadj + rtsc_y2x(&cl->cl_ulimit, in update_vf()
799 cl->cl_total); in update_vf()
813 if (cl->cl_myf < myf_bound) { in update_vf()
814 delta = cur_time - cl->cl_myf; in update_vf()
815 cl->cl_myfadj += delta; in update_vf()
816 cl->cl_myf += delta; in update_vf()
821 f = max(cl->cl_myf, cl->cl_cfmin); in update_vf()
822 if (f != cl->cl_f) { in update_vf()
823 cl->cl_f = f; in update_vf()
824 cftree_update(cl); in update_vf()
825 update_cfmin(cl->cl_parent); in update_vf()
847 hfsc_adjust_levels(struct hfsc_class *cl) in hfsc_adjust_levels() argument
854 list_for_each_entry(p, &cl->children, siblings) { in hfsc_adjust_levels()
858 cl->level = level; in hfsc_adjust_levels()
859 } while ((cl = cl->cl_parent) != NULL); in hfsc_adjust_levels()
875 hfsc_change_rsc(struct hfsc_class *cl, struct tc_service_curve *rsc, in hfsc_change_rsc() argument
878 sc2isc(rsc, &cl->cl_rsc); in hfsc_change_rsc()
879 rtsc_init(&cl->cl_deadline, &cl->cl_rsc, cur_time, cl->cl_cumul); in hfsc_change_rsc()
880 cl->cl_eligible = cl->cl_deadline; in hfsc_change_rsc()
881 if (cl->cl_rsc.sm1 <= cl->cl_rsc.sm2) { in hfsc_change_rsc()
882 cl->cl_eligible.dx = 0; in hfsc_change_rsc()
883 cl->cl_eligible.dy = 0; in hfsc_change_rsc()
885 cl->cl_flags |= HFSC_RSC; in hfsc_change_rsc()
889 hfsc_change_fsc(struct hfsc_class *cl, struct tc_service_curve *fsc) in hfsc_change_fsc() argument
891 sc2isc(fsc, &cl->cl_fsc); in hfsc_change_fsc()
892 rtsc_init(&cl->cl_virtual, &cl->cl_fsc, cl->cl_vt, cl->cl_total); in hfsc_change_fsc()
893 cl->cl_flags |= HFSC_FSC; in hfsc_change_fsc()
897 hfsc_change_usc(struct hfsc_class *cl, struct tc_service_curve *usc, in hfsc_change_usc() argument
900 sc2isc(usc, &cl->cl_usc); in hfsc_change_usc()
901 rtsc_init(&cl->cl_ulimit, &cl->cl_usc, cur_time, cl->cl_total); in hfsc_change_usc()
902 cl->cl_flags |= HFSC_USC; in hfsc_change_usc()
906 hfsc_upgrade_rt(struct hfsc_class *cl) in hfsc_upgrade_rt() argument
908 cl->cl_fsc = cl->cl_rsc; in hfsc_upgrade_rt()
909 rtsc_init(&cl->cl_virtual, &cl->cl_fsc, cl->cl_vt, cl->cl_total); in hfsc_upgrade_rt()
910 cl->cl_flags |= HFSC_FSC; in hfsc_upgrade_rt()
925 struct hfsc_class *cl = (struct hfsc_class *)*arg; in hfsc_change_class() local
959 if (cl != NULL) { in hfsc_change_class()
963 if (cl->cl_parent && in hfsc_change_class()
964 cl->cl_parent->cl_common.classid != parentid) in hfsc_change_class()
966 if (cl->cl_parent == NULL && parentid != TC_H_ROOT) in hfsc_change_class()
972 err = gen_replace_estimator(&cl->bstats, NULL, in hfsc_change_class()
973 &cl->rate_est, in hfsc_change_class()
982 old_flags = cl->cl_flags; in hfsc_change_class()
985 hfsc_change_rsc(cl, rsc, cur_time); in hfsc_change_class()
987 hfsc_change_fsc(cl, fsc); in hfsc_change_class()
989 hfsc_change_usc(cl, usc, cur_time); in hfsc_change_class()
991 if (cl->qdisc->q.qlen != 0) { in hfsc_change_class()
992 int len = qdisc_peek_len(cl->qdisc); in hfsc_change_class()
994 if (cl->cl_flags & HFSC_RSC) { in hfsc_change_class()
996 update_ed(cl, len); in hfsc_change_class()
998 init_ed(cl, len); in hfsc_change_class()
1001 if (cl->cl_flags & HFSC_FSC) { in hfsc_change_class()
1003 update_vf(cl, 0, cur_time); in hfsc_change_class()
1005 init_vf(cl, len); in hfsc_change_class()
1031 cl = kzalloc(sizeof(struct hfsc_class), GFP_KERNEL); in hfsc_change_class()
1032 if (cl == NULL) in hfsc_change_class()
1035 err = tcf_block_get(&cl->block, &cl->filter_list, sch, extack); in hfsc_change_class()
1037 kfree(cl); in hfsc_change_class()
1042 err = gen_new_estimator(&cl->bstats, NULL, &cl->rate_est, in hfsc_change_class()
1045 tcf_block_put(cl->block); in hfsc_change_class()
1046 kfree(cl); in hfsc_change_class()
1052 hfsc_change_rsc(cl, rsc, 0); in hfsc_change_class()
1054 hfsc_change_fsc(cl, fsc); in hfsc_change_class()
1056 hfsc_change_usc(cl, usc, 0); in hfsc_change_class()
1058 cl->cl_common.classid = classid; in hfsc_change_class()
1059 cl->sched = q; in hfsc_change_class()
1060 cl->cl_parent = parent; in hfsc_change_class()
1061 cl->qdisc = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, in hfsc_change_class()
1063 if (cl->qdisc == NULL) in hfsc_change_class()
1064 cl->qdisc = &noop_qdisc; in hfsc_change_class()
1066 qdisc_hash_add(cl->qdisc, true); in hfsc_change_class()
1067 INIT_LIST_HEAD(&cl->children); in hfsc_change_class()
1068 cl->vt_tree = RB_ROOT; in hfsc_change_class()
1069 cl->cf_tree = RB_ROOT; in hfsc_change_class()
1078 qdisc_class_hash_insert(&q->clhash, &cl->cl_common); in hfsc_change_class()
1079 list_add_tail(&cl->siblings, &parent->children); in hfsc_change_class()
1087 *arg = (unsigned long)cl; in hfsc_change_class()
1092 hfsc_destroy_class(struct Qdisc *sch, struct hfsc_class *cl) in hfsc_destroy_class() argument
1096 tcf_block_put(cl->block); in hfsc_destroy_class()
1097 qdisc_put(cl->qdisc); in hfsc_destroy_class()
1098 gen_kill_estimator(&cl->rate_est); in hfsc_destroy_class()
1099 if (cl != &q->root) in hfsc_destroy_class()
1100 kfree(cl); in hfsc_destroy_class()
1108 struct hfsc_class *cl = (struct hfsc_class *)arg; in hfsc_delete_class() local
1110 if (cl->level > 0 || qdisc_class_in_use(&cl->cl_common) || in hfsc_delete_class()
1111 cl == &q->root) { in hfsc_delete_class()
1118 list_del(&cl->siblings); in hfsc_delete_class()
1119 hfsc_adjust_levels(cl->cl_parent); in hfsc_delete_class()
1121 qdisc_purge_queue(cl->qdisc); in hfsc_delete_class()
1122 qdisc_class_hash_remove(&q->clhash, &cl->cl_common); in hfsc_delete_class()
1126 hfsc_destroy_class(sch, cl); in hfsc_delete_class()
1134 struct hfsc_class *head, *cl; in hfsc_classify() local
1140 (cl = hfsc_find_class(skb->priority, sch)) != NULL) in hfsc_classify()
1141 if (cl->level == 0) in hfsc_classify()
1142 return cl; in hfsc_classify()
1159 cl = (struct hfsc_class *)res.class; in hfsc_classify()
1160 if (!cl) { in hfsc_classify()
1161 cl = hfsc_find_class(res.classid, sch); in hfsc_classify()
1162 if (!cl) in hfsc_classify()
1164 if (cl->level >= head->level) in hfsc_classify()
1168 if (cl->level == 0) in hfsc_classify()
1169 return cl; /* hit leaf class */ in hfsc_classify()
1172 tcf = rcu_dereference_bh(cl->filter_list); in hfsc_classify()
1173 head = cl; in hfsc_classify()
1177 cl = hfsc_find_class(TC_H_MAKE(TC_H_MAJ(sch->handle), q->defcls), sch); in hfsc_classify()
1178 if (cl == NULL || cl->level > 0) in hfsc_classify()
1181 return cl; in hfsc_classify()
1188 struct hfsc_class *cl = (struct hfsc_class *)arg; in hfsc_graft_class() local
1190 if (cl->level > 0) in hfsc_graft_class()
1194 cl->cl_common.classid, NULL); in hfsc_graft_class()
1199 *old = qdisc_replace(sch, new, &cl->qdisc); in hfsc_graft_class()
1206 struct hfsc_class *cl = (struct hfsc_class *)arg; in hfsc_class_leaf() local
1208 if (cl->level == 0) in hfsc_class_leaf()
1209 return cl->qdisc; in hfsc_class_leaf()
1217 struct hfsc_class *cl = (struct hfsc_class *)arg; in hfsc_qlen_notify() local
1222 update_vf(cl, 0, 0); in hfsc_qlen_notify()
1223 if (cl->cl_flags & HFSC_RSC) in hfsc_qlen_notify()
1224 eltree_remove(cl); in hfsc_qlen_notify()
1237 struct hfsc_class *cl = hfsc_find_class(classid, sch); in hfsc_bind_tcf() local
1239 if (cl != NULL) { in hfsc_bind_tcf()
1240 if (p != NULL && p->level <= cl->level) in hfsc_bind_tcf()
1242 qdisc_class_get(&cl->cl_common); in hfsc_bind_tcf()
1245 return (unsigned long)cl; in hfsc_bind_tcf()
1251 struct hfsc_class *cl = (struct hfsc_class *)arg; in hfsc_unbind_tcf() local
1253 qdisc_class_put(&cl->cl_common); in hfsc_unbind_tcf()
1260 struct hfsc_class *cl = (struct hfsc_class *)arg; in hfsc_tcf_block() local
1262 if (cl == NULL) in hfsc_tcf_block()
1263 cl = &q->root; in hfsc_tcf_block()
1265 return cl->block; in hfsc_tcf_block()
1286 hfsc_dump_curves(struct sk_buff *skb, struct hfsc_class *cl) in hfsc_dump_curves() argument
1288 if ((cl->cl_flags & HFSC_RSC) && in hfsc_dump_curves()
1289 (hfsc_dump_sc(skb, TCA_HFSC_RSC, &cl->cl_rsc) < 0)) in hfsc_dump_curves()
1292 if ((cl->cl_flags & HFSC_FSC) && in hfsc_dump_curves()
1293 (hfsc_dump_sc(skb, TCA_HFSC_FSC, &cl->cl_fsc) < 0)) in hfsc_dump_curves()
1296 if ((cl->cl_flags & HFSC_USC) && in hfsc_dump_curves()
1297 (hfsc_dump_sc(skb, TCA_HFSC_USC, &cl->cl_usc) < 0)) in hfsc_dump_curves()
1310 struct hfsc_class *cl = (struct hfsc_class *)arg; in hfsc_dump_class() local
1313 tcm->tcm_parent = cl->cl_parent ? cl->cl_parent->cl_common.classid : in hfsc_dump_class()
1315 tcm->tcm_handle = cl->cl_common.classid; in hfsc_dump_class()
1316 if (cl->level == 0) in hfsc_dump_class()
1317 tcm->tcm_info = cl->qdisc->handle; in hfsc_dump_class()
1322 if (hfsc_dump_curves(skb, cl) < 0) in hfsc_dump_class()
1335 struct hfsc_class *cl = (struct hfsc_class *)arg; in hfsc_dump_class_stats() local
1339 qdisc_qstats_qlen_backlog(cl->qdisc, &qlen, &cl->qstats.backlog); in hfsc_dump_class_stats()
1340 xstats.level = cl->level; in hfsc_dump_class_stats()
1341 xstats.period = cl->cl_vtperiod; in hfsc_dump_class_stats()
1342 xstats.work = cl->cl_total; in hfsc_dump_class_stats()
1343 xstats.rtwork = cl->cl_cumul; in hfsc_dump_class_stats()
1345 if (gnet_stats_copy_basic(d, NULL, &cl->bstats, true) < 0 || in hfsc_dump_class_stats()
1346 gnet_stats_copy_rate_est(d, &cl->rate_est) < 0 || in hfsc_dump_class_stats()
1347 gnet_stats_copy_queue(d, NULL, &cl->qstats, qlen) < 0) in hfsc_dump_class_stats()
1359 struct hfsc_class *cl; in hfsc_walk() local
1366 hlist_for_each_entry(cl, &q->clhash.hash[i], in hfsc_walk()
1368 if (!tc_qdisc_stats_dump(sch, (unsigned long)cl, arg)) in hfsc_walk()
1378 struct hfsc_class *cl; in hfsc_schedule_watchdog() local
1381 cl = eltree_get_minel(q); in hfsc_schedule_watchdog()
1382 if (cl) in hfsc_schedule_watchdog()
1383 next_time = cl->cl_e; in hfsc_schedule_watchdog()
1454 hfsc_reset_class(struct hfsc_class *cl) in hfsc_reset_class() argument
1456 cl->cl_total = 0; in hfsc_reset_class()
1457 cl->cl_cumul = 0; in hfsc_reset_class()
1458 cl->cl_d = 0; in hfsc_reset_class()
1459 cl->cl_e = 0; in hfsc_reset_class()
1460 cl->cl_vt = 0; in hfsc_reset_class()
1461 cl->cl_vtadj = 0; in hfsc_reset_class()
1462 cl->cl_cvtmin = 0; in hfsc_reset_class()
1463 cl->cl_cvtoff = 0; in hfsc_reset_class()
1464 cl->cl_vtperiod = 0; in hfsc_reset_class()
1465 cl->cl_parentperiod = 0; in hfsc_reset_class()
1466 cl->cl_f = 0; in hfsc_reset_class()
1467 cl->cl_myf = 0; in hfsc_reset_class()
1468 cl->cl_cfmin = 0; in hfsc_reset_class()
1469 cl->cl_nactive = 0; in hfsc_reset_class()
1471 cl->vt_tree = RB_ROOT; in hfsc_reset_class()
1472 cl->cf_tree = RB_ROOT; in hfsc_reset_class()
1473 qdisc_reset(cl->qdisc); in hfsc_reset_class()
1475 if (cl->cl_flags & HFSC_RSC) in hfsc_reset_class()
1476 rtsc_init(&cl->cl_deadline, &cl->cl_rsc, 0, 0); in hfsc_reset_class()
1477 if (cl->cl_flags & HFSC_FSC) in hfsc_reset_class()
1478 rtsc_init(&cl->cl_virtual, &cl->cl_fsc, 0, 0); in hfsc_reset_class()
1479 if (cl->cl_flags & HFSC_USC) in hfsc_reset_class()
1480 rtsc_init(&cl->cl_ulimit, &cl->cl_usc, 0, 0); in hfsc_reset_class()
1487 struct hfsc_class *cl; in hfsc_reset_qdisc() local
1491 hlist_for_each_entry(cl, &q->clhash.hash[i], cl_common.hnode) in hfsc_reset_qdisc()
1492 hfsc_reset_class(cl); in hfsc_reset_qdisc()
1503 struct hfsc_class *cl; in hfsc_destroy_qdisc() local
1507 hlist_for_each_entry(cl, &q->clhash.hash[i], cl_common.hnode) { in hfsc_destroy_qdisc()
1508 tcf_block_put(cl->block); in hfsc_destroy_qdisc()
1509 cl->block = NULL; in hfsc_destroy_qdisc()
1513 hlist_for_each_entry_safe(cl, next, &q->clhash.hash[i], in hfsc_destroy_qdisc()
1515 hfsc_destroy_class(sch, cl); in hfsc_destroy_qdisc()
1542 struct hfsc_class *cl; in hfsc_enqueue() local
1546 cl = hfsc_classify(skb, sch, &err); in hfsc_enqueue()
1547 if (cl == NULL) { in hfsc_enqueue()
1554 first = !cl->qdisc->q.qlen; in hfsc_enqueue()
1555 err = qdisc_enqueue(skb, cl->qdisc, to_free); in hfsc_enqueue()
1558 cl->qstats.drops++; in hfsc_enqueue()
1565 if (cl->cl_flags & HFSC_RSC) in hfsc_enqueue()
1566 init_ed(cl, len); in hfsc_enqueue()
1567 if (cl->cl_flags & HFSC_FSC) in hfsc_enqueue()
1568 init_vf(cl, len); in hfsc_enqueue()
1574 if (cl->cl_flags & HFSC_RSC) in hfsc_enqueue()
1575 cl->qdisc->ops->peek(cl->qdisc); in hfsc_enqueue()
1589 struct hfsc_class *cl; in hfsc_dequeue() local
1605 cl = eltree_get_mindl(q, cur_time); in hfsc_dequeue()
1606 if (cl) { in hfsc_dequeue()
1613 cl = vttree_get_minvt(&q->root, cur_time); in hfsc_dequeue()
1614 if (cl == NULL) { in hfsc_dequeue()
1621 skb = qdisc_dequeue_peeked(cl->qdisc); in hfsc_dequeue()
1623 qdisc_warn_nonwc("HFSC", cl->qdisc); in hfsc_dequeue()
1627 bstats_update(&cl->bstats, skb); in hfsc_dequeue()
1628 update_vf(cl, qdisc_pkt_len(skb), cur_time); in hfsc_dequeue()
1630 cl->cl_cumul += qdisc_pkt_len(skb); in hfsc_dequeue()
1632 if (cl->cl_flags & HFSC_RSC) { in hfsc_dequeue()
1633 if (cl->qdisc->q.qlen != 0) { in hfsc_dequeue()
1635 next_len = qdisc_peek_len(cl->qdisc); in hfsc_dequeue()
1637 update_ed(cl, next_len); in hfsc_dequeue()
1639 update_d(cl, next_len); in hfsc_dequeue()
1642 eltree_remove(cl); in hfsc_dequeue()