Lines Matching defs:cl

170 #define	HFSC_IS_A_PARENT_CLASS(cl)	((cl)->cl_children != NULL)
283 struct hfsc_class *cl;
289 (cl = hif->hif_rootclass->cl_children) != NULL) {
294 for (; cl != NULL; cl = hfsc_nextclass(cl)) {
295 if (!HFSC_IS_A_PARENT_CLASS(cl)) {
296 (void) hfsc_class_destroy(hif, cl);
309 struct hfsc_class *cl;
313 for (cl = hif->hif_rootclass; cl != NULL; cl = hfsc_nextclass(cl)) {
314 if (!qempty(&cl->cl_q))
315 hfsc_purgeq(hif, cl, 0, NULL, NULL);
331 struct hfsc_class *cl;
335 for (cl = hif->hif_rootclass; cl != NULL; cl = hfsc_nextclass(cl))
336 hfsc_updateq(hif, cl, ev);
345 struct hfsc_class *cl = NULL, *parent;
357 cl = hfsc_class_create(hif, rtsc, lssc, ulsc, parent,
359 if (cl == NULL)
363 *clp = cl;
375 struct hfsc_class *cl, *p;
427 cl = zalloc(hfsc_cl_zone);
428 if (cl == NULL)
431 bzero(cl, hfsc_cl_size);
432 TAILQ_INIT(&cl->cl_actc);
441 _qinit(&cl->cl_q, Q_DROPTAIL, qlimit);
443 cl->cl_flags = flags;
458 cl->cl_qflags = 0;
461 cl->cl_qflags |= BLUEF_ECN;
463 cl->cl_qflags |= SFBF_ECN;
465 cl->cl_qflags |= REDF_ECN;
467 cl->cl_qflags |= RIOF_ECN;
471 cl->cl_qflags |= SFBF_FLOWCTL;
475 cl->cl_qflags |= RIOF_CLEARDSCP;
491 cl->cl_red = red_alloc(ifp, 0, 0,
492 qlimit(&cl->cl_q) * 10/100,
493 qlimit(&cl->cl_q) * 30/100,
494 cl->cl_qflags, pkttime);
495 if (cl->cl_red != NULL)
496 qtype(&cl->cl_q) = Q_RED;
501 cl->cl_rio =
502 rio_alloc(ifp, 0, NULL, cl->cl_qflags, pkttime);
503 if (cl->cl_rio != NULL)
504 qtype(&cl->cl_q) = Q_RIO;
510 cl->cl_blue = blue_alloc(ifp, 0, 0, cl->cl_qflags);
511 if (cl->cl_blue != NULL)
512 qtype(&cl->cl_q) = Q_BLUE;
516 if (!(cl->cl_flags & HFCF_LAZY))
517 cl->cl_sfb = sfb_alloc(ifp, qid,
518 qlimit(&cl->cl_q), cl->cl_qflags);
519 if (cl->cl_sfb != NULL || (cl->cl_flags & HFCF_LAZY))
520 qtype(&cl->cl_q) = Q_SFB;
524 cl->cl_id = hif->hif_classid++;
525 cl->cl_handle = qid;
526 cl->cl_hif = hif;
527 cl->cl_parent = parent;
536 cl->cl_flags |= HFCF_RSC;
537 cl->cl_rsc0 = *rsc;
538 (void) sc2isc(cl, &cl->cl_rsc0, &cl->cl_rsc, eff_rate);
539 rtsc_init(&cl->cl_deadline, &cl->cl_rsc, 0, 0);
540 rtsc_init(&cl->cl_eligible, &cl->cl_rsc, 0, 0);
546 cl->cl_flags |= HFCF_FSC;
547 cl->cl_fsc0 = *fsc;
548 (void) sc2isc(cl, &cl->cl_fsc0, &cl->cl_fsc, eff_rate);
549 rtsc_init(&cl->cl_virtual, &cl->cl_fsc, 0, 0);
555 cl->cl_flags |= HFCF_USC;
556 cl->cl_usc0 = *usc;
557 (void) sc2isc(cl, &cl->cl_usc0, &cl->cl_usc, eff_rate);
558 rtsc_init(&cl->cl_ulimit, &cl->cl_usc, 0, 0);
568 hif->hif_class_tbl[i] = cl;
572 hif->hif_class_tbl[i] = cl;
582 hif->hif_defaultclass = cl;
586 hif->hif_rootclass = cl;
590 parent->cl_children = cl;
594 p->cl_siblings = cl;
600 "flags=%b\n", if_name(ifp), hfsc_style(hif), cl->cl_handle,
601 (cl->cl_parent != NULL) ? cl->cl_parent->cl_handle : 0,
602 qlimit(&cl->cl_q), cl->cl_flags, HFCF_BITS);
603 if (cl->cl_flags & HFCF_RSC) {
604 hfsc_print_sc(hif, cl->cl_handle, eff_rate,
605 &cl->cl_rsc0, &cl->cl_rsc, "rsc");
607 if (cl->cl_flags & HFCF_FSC) {
608 hfsc_print_sc(hif, cl->cl_handle, eff_rate,
609 &cl->cl_fsc0, &cl->cl_fsc, "fsc");
611 if (cl->cl_flags & HFCF_USC) {
612 hfsc_print_sc(hif, cl->cl_handle, eff_rate,
613 &cl->cl_usc0, &cl->cl_usc, "usc");
617 return (cl);
620 if (cl->cl_qalg.ptr != NULL) {
622 if (q_is_rio(&cl->cl_q))
623 rio_destroy(cl->cl_rio);
626 if (q_is_red(&cl->cl_q))
627 red_destroy(cl->cl_red);
630 if (q_is_blue(&cl->cl_q))
631 blue_destroy(cl->cl_blue);
633 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
634 sfb_destroy(cl->cl_sfb);
635 cl->cl_qalg.ptr = NULL;
636 qtype(&cl->cl_q) = Q_DROPTAIL;
637 qstate(&cl->cl_q) = QS_RUNNING;
639 zfree(hfsc_cl_zone, cl);
646 struct hfsc_class *cl;
650 if ((cl = hfsc_clh_to_clp(hif, qid)) == NULL)
653 return (hfsc_class_destroy(hif, cl));
657 hfsc_class_destroy(struct hfsc_if *hif, struct hfsc_class *cl)
661 if (cl == NULL)
664 if (HFSC_IS_A_PARENT_CLASS(cl))
669 if (!qempty(&cl->cl_q))
670 hfsc_purgeq(hif, cl, 0, NULL, NULL);
672 if (cl->cl_parent == NULL) {
675 struct hfsc_class *p = cl->cl_parent->cl_children;
677 if (p == cl)
678 cl->cl_parent->cl_children = cl->cl_siblings;
680 if (p->cl_siblings == cl) {
681 p->cl_siblings = cl->cl_siblings;
689 if (hif->hif_class_tbl[i] == cl) {
696 if (cl->cl_qalg.ptr != NULL) {
698 if (q_is_rio(&cl->cl_q))
699 rio_destroy(cl->cl_rio);
702 if (q_is_red(&cl->cl_q))
703 red_destroy(cl->cl_red);
706 if (q_is_blue(&cl->cl_q))
707 blue_destroy(cl->cl_blue);
709 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
710 sfb_destroy(cl->cl_sfb);
711 cl->cl_qalg.ptr = NULL;
712 qtype(&cl->cl_q) = Q_DROPTAIL;
713 qstate(&cl->cl_q) = QS_RUNNING;
716 if (cl == hif->hif_rootclass)
718 if (cl == hif->hif_defaultclass)
724 cl->cl_handle, cl->cl_id);
727 zfree(hfsc_cl_zone, cl);
735 * for (cl = hif->hif_rootclass; cl != NULL; cl = hfsc_nextclass(cl))
739 hfsc_nextclass(struct hfsc_class *cl)
741 IFCQ_LOCK_ASSERT_HELD(cl->cl_hif->hif_ifq);
743 if (cl->cl_children != NULL)
744 cl = cl->cl_children;
745 else if (cl->cl_siblings != NULL)
746 cl = cl->cl_siblings;
748 while ((cl = cl->cl_parent) != NULL)
749 if (cl->cl_siblings) {
750 cl = cl->cl_siblings;
755 return (cl);
759 hfsc_enqueue(struct hfsc_if *hif, struct hfsc_class *cl, struct mbuf *m,
767 VERIFY(cl == NULL || cl->cl_hif == hif);
769 if (cl == NULL) {
770 cl = hfsc_clh_to_clp(hif, t->pftag_qid);
771 if (cl == NULL || HFSC_IS_A_PARENT_CLASS(cl)) {
772 cl = hif->hif_defaultclass;
773 if (cl == NULL) {
783 ret = hfsc_addq(cl, m, t);
793 PKTCNTR_ADD(&cl->cl_stats.drop_cnt, 1, len);
807 cl->cl_hif->hif_packets++;
810 if (qlen(&cl->cl_q) == 1)
811 set_active(cl, len);
826 struct hfsc_class *cl;
842 cl = hif->hif_pollcache;
845 if (cl->cl_flags & HFCF_RSC)
846 realtime = (cl->cl_e <= cur_time);
853 if ((cl = ellist_get_mindl(&hif->hif_eligible, cur_time))
862 cl = hif->hif_rootclass;
863 while (HFSC_IS_A_PARENT_CLASS(cl)) {
865 cl = actlist_firstfit(cl, cur_time);
866 if (cl == NULL) {
878 if (cl->cl_parent->cl_cvtmin < cl->cl_vt)
879 cl->cl_parent->cl_cvtmin = cl->cl_vt;
885 hif->hif_pollcache = cl;
886 m = hfsc_pollq(cl);
891 m = hfsc_getq(cl);
894 cl->cl_hif->hif_packets--;
897 PKTCNTR_ADD(&cl->cl_stats.xmit_cnt, 1, len);
899 update_vf(cl, len, cur_time);
901 cl->cl_cumul += len;
903 if (!qempty(&cl->cl_q)) {
904 if (cl->cl_flags & HFCF_RSC) {
906 next_len = m_pktlen(qhead(&cl->cl_q));
909 update_ed(cl, next_len);
911 update_d(cl, next_len);
915 set_passive(cl);
923 hfsc_addq(struct hfsc_class *cl, struct mbuf *m, struct pf_mtag *t)
925 struct ifclassq *ifq = cl->cl_hif->hif_ifq;
930 if (q_is_rio(&cl->cl_q))
931 return (rio_addq(cl->cl_rio, &cl->cl_q, m, t));
935 if (q_is_red(&cl->cl_q))
936 return (red_addq(cl->cl_red, &cl->cl_q, m, t));
940 if (q_is_blue(&cl->cl_q))
941 return (blue_addq(cl->cl_blue, &cl->cl_q, m, t));
944 if (q_is_sfb(&cl->cl_q)) {
945 if (cl->cl_sfb == NULL) {
946 struct ifnet *ifp = HFSCIF_IFP(cl->cl_hif);
948 VERIFY(cl->cl_flags & HFCF_LAZY);
951 cl->cl_sfb = sfb_alloc(ifp, cl->cl_handle,
952 qlimit(&cl->cl_q), cl->cl_qflags);
953 if (cl->cl_sfb == NULL) {
955 qtype(&cl->cl_q) = Q_DROPTAIL;
956 cl->cl_flags &= ~HFCF_SFB;
957 cl->cl_qflags &= ~(SFBF_ECN | SFBF_FLOWCTL);
962 hfsc_style(cl->cl_hif), cl->cl_handle,
963 cl->cl_id);
966 if (cl->cl_sfb != NULL)
967 return (sfb_addq(cl->cl_sfb, &cl->cl_q, m, t));
968 } else if (qlen(&cl->cl_q) >= qlimit(&cl->cl_q)) {
974 if (cl->cl_flags & HFCF_CLEARDSCP)
977 _addq(&cl->cl_q, m);
983 hfsc_getq(struct hfsc_class *cl)
985 IFCQ_LOCK_ASSERT_HELD(cl->cl_hif->hif_ifq);
988 if (q_is_rio(&cl->cl_q))
989 return (rio_getq(cl->cl_rio, &cl->cl_q));
993 if (q_is_red(&cl->cl_q))
994 return (red_getq(cl->cl_red, &cl->cl_q));
998 if (q_is_blue(&cl->cl_q))
999 return (blue_getq(cl->cl_blue, &cl->cl_q));
1002 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
1003 return (sfb_getq(cl->cl_sfb, &cl->cl_q));
1005 return (_getq(&cl->cl_q));
1009 hfsc_pollq(struct hfsc_class *cl)
1011 IFCQ_LOCK_ASSERT_HELD(cl->cl_hif->hif_ifq);
1013 return (qhead(&cl->cl_q));
1017 hfsc_purgeq(struct hfsc_if *hif, struct hfsc_class *cl, u_int32_t flow,
1025 if ((qlen = qlen(&cl->cl_q)) == 0) {
1034 if (q_is_rio(&cl->cl_q))
1035 rio_purgeq(cl->cl_rio, &cl->cl_q, flow, &cnt, &len);
1039 if (q_is_red(&cl->cl_q))
1040 red_purgeq(cl->cl_red, &cl->cl_q, flow, &cnt, &len);
1044 if (q_is_blue(&cl->cl_q))
1045 blue_purgeq(cl->cl_blue, &cl->cl_q, flow, &cnt, &len);
1048 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
1049 sfb_purgeq(cl->cl_sfb, &cl->cl_q, flow, &cnt, &len);
1051 _flushq_flow(&cl->cl_q, flow, &cnt, &len);
1054 VERIFY(qlen(&cl->cl_q) == (qlen - cnt));
1056 PKTCNTR_ADD(&cl->cl_stats.drop_cnt, cnt, len);
1065 if (qempty(&cl->cl_q)) {
1066 update_vf(cl, 0, 0); /* remove cl from the actlist */
1067 set_passive(cl);
1074 cl->cl_handle, cl->cl_id, qlen, qlen(&cl->cl_q),
1101 hfsc_updateq_linkrate(struct hfsc_if *hif, struct hfsc_class *cl)
1111 sc = &cl->cl_rsc0;
1112 isc = &cl->cl_rsc;
1113 if ((cl->cl_flags & HFCF_RSC) && sc2isc(cl, sc, isc, eff_rate)) {
1114 rtsc_init(&cl->cl_deadline, isc, 0, 0);
1115 rtsc_init(&cl->cl_eligible, isc, 0, 0);
1117 hfsc_print_sc(hif, cl->cl_handle, eff_rate,
1121 sc = &cl->cl_fsc0;
1122 isc = &cl->cl_fsc;
1123 if ((cl->cl_flags & HFCF_FSC) && sc2isc(cl, sc, isc, eff_rate)) {
1124 rtsc_init(&cl->cl_virtual, isc, 0, 0);
1126 hfsc_print_sc(hif, cl->cl_handle, eff_rate,
1130 sc = &cl->cl_usc0;
1131 isc = &cl->cl_usc;
1132 if ((cl->cl_flags & HFCF_USC) && sc2isc(cl, sc, isc, eff_rate)) {
1133 rtsc_init(&cl->cl_ulimit, isc, 0, 0);
1135 hfsc_print_sc(hif, cl->cl_handle, eff_rate,
1142 hfsc_updateq(struct hfsc_if *hif, struct hfsc_class *cl, cqev_t ev)
1149 cl->cl_handle, cl->cl_id, ifclassq_ev2str(ev));
1153 hfsc_updateq_linkrate(hif, cl);
1156 if (q_is_rio(&cl->cl_q))
1157 return (rio_updateq(cl->cl_rio, ev));
1160 if (q_is_red(&cl->cl_q))
1161 return (red_updateq(cl->cl_red, ev));
1164 if (q_is_blue(&cl->cl_q))
1165 return (blue_updateq(cl->cl_blue, ev));
1167 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
1168 return (sfb_updateq(cl->cl_sfb, ev));
1172 set_active(struct hfsc_class *cl, u_int32_t len)
1174 if (cl->cl_flags & HFCF_RSC)
1175 init_ed(cl, len);
1176 if (cl->cl_flags & HFCF_FSC)
1177 init_vf(cl, len);
1179 cl->cl_stats.period++;
1183 set_passive(struct hfsc_class *cl)
1185 if (cl->cl_flags & HFCF_RSC)
1186 ellist_remove(cl);
1189 * actlist is now handled in update_vf() so that update_vf(cl, 0, 0)
1195 init_ed(struct hfsc_class *cl, u_int32_t next_len)
1202 rtsc_min(&cl->cl_deadline, &cl->cl_rsc, cur_time, cl->cl_cumul);
1209 cl->cl_eligible = cl->cl_deadline;
1210 if (cl->cl_rsc.sm1 <= cl->cl_rsc.sm2) {
1211 cl->cl_eligible.dx = 0;
1212 cl->cl_eligible.dy = 0;
1216 cl->cl_e = rtsc_y2x(&cl->cl_eligible, cl->cl_cumul);
1217 cl->cl_d = rtsc_y2x(&cl->cl_deadline, cl->cl_cumul + next_len);
1219 ellist_insert(cl);
1223 update_ed(struct hfsc_class *cl, u_int32_t next_len)
1225 cl->cl_e = rtsc_y2x(&cl->cl_eligible, cl->cl_cumul);
1226 cl->cl_d = rtsc_y2x(&cl->cl_deadline, cl->cl_cumul + next_len);
1228 ellist_update(cl);
1232 update_d(struct hfsc_class *cl, u_int32_t next_len)
1234 cl->cl_d = rtsc_y2x(&cl->cl_deadline, cl->cl_cumul + next_len);
1238 init_vf(struct hfsc_class *cl, u_int32_t len)
1247 for (; cl->cl_parent != NULL; cl = cl->cl_parent) {
1249 if (go_active && cl->cl_nactive++ == 0)
1255 max_cl = actlist_last(&cl->cl_parent->cl_actc);
1263 if (cl->cl_parent->cl_cvtmin != 0)
1264 vt = (cl->cl_parent->cl_cvtmin + vt)/2;
1266 if (cl->cl_parent->cl_vtperiod !=
1267 cl->cl_parentperiod || vt > cl->cl_vt)
1268 cl->cl_vt = vt;
1276 vt = cl->cl_parent->cl_cvtmax;
1277 for (p = cl->cl_parent->cl_children; p != NULL;
1280 cl->cl_vt = 0;
1281 cl->cl_parent->cl_cvtmax = 0;
1282 cl->cl_parent->cl_cvtmin = 0;
1284 cl->cl_initvt = cl->cl_vt;
1287 vt = cl->cl_vt + cl->cl_vtoff;
1288 rtsc_min(&cl->cl_virtual, &cl->cl_fsc,
1289 vt, cl->cl_total);
1290 if (cl->cl_virtual.x == vt) {
1291 cl->cl_virtual.x -= cl->cl_vtoff;
1292 cl->cl_vtoff = 0;
1294 cl->cl_vtadj = 0;
1296 cl->cl_vtperiod++; /* increment vt period */
1297 cl->cl_parentperiod = cl->cl_parent->cl_vtperiod;
1298 if (cl->cl_parent->cl_nactive == 0)
1299 cl->cl_parentperiod++;
1300 cl->cl_f = 0;
1302 actlist_insert(cl);
1304 if (cl->cl_flags & HFCF_USC) {
1310 rtsc_min(&cl->cl_ulimit, &cl->cl_usc, cur_time,
1311 cl->cl_total);
1313 cl->cl_myf = rtsc_y2x(&cl->cl_ulimit,
1314 cl->cl_total);
1315 cl->cl_myfadj = 0;
1319 if (cl->cl_myf > cl->cl_cfmin)
1320 f = cl->cl_myf;
1322 f = cl->cl_cfmin;
1323 if (f != cl->cl_f) {
1324 cl->cl_f = f;
1325 update_cfmin(cl->cl_parent);
1331 update_vf(struct hfsc_class *cl, u_int32_t len, u_int64_t cur_time)
1340 go_passive = (qempty(&cl->cl_q) && (cl->cl_flags & HFCF_FSC));
1342 for (; cl->cl_parent != NULL; cl = cl->cl_parent) {
1344 cl->cl_total += len;
1346 if (!(cl->cl_flags & HFCF_FSC) || cl->cl_nactive == 0)
1349 if (go_passive && --cl->cl_nactive == 0)
1358 if (cl->cl_vt > cl->cl_parent->cl_cvtmax)
1359 cl->cl_parent->cl_cvtmax = cl->cl_vt;
1362 actlist_remove(cl);
1364 update_cfmin(cl->cl_parent);
1372 cl->cl_vt = rtsc_y2x(&cl->cl_virtual, cl->cl_total)
1373 - cl->cl_vtoff + cl->cl_vtadj;
1380 if (cl->cl_vt < cl->cl_parent->cl_cvtmin) {
1381 cl->cl_vtadj += cl->cl_parent->cl_cvtmin - cl->cl_vt;
1382 cl->cl_vt = cl->cl_parent->cl_cvtmin;
1386 actlist_update(cl);
1388 if (cl->cl_flags & HFCF_USC) {
1389 cl->cl_myf = cl->cl_myfadj +
1390 rtsc_y2x(&cl->cl_ulimit, cl->cl_total);
1400 if (cl->cl_myf < myf_bound) {
1401 delta = cur_time - cl->cl_myf;
1402 cl->cl_myfadj += delta;
1403 cl->cl_myf += delta;
1409 if (cl->cl_myf > cl->cl_cfmin)
1410 f = cl->cl_myf;
1412 f = cl->cl_cfmin;
1413 if (f != cl->cl_f) {
1414 cl->cl_f = f;
1415 update_cfmin(cl->cl_parent);
1421 update_cfmin(struct hfsc_class *cl)
1426 if (TAILQ_EMPTY(&cl->cl_actc)) {
1427 cl->cl_cfmin = 0;
1431 TAILQ_FOREACH(p, &cl->cl_actc, cl_actlist) {
1433 cl->cl_cfmin = 0;
1439 cl->cl_cfmin = cfmin;
1452 ellist_insert(struct hfsc_class *cl)
1454 struct hfsc_if *hif = cl->cl_hif;
1459 p->cl_e <= cl->cl_e) {
1460 TAILQ_INSERT_TAIL(&hif->hif_eligible, cl, cl_ellist);
1465 if (cl->cl_e < p->cl_e) {
1466 TAILQ_INSERT_BEFORE(p, cl, cl_ellist);
1474 ellist_remove(struct hfsc_class *cl)
1476 struct hfsc_if *hif = cl->cl_hif;
1478 TAILQ_REMOVE(&hif->hif_eligible, cl, cl_ellist);
1482 ellist_update(struct hfsc_class *cl)
1484 struct hfsc_if *hif = cl->cl_hif;
1491 p = TAILQ_NEXT(cl, cl_ellist);
1492 if (p == NULL || cl->cl_e <= p->cl_e)
1498 if (last->cl_e <= cl->cl_e) {
1499 TAILQ_REMOVE(&hif->hif_eligible, cl, cl_ellist);
1500 TAILQ_INSERT_TAIL(&hif->hif_eligible, cl, cl_ellist);
1509 if (cl->cl_e < p->cl_e) {
1510 TAILQ_REMOVE(&hif->hif_eligible, cl, cl_ellist);
1511 TAILQ_INSERT_BEFORE(p, cl, cl_ellist);
1522 struct hfsc_class *p, *cl = NULL;
1527 if (cl == NULL || p->cl_d < cl->cl_d)
1528 cl = p;
1530 return (cl);
1540 actlist_insert(struct hfsc_class *cl)
1545 if ((p = TAILQ_LAST(&cl->cl_parent->cl_actc, _active)) == NULL ||
1546 p->cl_vt <= cl->cl_vt) {
1547 TAILQ_INSERT_TAIL(&cl->cl_parent->cl_actc, cl, cl_actlist);
1551 TAILQ_FOREACH(p, &cl->cl_parent->cl_actc, cl_actlist) {
1552 if (cl->cl_vt < p->cl_vt) {
1553 TAILQ_INSERT_BEFORE(p, cl, cl_actlist);
1561 actlist_remove(struct hfsc_class *cl)
1563 TAILQ_REMOVE(&cl->cl_parent->cl_actc, cl, cl_actlist);
1567 actlist_update(struct hfsc_class *cl)
1576 p = TAILQ_NEXT(cl, cl_actlist);
1577 if (p == NULL || cl->cl_vt < p->cl_vt)
1581 last = TAILQ_LAST(&cl->cl_parent->cl_actc, _active);
1583 if (last->cl_vt <= cl->cl_vt) {
1584 TAILQ_REMOVE(&cl->cl_parent->cl_actc, cl, cl_actlist);
1585 TAILQ_INSERT_TAIL(&cl->cl_parent->cl_actc, cl, cl_actlist);
1594 if (cl->cl_vt < p->cl_vt) {
1595 TAILQ_REMOVE(&cl->cl_parent->cl_actc, cl, cl_actlist);
1596 TAILQ_INSERT_BEFORE(p, cl, cl_actlist);
1604 actlist_firstfit(struct hfsc_class *cl, u_int64_t cur_time)
1608 TAILQ_FOREACH(p, &cl->cl_actc, cl_actlist) {
1726 sc2isc(struct hfsc_class *cl, struct service_curve *sc, struct internal_sc *isc,
1729 struct hfsc_if *hif = cl->cl_hif;
1745 hfsc_style(hif), cl->cl_handle, cl->cl_id, eff_rate);
1899 struct hfsc_class *cl;
1903 if ((cl = hfsc_clh_to_clp(hif, qid)) == NULL)
1906 sp->class_id = cl->cl_id;
1907 sp->class_handle = cl->cl_handle;
1909 if (cl->cl_flags & HFCF_RSC) {
1910 sp->rsc.m1 = sm2m(cl->cl_rsc.sm1);
1911 sp->rsc.d = dx2d(cl->cl_rsc.dx);
1912 sp->rsc.m2 = sm2m(cl->cl_rsc.sm2);
1918 if (cl->cl_flags & HFCF_FSC) {
1919 sp->fsc.m1 = sm2m(cl->cl_fsc.sm1);
1920 sp->fsc.d = dx2d(cl->cl_fsc.dx);
1921 sp->fsc.m2 = sm2m(cl->cl_fsc.sm2);
1927 if (cl->cl_flags & HFCF_USC) {
1928 sp->usc.m1 = sm2m(cl->cl_usc.sm1);
1929 sp->usc.d = dx2d(cl->cl_usc.dx);
1930 sp->usc.m2 = sm2m(cl->cl_usc.sm2);
1937 sp->total = cl->cl_total;
1938 sp->cumul = cl->cl_cumul;
1940 sp->d = cl->cl_d;
1941 sp->e = cl->cl_e;
1942 sp->vt = cl->cl_vt;
1943 sp->f = cl->cl_f;
1945 sp->initvt = cl->cl_initvt;
1946 sp->vtperiod = cl->cl_vtperiod;
1947 sp->parentperiod = cl->cl_parentperiod;
1948 sp->nactive = cl->cl_nactive;
1949 sp->vtoff = cl->cl_vtoff;
1950 sp->cvtmax = cl->cl_cvtmax;
1951 sp->myf = cl->cl_myf;
1952 sp->cfmin = cl->cl_cfmin;
1953 sp->cvtmin = cl->cl_cvtmin;
1954 sp->myfadj = cl->cl_myfadj;
1955 sp->vtadj = cl->cl_vtadj;
1960 sp->qlength = qlen(&cl->cl_q);
1961 sp->qlimit = qlimit(&cl->cl_q);
1962 sp->xmit_cnt = cl->cl_stats.xmit_cnt;
1963 sp->drop_cnt = cl->cl_stats.drop_cnt;
1964 sp->period = cl->cl_stats.period;
1966 sp->qtype = qtype(&cl->cl_q);
1967 sp->qstate = qstate(&cl->cl_q);
1969 if (q_is_red(&cl->cl_q))
1970 red_getstats(cl->cl_red, &sp->red[0]);
1973 if (q_is_rio(&cl->cl_q))
1974 rio_getstats(cl->cl_rio, &sp->red[0]);
1977 if (q_is_blue(&cl->cl_q))
1978 blue_getstats(cl->cl_blue, &sp->blue);
1980 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
1981 sfb_getstats(cl->cl_sfb, &sp->sfb);
1991 struct hfsc_class *cl;
2000 if ((cl = hif->hif_class_tbl[i]) != NULL && cl->cl_handle == chandle)
2001 return (cl);
2003 if ((cl = hif->hif_class_tbl[i]) != NULL &&
2004 cl->cl_handle == chandle)
2005 return (cl);
2036 ifq->ifcq_disc_slots[i].cl = NULL;