Lines Matching refs:hif
195 struct hfsc_if *hif;
203 hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_WAITOK|M_ZERO);
204 if (hif == NULL)
207 hif->hif_eligible = ellist_alloc();
208 if (hif->hif_eligible == NULL) {
209 free(hif, M_DEVBUF);
213 hif->hif_ifq = &ifp->if_snd;
216 a->altq_disc = hif;
224 struct hfsc_if *hif;
226 if ((hif = a->altq_disc) == NULL)
230 (void)hfsc_clear_interface(hif);
231 (void)hfsc_class_destroy(hif->hif_rootclass);
233 ellist_destroy(hif->hif_eligible);
235 free(hif, M_DEVBUF);
243 struct hfsc_if *hif;
248 if ((hif = a->altq_disc) == NULL)
254 hif->hif_rootclass == NULL)
256 else if ((parent = clh_to_clp(hif, a->parent_qid)) == NULL)
262 if (clh_to_clp(hif, a->qid) != NULL)
275 cl = hfsc_class_create(hif, &rtsc, &lssc, &ulsc,
286 struct hfsc_if *hif;
289 if ((hif = a->altq_disc) == NULL)
292 if ((cl = clh_to_clp(hif, a->qid)) == NULL)
301 struct hfsc_if *hif;
306 if ((hif = altq_lookup(a->ifname, ALTQT_HFSC)) == NULL)
309 if ((cl = clh_to_clp(hif, a->qid)) == NULL)
330 hfsc_clear_interface(struct hfsc_if *hif)
336 acc_discard_filters(&hif->hif_classifier, NULL, 1);
340 while (hif->hif_rootclass != NULL &&
341 (cl = hif->hif_rootclass->cl_children) != NULL) {
360 struct hfsc_if *hif = (struct hfsc_if *)ifq->altq_disc;
364 hfsc_purge(hif);
372 hfsc_purge(struct hfsc_if *hif)
376 for (cl = hif->hif_rootclass; cl != NULL; cl = hfsc_nextclass(cl))
379 if (ALTQ_IS_ENABLED(hif->hif_ifq))
380 hif->hif_ifq->ifq_len = 0;
384 hfsc_class_create(struct hfsc_if *hif, struct service_curve *rsc,
391 if (hif->hif_classes >= HFSC_MAX_CLASSES)
444 red_pkttime = (int64_t)hif->hif_ifq->altq_ifp->if_mtu
491 cl->cl_id = hif->hif_classid++;
493 cl->cl_hif = hif;
497 hif->hif_classes++;
505 if (hif->hif_class_tbl[i] == NULL)
506 hif->hif_class_tbl[i] = cl;
509 if (hif->hif_class_tbl[i] == NULL) {
510 hif->hif_class_tbl[i] = cl;
520 hif->hif_defaultclass = cl;
524 hif->hif_rootclass = cl;
643 * for (cl = hif->hif_rootclass; cl != NULL; cl = hfsc_nextclass(cl))
672 struct hfsc_if *hif = (struct hfsc_if *)ifq->altq_disc;
687 cl = clh_to_clp(hif, ((struct altq_tag *)(t+1))->qid);
693 cl = hif->hif_defaultclass;
737 struct hfsc_if *hif = (struct hfsc_if *)ifq->altq_disc;
744 if (hif->hif_packets == 0)
750 if (op == ALTDQ_REMOVE && hif->hif_pollcache != NULL) {
752 cl = hif->hif_pollcache;
753 hif->hif_pollcache = NULL;
763 if ((cl = ellist_get_mindl(hif->hif_eligible, cur_time))
774 cl = hif->hif_rootclass;
798 hif->hif_pollcache = cl;
1192 struct hfsc_if *hif = cl->cl_hif;
1196 if ((p = TAILQ_LAST(hif->hif_eligible, _eligible)) == NULL ||
1198 TAILQ_INSERT_TAIL(hif->hif_eligible, cl, cl_ellist);
1202 TAILQ_FOREACH(p, hif->hif_eligible, cl_ellist) {
1214 struct hfsc_if *hif = cl->cl_hif;
1216 TAILQ_REMOVE(hif->hif_eligible, cl, cl_ellist);
1222 struct hfsc_if *hif = cl->cl_hif;
1234 last = TAILQ_LAST(hif->hif_eligible, _eligible);
1237 TAILQ_REMOVE(hif->hif_eligible, cl, cl_ellist);
1238 TAILQ_INSERT_TAIL(hif->hif_eligible, cl, cl_ellist);
1248 TAILQ_REMOVE(hif->hif_eligible, cl, cl_ellist);
1689 clh_to_clp(struct hfsc_if *hif, u_int32_t chandle)
1701 if ((cl = hif->hif_class_tbl[i]) != NULL && cl->cl_handle == chandle)
1704 if ((cl = hif->hif_class_tbl[i]) != NULL &&
1714 struct hfsc_if *hif;
1716 hif = malloc(sizeof(struct hfsc_if), M_DEVBUF, M_WAITOK|M_ZERO);
1717 if (hif == NULL)
1720 hif->hif_eligible = ellist_alloc();
1721 if (hif->hif_eligible == NULL) {
1722 free(hif, M_DEVBUF);
1726 hif->hif_ifq = ifq;
1729 hif->hif_next = hif_list;
1730 hif_list = hif;
1732 return hif;
1736 hfsc_detach(struct hfsc_if *hif)
1738 (void)hfsc_clear_interface(hif);
1739 (void)hfsc_class_destroy(hif->hif_rootclass);
1741 /* remove this interface from the hif list */
1742 if (hif_list == hif)
1743 hif_list = hif->hif_next;
1748 if (h->hif_next == hif) {
1749 h->hif_next = hif->hif_next;
1755 ellist_destroy(hif->hif_eligible);
1757 free(hif, M_DEVBUF);
1885 struct hfsc_if *hif;
1887 while ((hif = hif_list) != NULL) {
1889 if (ALTQ_IS_ENABLED(hif->hif_ifq))
1890 altq_disable(hif->hif_ifq);
1892 int error = altq_detach(hif->hif_ifq);
1900 hfsc_detach(hif);
1910 struct hfsc_if *hif;
1940 if ((hif = altq_lookup(ifacep->hfsc_ifname,
1949 if (hif->hif_defaultclass == NULL) {
1956 error = altq_enable(hif->hif_ifq);
1960 error = altq_disable(hif->hif_ifq);
1964 hfsc_clear_interface(hif);
2003 struct hfsc_if *hif;
2010 if ((hif = hfsc_attach(&ifp->if_snd, ap->bandwidth)) == NULL)
2016 if ((error = altq_attach(&ifp->if_snd, ALTQT_HFSC, hif,
2018 &hif->hif_classifier, acc_classify)) != 0)
2019 hfsc_detach(hif);
2027 struct hfsc_if *hif;
2030 if ((hif = altq_lookup(ap->hfsc_ifname, ALTQT_HFSC)) == NULL)
2033 if (ALTQ_IS_ENABLED(hif->hif_ifq))
2034 altq_disable(hif->hif_ifq);
2036 if ((error = altq_detach(hif->hif_ifq)))
2039 hfsc_detach(hif);
2046 struct hfsc_if *hif;
2050 if ((hif = altq_lookup(ap->iface.hfsc_ifname, ALTQT_HFSC)) == NULL)
2054 hif->hif_rootclass == NULL)
2056 else if ((parent = clh_to_clp(hif, ap->parent_handle)) == NULL)
2061 if (hif->hif_class_tbl[i] == NULL)
2066 if ((cl = hfsc_class_create(hif, &ap->service_curve, NULL, NULL,
2079 struct hfsc_if *hif;
2082 if ((hif = altq_lookup(ap->iface.hfsc_ifname, ALTQT_HFSC)) == NULL)
2085 if ((cl = clh_to_clp(hif, ap->class_handle)) == NULL)
2094 struct hfsc_if *hif;
2100 if ((hif = altq_lookup(ap->iface.hfsc_ifname, ALTQT_HFSC)) == NULL)
2103 if ((cl = clh_to_clp(hif, ap->class_handle)) == NULL)
2119 struct hfsc_if *hif;
2122 if ((hif = altq_lookup(ap->iface.hfsc_ifname, ALTQT_HFSC)) == NULL)
2125 if ((cl = clh_to_clp(hif, ap->class_handle)) == NULL)
2135 return acc_add_filter(&hif->hif_classifier, &ap->filter,
2142 struct hfsc_if *hif;
2144 if ((hif = altq_lookup(ap->iface.hfsc_ifname, ALTQT_HFSC)) == NULL)
2147 return acc_delete_filter(&hif->hif_classifier,
2154 struct hfsc_if *hif;
2159 if ((hif
2164 ap->hif_classes = hif->hif_classes;
2165 ap->hif_packets = hif->hif_packets;
2169 for (cl = hif->hif_rootclass, n = 0; cl != NULL && n < nclasses;