Lines Matching refs:cl

159 #define	is_a_parent_class(cl)	((cl)->cl_children != NULL)
228 struct hfsc_class *cl, *parent;
259 cl = hfsc_class_create(hif, &rtsc, &lssc, &ulsc,
261 if (cl == NULL)
271 struct hfsc_class *cl;
276 if ((cl = clh_to_clp(hif, a->qid)) == NULL)
279 return (hfsc_class_destroy(cl));
286 struct hfsc_class *cl;
293 if ((cl = clh_to_clp(hif, a->qid)) == NULL)
299 get_class_stats(&stats, cl);
314 struct hfsc_class *cl;
323 (cl = hif->hif_rootclass->cl_children) != NULL) {
328 for (; cl != NULL; cl = hfsc_nextclass(cl)) {
329 if (!is_a_parent_class(cl)) {
330 (void)hfsc_class_destroy(cl);
358 struct hfsc_class *cl;
360 for (cl = hif->hif_rootclass; cl != NULL; cl = hfsc_nextclass(cl))
361 if (!qempty(cl->cl_q))
362 hfsc_purgeq(cl);
372 struct hfsc_class *cl, *p;
395 cl = malloc(sizeof(struct hfsc_class), M_DEVBUF, M_NOWAIT | M_ZERO);
396 if (cl == NULL)
399 cl->cl_q = malloc(sizeof(class_queue_t), M_DEVBUF, M_NOWAIT | M_ZERO);
400 if (cl->cl_q == NULL)
403 TAILQ_INIT(&cl->cl_actc);
407 qlimit(cl->cl_q) = qlimit;
408 qtype(cl->cl_q) = Q_DROPTAIL;
409 qlen(cl->cl_q) = 0;
410 qsize(cl->cl_q) = 0;
411 cl->cl_flags = flags;
438 cl->cl_red = red_alloc(0, 0,
439 qlimit(cl->cl_q) * 10/100,
440 qlimit(cl->cl_q) * 30/100,
442 if (cl->cl_red != NULL)
443 qtype(cl->cl_q) = Q_RED;
447 cl->cl_red = (red_t *)rio_alloc(0, NULL,
449 if (cl->cl_red != NULL)
450 qtype(cl->cl_q) = Q_RIO;
457 cl->cl_codel = codel_alloc(5, 100, 0);
458 if (cl->cl_codel != NULL)
459 qtype(cl->cl_q) = Q_CODEL;
464 cl->cl_rsc = malloc(sizeof(struct internal_sc),
466 if (cl->cl_rsc == NULL)
468 sc2isc(rsc, cl->cl_rsc);
469 rtsc_init(&cl->cl_deadline, cl->cl_rsc, 0, 0);
470 rtsc_init(&cl->cl_eligible, cl->cl_rsc, 0, 0);
473 cl->cl_fsc = malloc(sizeof(struct internal_sc),
475 if (cl->cl_fsc == NULL)
477 sc2isc(fsc, cl->cl_fsc);
478 rtsc_init(&cl->cl_virtual, cl->cl_fsc, 0, 0);
481 cl->cl_usc = malloc(sizeof(struct internal_sc),
483 if (cl->cl_usc == NULL)
485 sc2isc(usc, cl->cl_usc);
486 rtsc_init(&cl->cl_ulimit, cl->cl_usc, 0, 0);
489 cl->cl_id = hif->hif_classid++;
490 cl->cl_handle = qid;
491 cl->cl_hif = hif;
492 cl->cl_parent = parent;
505 hif->hif_class_tbl[i] = cl;
509 hif->hif_class_tbl[i] = cl;
520 hif->hif_defaultclass = cl;
524 hif->hif_rootclass = cl;
528 parent->cl_children = cl;
532 p->cl_siblings = cl;
538 return (cl);
541 if (cl->cl_red != NULL) {
543 if (q_is_rio(cl->cl_q))
544 rio_destroy((rio_t *)cl->cl_red);
547 if (q_is_red(cl->cl_q))
548 red_destroy(cl->cl_red);
551 if (q_is_codel(cl->cl_q))
552 codel_destroy(cl->cl_codel);
555 if (cl->cl_fsc != NULL)
556 free(cl->cl_fsc, M_DEVBUF);
557 if (cl->cl_rsc != NULL)
558 free(cl->cl_rsc, M_DEVBUF);
559 if (cl->cl_usc != NULL)
560 free(cl->cl_usc, M_DEVBUF);
561 if (cl->cl_q != NULL)
562 free(cl->cl_q, M_DEVBUF);
563 free(cl, M_DEVBUF);
568 hfsc_class_destroy(struct hfsc_class *cl)
572 if (cl == NULL)
575 if (is_a_parent_class(cl))
579 IFQ_LOCK(cl->cl_hif->hif_ifq);
583 acc_discard_filters(&cl->cl_hif->hif_classifier, cl, 0);
586 if (!qempty(cl->cl_q))
587 hfsc_purgeq(cl);
589 if (cl->cl_parent == NULL) {
592 struct hfsc_class *p = cl->cl_parent->cl_children;
594 if (p == cl)
595 cl->cl_parent->cl_children = cl->cl_siblings;
597 if (p->cl_siblings == cl) {
598 p->cl_siblings = cl->cl_siblings;
606 if (cl->cl_hif->hif_class_tbl[i] == cl) {
607 cl->cl_hif->hif_class_tbl[i] = NULL;
611 cl->cl_hif->hif_classes--;
612 IFQ_UNLOCK(cl->cl_hif->hif_ifq);
615 if (cl->cl_red != NULL) {
617 if (q_is_rio(cl->cl_q))
618 rio_destroy((rio_t *)cl->cl_red);
621 if (q_is_red(cl->cl_q))
622 red_destroy(cl->cl_red);
625 if (q_is_codel(cl->cl_q))
626 codel_destroy(cl->cl_codel);
630 IFQ_LOCK(cl->cl_hif->hif_ifq);
631 if (cl == cl->cl_hif->hif_rootclass)
632 cl->cl_hif->hif_rootclass = NULL;
633 if (cl == cl->cl_hif->hif_defaultclass)
634 cl->cl_hif->hif_defaultclass = NULL;
635 IFQ_UNLOCK(cl->cl_hif->hif_ifq);
637 if (cl->cl_usc != NULL)
638 free(cl->cl_usc, M_DEVBUF);
639 if (cl->cl_fsc != NULL)
640 free(cl->cl_fsc, M_DEVBUF);
641 if (cl->cl_rsc != NULL)
642 free(cl->cl_rsc, M_DEVBUF);
643 free(cl->cl_q, M_DEVBUF);
644 free(cl, M_DEVBUF);
652 * for (cl = hif->hif_rootclass; cl != NULL; cl = hfsc_nextclass(cl))
656 hfsc_nextclass(struct hfsc_class *cl)
658 if (cl->cl_children != NULL)
659 cl = cl->cl_children;
660 else if (cl->cl_siblings != NULL)
661 cl = cl->cl_siblings;
663 while ((cl = cl->cl_parent) != NULL)
664 if (cl->cl_siblings) {
665 cl = cl->cl_siblings;
670 return (cl);
681 struct hfsc_class *cl;
695 cl = NULL;
697 cl = clh_to_clp(hif, t->qid);
700 cl = pktattr->pattr_class;
702 if (cl == NULL || is_a_parent_class(cl)) {
703 cl = hif->hif_defaultclass;
704 if (cl == NULL) {
711 cl->cl_pktattr = pktattr; /* save proto hdr used by ECN */
714 cl->cl_pktattr = NULL;
716 if (hfsc_addq(cl, m) != 0) {
718 PKTCNTR_ADD(&cl->cl_stats.drop_cnt, len);
722 cl->cl_hif->hif_packets++;
725 if (qlen(cl->cl_q) == 1)
726 set_active(cl, m_pktlen(m));
744 struct hfsc_class *cl;
760 cl = hif->hif_pollcache;
763 if (cl->cl_rsc != NULL)
764 realtime = (cl->cl_e <= cur_time);
771 if ((cl = hfsc_get_mindl(hif, cur_time))
782 cl = hif->hif_rootclass;
783 while (is_a_parent_class(cl)) {
785 cl = actlist_firstfit(cl, cur_time);
786 if (cl == NULL) {
797 if (cl->cl_parent->cl_cvtmin < cl->cl_vt)
798 cl->cl_parent->cl_cvtmin = cl->cl_vt;
806 hif->hif_pollcache = cl;
807 m = hfsc_pollq(cl);
812 m = hfsc_getq(cl);
816 cl->cl_hif->hif_packets--;
818 PKTCNTR_ADD(&cl->cl_stats.xmit_cnt, len);
820 update_vf(cl, len, cur_time);
822 cl->cl_cumul += len;
824 if (!qempty(cl->cl_q)) {
825 if (cl->cl_rsc != NULL) {
827 next_len = m_pktlen(qhead(cl->cl_q));
830 update_ed(cl, next_len);
832 update_d(cl, next_len);
836 set_passive(cl);
843 hfsc_addq(struct hfsc_class *cl, struct mbuf *m)
847 if (q_is_rio(cl->cl_q))
848 return rio_addq((rio_t *)cl->cl_red, cl->cl_q,
849 m, cl->cl_pktattr);
852 if (q_is_red(cl->cl_q))
853 return red_addq(cl->cl_red, cl->cl_q, m, cl->cl_pktattr);
856 if (q_is_codel(cl->cl_q))
857 return codel_addq(cl->cl_codel, cl->cl_q, m);
859 if (qlen(cl->cl_q) >= qlimit(cl->cl_q)) {
864 if (cl->cl_flags & HFCF_CLEARDSCP)
865 write_dsfield(m, cl->cl_pktattr, 0);
867 _addq(cl->cl_q, m);
873 hfsc_getq(struct hfsc_class *cl)
876 if (q_is_rio(cl->cl_q))
877 return rio_getq((rio_t *)cl->cl_red, cl->cl_q);
880 if (q_is_red(cl->cl_q))
881 return red_getq(cl->cl_red, cl->cl_q);
884 if (q_is_codel(cl->cl_q))
885 return codel_getq(cl->cl_codel, cl->cl_q);
887 return _getq(cl->cl_q);
891 hfsc_pollq(struct hfsc_class *cl)
893 return qhead(cl->cl_q);
897 hfsc_purgeq(struct hfsc_class *cl)
901 if (qempty(cl->cl_q))
904 while ((m = _getq(cl->cl_q)) != NULL) {
905 PKTCNTR_ADD(&cl->cl_stats.drop_cnt, m_pktlen(m));
907 cl->cl_hif->hif_packets--;
908 IFQ_DEC_LEN(cl->cl_hif->hif_ifq);
910 ASSERT(qlen(cl->cl_q) == 0);
912 update_vf(cl, 0, 0); /* remove cl from the actlist */
913 set_passive(cl);
917 set_active(struct hfsc_class *cl, int len)
919 if (cl->cl_rsc != NULL)
920 init_ed(cl, len);
921 if (cl->cl_fsc != NULL)
922 init_vf(cl, len);
924 cl->cl_stats.period++;
928 set_passive(struct hfsc_class *cl)
930 if (cl->cl_rsc != NULL)
931 ellist_remove(cl);
934 * actlist is now handled in update_vf() so that update_vf(cl, 0, 0)
940 init_ed(struct hfsc_class *cl, int next_len)
947 rtsc_min(&cl->cl_deadline, cl->cl_rsc, cur_time, cl->cl_cumul);
954 cl->cl_eligible = cl->cl_deadline;
955 if (cl->cl_rsc->sm1 <= cl->cl_rsc->sm2) {
956 cl->cl_eligible.dx = 0;
957 cl->cl_eligible.dy = 0;
961 cl->cl_e = rtsc_y2x(&cl->cl_eligible, cl->cl_cumul);
962 cl->cl_d = rtsc_y2x(&cl->cl_deadline, cl->cl_cumul + next_len);
964 ellist_insert(cl);
968 update_ed(struct hfsc_class *cl, int next_len)
970 cl->cl_e = rtsc_y2x(&cl->cl_eligible, cl->cl_cumul);
971 cl->cl_d = rtsc_y2x(&cl->cl_deadline, cl->cl_cumul + next_len);
973 ellist_update(cl);
977 update_d(struct hfsc_class *cl, int next_len)
979 cl->cl_d = rtsc_y2x(&cl->cl_deadline, cl->cl_cumul + next_len);
983 init_vf(struct hfsc_class *cl, int len)
991 for ( ; cl->cl_parent != NULL; cl = cl->cl_parent) {
993 if (go_active && cl->cl_nactive++ == 0)
999 max_cl = TAILQ_LAST(&cl->cl_parent->cl_actc, acthead);
1007 if (cl->cl_parent->cl_cvtmin != 0)
1008 vt = (cl->cl_parent->cl_cvtmin + vt)/2;
1010 if (cl->cl_parent->cl_vtperiod !=
1011 cl->cl_parentperiod || vt > cl->cl_vt)
1012 cl->cl_vt = vt;
1020 vt = cl->cl_parent->cl_cvtmax;
1021 for (p = cl->cl_parent->cl_children; p != NULL;
1024 cl->cl_vt = 0;
1025 cl->cl_parent->cl_cvtmax = 0;
1026 cl->cl_parent->cl_cvtmin = 0;
1028 cl->cl_initvt = cl->cl_vt;
1031 vt = cl->cl_vt + cl->cl_vtoff;
1032 rtsc_min(&cl->cl_virtual, cl->cl_fsc, vt, cl->cl_total);
1033 if (cl->cl_virtual.x == vt) {
1034 cl->cl_virtual.x -= cl->cl_vtoff;
1035 cl->cl_vtoff = 0;
1037 cl->cl_vtadj = 0;
1039 cl->cl_vtperiod++; /* increment vt period */
1040 cl->cl_parentperiod = cl->cl_parent->cl_vtperiod;
1041 if (cl->cl_parent->cl_nactive == 0)
1042 cl->cl_parentperiod++;
1043 cl->cl_f = 0;
1045 actlist_insert(cl);
1047 if (cl->cl_usc != NULL) {
1053 rtsc_min(&cl->cl_ulimit, cl->cl_usc, cur_time,
1054 cl->cl_total);
1056 cl->cl_myf = rtsc_y2x(&cl->cl_ulimit,
1057 cl->cl_total);
1058 cl->cl_myfadj = 0;
1062 if (cl->cl_myf > cl->cl_cfmin)
1063 f = cl->cl_myf;
1065 f = cl->cl_cfmin;
1066 if (f != cl->cl_f) {
1067 cl->cl_f = f;
1068 update_cfmin(cl->cl_parent);
1074 update_vf(struct hfsc_class *cl, int len, u_int64_t cur_time)
1079 go_passive = qempty(cl->cl_q);
1081 for (; cl->cl_parent != NULL; cl = cl->cl_parent) {
1083 cl->cl_total += len;
1085 if (cl->cl_fsc == NULL || cl->cl_nactive == 0)
1088 if (go_passive && --cl->cl_nactive == 0)
1097 if (cl->cl_vt > cl->cl_parent->cl_cvtmax)
1098 cl->cl_parent->cl_cvtmax = cl->cl_vt;
1101 actlist_remove(cl);
1103 update_cfmin(cl->cl_parent);
1111 cl->cl_vt = rtsc_y2x(&cl->cl_virtual, cl->cl_total)
1112 - cl->cl_vtoff + cl->cl_vtadj;
1119 if (cl->cl_vt < cl->cl_parent->cl_cvtmin) {
1120 cl->cl_vtadj += cl->cl_parent->cl_cvtmin - cl->cl_vt;
1121 cl->cl_vt = cl->cl_parent->cl_cvtmin;
1125 actlist_update(cl);
1127 if (cl->cl_usc != NULL) {
1128 cl->cl_myf = cl->cl_myfadj
1129 + rtsc_y2x(&cl->cl_ulimit, cl->cl_total);
1139 if (cl->cl_myf < myf_bound) {
1140 delta = cur_time - cl->cl_myf;
1141 cl->cl_myfadj += delta;
1142 cl->cl_myf += delta;
1147 if (cl->cl_myf > cl->cl_cfmin)
1148 f = cl->cl_myf;
1150 f = cl->cl_cfmin;
1151 if (f != cl->cl_f) {
1152 cl->cl_f = f;
1153 update_cfmin(cl->cl_parent);
1159 update_cfmin(struct hfsc_class *cl)
1164 if (TAILQ_EMPTY(&cl->cl_actc)) {
1165 cl->cl_cfmin = 0;
1169 TAILQ_FOREACH(p, &cl->cl_actc, cl_actlist) {
1171 cl->cl_cfmin = 0;
1177 cl->cl_cfmin = cfmin;
1190 ellist_insert(struct hfsc_class *cl)
1192 struct hfsc_if *hif = cl->cl_hif;
1197 p->cl_e <= cl->cl_e) {
1198 TAILQ_INSERT_TAIL(&hif->hif_eligible, cl, cl_ellist);
1203 if (cl->cl_e < p->cl_e) {
1204 TAILQ_INSERT_BEFORE(p, cl, cl_ellist);
1212 ellist_remove(struct hfsc_class *cl)
1214 struct hfsc_if *hif = cl->cl_hif;
1216 TAILQ_REMOVE(&hif->hif_eligible, cl, cl_ellist);
1220 ellist_update(struct hfsc_class *cl)
1222 struct hfsc_if *hif = cl->cl_hif;
1229 p = TAILQ_NEXT(cl, cl_ellist);
1230 if (p == NULL || cl->cl_e <= p->cl_e)
1236 if (last->cl_e <= cl->cl_e) {
1237 TAILQ_REMOVE(&hif->hif_eligible, cl, cl_ellist);
1238 TAILQ_INSERT_TAIL(&hif->hif_eligible, cl, cl_ellist);
1247 if (cl->cl_e < p->cl_e) {
1248 TAILQ_REMOVE(&hif->hif_eligible, cl, cl_ellist);
1249 TAILQ_INSERT_BEFORE(p, cl, cl_ellist);
1260 struct hfsc_class *p, *cl = NULL;
1265 if (cl == NULL || p->cl_d < cl->cl_d)
1266 cl = p;
1268 return (cl);
1278 actlist_insert(struct hfsc_class *cl)
1283 if ((p = TAILQ_LAST(&cl->cl_parent->cl_actc, acthead)) == NULL
1284 || p->cl_vt <= cl->cl_vt) {
1285 TAILQ_INSERT_TAIL(&cl->cl_parent->cl_actc, cl, cl_actlist);
1289 TAILQ_FOREACH(p, &cl->cl_parent->cl_actc, cl_actlist) {
1290 if (cl->cl_vt < p->cl_vt) {
1291 TAILQ_INSERT_BEFORE(p, cl, cl_actlist);
1299 actlist_remove(struct hfsc_class *cl)
1301 TAILQ_REMOVE(&cl->cl_parent->cl_actc, cl, cl_actlist);
1305 actlist_update(struct hfsc_class *cl)
1314 p = TAILQ_NEXT(cl, cl_actlist);
1315 if (p == NULL || cl->cl_vt < p->cl_vt)
1319 last = TAILQ_LAST(&cl->cl_parent->cl_actc, acthead);
1321 if (last->cl_vt <= cl->cl_vt) {
1322 TAILQ_REMOVE(&cl->cl_parent->cl_actc, cl, cl_actlist);
1323 TAILQ_INSERT_TAIL(&cl->cl_parent->cl_actc, cl, cl_actlist);
1332 if (cl->cl_vt < p->cl_vt) {
1333 TAILQ_REMOVE(&cl->cl_parent->cl_actc, cl, cl_actlist);
1334 TAILQ_INSERT_BEFORE(p, cl, cl_actlist);
1342 actlist_firstfit(struct hfsc_class *cl, u_int64_t cur_time)
1346 TAILQ_FOREACH(p, &cl->cl_actc, cl_actlist) {
1600 get_class_stats(struct hfsc_classstats *sp, struct hfsc_class *cl)
1602 sp->class_id = cl->cl_id;
1603 sp->class_handle = cl->cl_handle;
1605 if (cl->cl_rsc != NULL) {
1606 sp->rsc.m1 = sm2m(cl->cl_rsc->sm1);
1607 sp->rsc.d = dx2d(cl->cl_rsc->dx);
1608 sp->rsc.m2 = sm2m(cl->cl_rsc->sm2);
1614 if (cl->cl_fsc != NULL) {
1615 sp->fsc.m1 = sm2m(cl->cl_fsc->sm1);
1616 sp->fsc.d = dx2d(cl->cl_fsc->dx);
1617 sp->fsc.m2 = sm2m(cl->cl_fsc->sm2);
1623 if (cl->cl_usc != NULL) {
1624 sp->usc.m1 = sm2m(cl->cl_usc->sm1);
1625 sp->usc.d = dx2d(cl->cl_usc->dx);
1626 sp->usc.m2 = sm2m(cl->cl_usc->sm2);
1633 sp->total = cl->cl_total;
1634 sp->cumul = cl->cl_cumul;
1636 sp->d = cl->cl_d;
1637 sp->e = cl->cl_e;
1638 sp->vt = cl->cl_vt;
1639 sp->f = cl->cl_f;
1641 sp->initvt = cl->cl_initvt;
1642 sp->vtperiod = cl->cl_vtperiod;
1643 sp->parentperiod = cl->cl_parentperiod;
1644 sp->nactive = cl->cl_nactive;
1645 sp->vtoff = cl->cl_vtoff;
1646 sp->cvtmax = cl->cl_cvtmax;
1647 sp->myf = cl->cl_myf;
1648 sp->cfmin = cl->cl_cfmin;
1649 sp->cvtmin = cl->cl_cvtmin;
1650 sp->myfadj = cl->cl_myfadj;
1651 sp->vtadj = cl->cl_vtadj;
1656 sp->qlength = qlen(cl->cl_q);
1657 sp->qlimit = qlimit(cl->cl_q);
1658 sp->xmit_cnt = cl->cl_stats.xmit_cnt;
1659 sp->drop_cnt = cl->cl_stats.drop_cnt;
1660 sp->period = cl->cl_stats.period;
1662 sp->qtype = qtype(cl->cl_q);
1664 if (q_is_red(cl->cl_q))
1665 red_getstats(cl->cl_red, &sp->red[0]);
1668 if (q_is_rio(cl->cl_q))
1669 rio_getstats((rio_t *)cl->cl_red, &sp->red[0]);
1672 if (q_is_codel(cl->cl_q))
1673 codel_getstats(cl->cl_codel, &sp->codel);
1682 struct hfsc_class *cl;
1691 if ((cl = hif->hif_class_tbl[i]) != NULL && cl->cl_handle == chandle)
1692 return (cl);
1694 if ((cl = hif->hif_class_tbl[i]) != NULL &&
1695 cl->cl_handle == chandle)
1696 return (cl);
1757 hfsc_class_modify(cl, rsc, fsc, usc)
1758 struct hfsc_class *cl;
1767 cl->cl_rsc == NULL) {
1774 cl->cl_fsc == NULL) {
1783 cl->cl_usc == NULL) {
1795 IFQ_LOCK(cl->cl_hif->hif_ifq);
1799 if (cl->cl_rsc != NULL) {
1800 if (!qempty(cl->cl_q))
1801 hfsc_purgeq(cl);
1802 free(cl->cl_rsc, M_DEVBUF);
1803 cl->cl_rsc = NULL;
1806 if (cl->cl_rsc == NULL)
1807 cl->cl_rsc = rsc_tmp;
1808 sc2isc(rsc, cl->cl_rsc);
1809 rtsc_init(&cl->cl_deadline, cl->cl_rsc, cur_time,
1810 cl->cl_cumul);
1811 cl->cl_eligible = cl->cl_deadline;
1812 if (cl->cl_rsc->sm1 <= cl->cl_rsc->sm2) {
1813 cl->cl_eligible.dx = 0;
1814 cl->cl_eligible.dy = 0;
1821 if (cl->cl_fsc != NULL) {
1822 if (!qempty(cl->cl_q))
1823 hfsc_purgeq(cl);
1824 free(cl->cl_fsc, M_DEVBUF);
1825 cl->cl_fsc = NULL;
1828 if (cl->cl_fsc == NULL)
1829 cl->cl_fsc = fsc_tmp;
1830 sc2isc(fsc, cl->cl_fsc);
1831 rtsc_init(&cl->cl_virtual, cl->cl_fsc, cl->cl_vt,
1832 cl->cl_total);
1838 if (cl->cl_usc != NULL) {
1839 free(cl->cl_usc, M_DEVBUF);
1840 cl->cl_usc = NULL;
1841 cl->cl_myf = 0;
1844 if (cl->cl_usc == NULL)
1845 cl->cl_usc = usc_tmp;
1846 sc2isc(usc, cl->cl_usc);
1847 rtsc_init(&cl->cl_ulimit, cl->cl_usc, cur_time,
1848 cl->cl_total);
1852 if (!qempty(cl->cl_q)) {
1853 if (cl->cl_rsc != NULL)
1854 update_ed(cl, m_pktlen(qhead(cl->cl_q)));
1855 if (cl->cl_fsc != NULL)
1856 update_vf(cl, 0, cur_time);
1860 IFQ_UNLOCK(cl->cl_hif->hif_ifq);
2076 struct hfsc_class *cl, *parent;
2095 if ((cl = hfsc_class_create(hif, &ap->service_curve, NULL, NULL,
2110 struct hfsc_class *cl;
2115 if ((cl = clh_to_clp(hif, ap->class_handle)) == NULL)
2118 return hfsc_class_destroy(cl);
2126 struct hfsc_class *cl;
2134 if ((cl = clh_to_clp(hif, ap->class_handle)) == NULL)
2144 return hfsc_class_modify(cl, rsc, fsc, usc);
2152 struct hfsc_class *cl;
2157 if ((cl = clh_to_clp(hif, ap->class_handle)) == NULL)
2160 if (is_a_parent_class(cl)) {
2168 cl, &ap->filter_handle);
2189 struct hfsc_class *cl;
2203 for (cl = hif->hif_rootclass, n = 0; cl != NULL && n < nclasses;
2204 cl = hfsc_nextclass(cl), n++)
2212 for (n = 0; cl != NULL && n < nclasses; cl = hfsc_nextclass(cl), n++) {
2214 get_class_stats(&stats, cl);