• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /xnu-2782.1.97/bsd/net/pktsched/

Lines Matching defs:tif

118 	struct tcq_if	*tif;
120 tif = (how == M_WAITOK) ? zalloc(tcq_zone) : zalloc_noblock(tcq_zone);
121 if (tif == NULL)
124 bzero(tif, tcq_size);
125 tif->tif_maxpri = -1;
126 tif->tif_ifq = &ifp->if_snd;
128 tif->tif_flags |= TCQIFF_ALTQ;
132 if_name(ifp), tcq_style(tif));
135 return (tif);
139 tcq_destroy(struct tcq_if *tif)
141 struct ifclassq *ifq = tif->tif_ifq;
145 err = tcq_destroy_locked(tif);
152 tcq_destroy_locked(struct tcq_if *tif)
154 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
156 (void) tcq_clear_interface(tif);
160 if_name(TCQIF_IFP(tif)), tcq_style(tif));
163 zfree(tcq_zone, tif);
173 tcq_clear_interface(struct tcq_if *tif)
178 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
181 for (pri = 0; pri <= tif->tif_maxpri; pri++)
182 if ((cl = tif->tif_classes[pri]) != NULL)
183 tcq_class_destroy(tif, cl);
190 tcq_purge(struct tcq_if *tif)
195 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
197 for (pri = 0; pri <= tif->tif_maxpri; pri++) {
198 if ((cl = tif->tif_classes[pri]) != NULL && !qempty(&cl->cl_q))
199 tcq_purgeq(tif, cl, 0, NULL, NULL);
208 VERIFY(IFCQ_LEN(tif->tif_ifq) == 0);
213 tcq_purge_sc(struct tcq_if *tif, cqrq_purge_sc_t *pr)
215 struct ifclassq *ifq = tif->tif_ifq;
227 tcq_purgeq(tif, ifq->ifcq_disc_slots[i].cl,
236 tcq_purgeq(tif, ifq->ifcq_disc_slots[i].cl,
245 tcq_event(struct tcq_if *tif, cqev_t ev)
250 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
252 for (pri = 0; pri <= tif->tif_maxpri; pri++)
253 if ((cl = tif->tif_classes[pri]) != NULL)
254 tcq_updateq(tif, cl, ev);
258 tcq_add_queue(struct tcq_if *tif, int priority, u_int32_t qlimit,
263 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
268 if (tif->tif_classes[priority] != NULL)
270 if (tcq_clh_to_clp(tif, qid) != NULL)
273 cl = tcq_class_create(tif, priority, qlimit, flags, qid);
284 tcq_class_create(struct tcq_if *tif, int pri, u_int32_t qlimit,
291 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
294 if (tif->tif_flags & TCQIFF_ALTQ)
300 if_name(TCQIF_IFP(tif)), tcq_style(tif));
308 if_name(TCQIF_IFP(tif)), tcq_style(tif));
316 if_name(TCQIF_IFP(tif)), tcq_style(tif));
328 if_name(TCQIF_IFP(tif)), tcq_style(tif));
332 ifq = tif->tif_ifq;
333 ifp = TCQIF_IFP(tif);
335 if ((cl = tif->tif_classes[pri]) != NULL) {
338 tcq_purgeq(tif, cl, 0, NULL, NULL);
364 tif->tif_classes[pri] = cl;
366 tif->tif_default = cl;
375 if (pri > tif->tif_maxpri)
376 tif->tif_maxpri = pri;
377 cl->cl_tif = tif;
458 "flags=%b\n", if_name(ifp), tcq_style(tif),
466 tcq_remove_queue(struct tcq_if *tif, u_int32_t qid)
470 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
472 if ((cl = tcq_clh_to_clp(tif, qid)) == NULL)
475 return (tcq_class_destroy(tif, cl));
479 tcq_class_destroy(struct tcq_if *tif, struct tcq_class *cl)
481 struct ifclassq *ifq = tif->tif_ifq;
487 tcq_purgeq(tif, cl, 0, NULL, NULL);
489 tif->tif_classes[cl->cl_pri] = NULL;
490 if (tif->tif_maxpri == cl->cl_pri) {
492 if (tif->tif_classes[pri] != NULL) {
493 tif->tif_maxpri = pri;
497 tif->tif_maxpri = -1;
500 if (tif->tif_default == cl)
501 tif->tif_default = NULL;
525 if_name(TCQIF_IFP(tif)), tcq_style(tif),
534 tcq_enqueue(struct tcq_if *tif, struct tcq_class *cl, struct mbuf *m,
537 struct ifclassq *ifq = tif->tif_ifq;
541 VERIFY(cl == NULL || cl->cl_tif == tif);
545 cl = tcq_clh_to_clp(tif, t->pftag_qid);
547 cl = tcq_clh_to_clp(tif, 0);
550 cl = tif->tif_default;
597 tcq_dequeue_tc(struct tcq_if *tif, mbuf_svc_class_t sc, cqdq_op_t op)
599 return (tcq_dequeue_cl(tif, NULL, sc, op));
603 tcq_dequeue_cl(struct tcq_if *tif, struct tcq_class *cl,
606 struct ifclassq *ifq = tif->tif_ifq;
612 cl = tcq_clh_to_clp(tif, MBUF_SCIDX(sc));
639 struct tcq_if *tif = cl->cl_tif;
640 struct ifclassq *ifq = tif->tif_ifq;
661 struct ifnet *ifp = TCQIF_IFP(tif);
678 tcq_style(tif), cl->cl_handle,
680 } else if (tif->tif_throttle != IFNET_THROTTLE_OFF) {
682 cqrq_throttle_t tr = { 1, tif->tif_throttle };
683 int err = tcq_throttle(tif, &tr);
689 (void) tcq_throttle(tif, &tr);
746 tcq_purgeq(struct tcq_if *tif, struct tcq_class *cl, u_int32_t flow,
749 struct ifclassq *ifq = tif->tif_ifq;
792 if_name(TCQIF_IFP(tif)), tcq_style(tif),
805 tcq_updateq(struct tcq_if *tif, struct tcq_class *cl, cqev_t ev)
807 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
811 if_name(TCQIF_IFP(tif)), tcq_style(tif),
832 tcq_get_class_stats(struct tcq_if *tif, u_int32_t qid,
837 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
839 if ((cl = tcq_clh_to_clp(tif, qid)) == NULL)
871 tcq_stat_sc(struct tcq_if *tif, cqrq_stat_sc_t *sr)
873 struct ifclassq *ifq = tif->tif_ifq;
893 tcq_clh_to_clp(struct tcq_if *tif, u_int32_t chandle)
898 IFCQ_LOCK_ASSERT_HELD(tif->tif_ifq);
900 for (idx = tif->tif_maxpri; idx >= 0; idx--)
901 if ((cl = tif->tif_classes[idx]) != NULL &&
909 tcq_style(struct tcq_if *tif)
911 return ((tif->tif_flags & TCQIFF_ALTQ) ? "ALTQ_TCQ" : "TCQ");
965 struct tcq_if *tif = (struct tcq_if *)ifq->ifcq_disc;
972 tcq_purge(tif);
976 tcq_purge_sc(tif, (cqrq_purge_sc_t *)arg);
980 tcq_event(tif, (cqev_t)arg);
984 err = tcq_throttle(tif, (cqrq_throttle_t *)arg);
988 err = tcq_stat_sc(tif, (cqrq_stat_sc_t *)arg);
999 struct tcq_if *tif;
1022 tif = tcq_alloc(ifp, M_WAITOK, FALSE);
1023 if (tif == NULL)
1029 if ((err = tcq_add_queue(tif, 0, maxlen,
1033 if ((err = tcq_add_queue(tif, 1, maxlen,
1037 if ((err = tcq_add_queue(tif, 2, maxlen,
1041 if ((err = tcq_add_queue(tif, 3, maxlen,
1045 err = ifclassq_attach(ifq, PKTSCHEDT_TCQ, tif,
1088 (void) tcq_destroy_locked(tif);
1096 struct tcq_if *tif = ifq->ifcq_disc;
1100 VERIFY(tif != NULL && ifq->ifcq_type == PKTSCHEDT_TCQ);
1102 (void) tcq_destroy_locked(tif);
1117 struct tcq_if *tif = ifq->ifcq_disc;
1125 return (tcq_get_class_stats(tif, ifq->ifcq_disc_slots[slot].qid,
1130 tcq_throttle(struct tcq_if *tif, cqrq_throttle_t *tr)
1132 struct ifclassq *ifq = tif->tif_ifq;
1137 VERIFY(!(tif->tif_flags & TCQIFF_ALTQ));
1140 tr->level = tif->tif_throttle;
1144 if (tr->level == tif->tif_throttle)
1152 err = tcq_resumeq(tif, cl);
1156 err = tcq_suspendq(tif, cl);
1167 if_name(TCQIF_IFP(tif)), tcq_style(tif),
1168 (err == 0) ? "" : "lazy ", tif->tif_throttle,
1171 tif->tif_throttle = tr->level;
1175 tcq_purgeq(tif, cl, 0, NULL, NULL);
1178 "%d->%d [error=%d]\n", if_name(TCQIF_IFP(tif)),
1179 tcq_style(tif), tif->tif_throttle, tr->level, err);
1186 tcq_resumeq(struct tcq_if *tif, struct tcq_class *cl)
1188 struct ifclassq *ifq = tif->tif_ifq;
1218 tcq_suspendq(struct tcq_if *tif, struct tcq_class *cl)
1220 struct ifclassq *ifq = tif->tif_ifq;