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

Lines Matching defs:cl

175 	struct tcq_class	*cl;
182 if ((cl = tif->tif_classes[pri]) != NULL)
183 tcq_class_destroy(tif, cl);
192 struct tcq_class *cl;
198 if ((cl = tif->tif_classes[pri]) != NULL && !qempty(&cl->cl_q))
199 tcq_purgeq(tif, cl, 0, NULL, NULL);
227 tcq_purgeq(tif, ifq->ifcq_disc_slots[i].cl,
236 tcq_purgeq(tif, ifq->ifcq_disc_slots[i].cl,
247 struct tcq_class *cl;
253 if ((cl = tif->tif_classes[pri]) != NULL)
254 tcq_updateq(tif, cl, ev);
261 struct tcq_class *cl;
273 cl = tcq_class_create(tif, priority, qlimit, flags, qid);
274 if (cl == NULL)
278 *clp = cl;
289 struct tcq_class *cl;
335 if ((cl = tif->tif_classes[pri]) != NULL) {
337 if (!qempty(&cl->cl_q))
338 tcq_purgeq(tif, cl, 0, NULL, NULL);
340 if (q_is_rio(&cl->cl_q))
341 rio_destroy(cl->cl_rio);
344 if (q_is_red(&cl->cl_q))
345 red_destroy(cl->cl_red);
348 if (q_is_blue(&cl->cl_q))
349 blue_destroy(cl->cl_blue);
351 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
352 sfb_destroy(cl->cl_sfb);
353 cl->cl_qalg.ptr = NULL;
354 qtype(&cl->cl_q) = Q_DROPTAIL;
355 qstate(&cl->cl_q) = QS_RUNNING;
357 cl = zalloc(tcq_cl_zone);
358 if (cl == NULL)
361 bzero(cl, tcq_cl_size);
364 tif->tif_classes[pri] = cl;
366 tif->tif_default = cl;
372 _qinit(&cl->cl_q, Q_DROPTAIL, qlimit);
373 cl->cl_flags = flags;
374 cl->cl_pri = pri;
377 cl->cl_tif = tif;
378 cl->cl_handle = qid;
386 cl->cl_qflags = 0;
389 cl->cl_qflags |= BLUEF_ECN;
391 cl->cl_qflags |= SFBF_ECN;
393 cl->cl_qflags |= REDF_ECN;
395 cl->cl_qflags |= RIOF_ECN;
399 cl->cl_qflags |= SFBF_FLOWCTL;
403 cl->cl_qflags |= SFBF_DELAYBASED;
407 cl->cl_qflags |= RIOF_CLEARDSCP;
423 cl->cl_red = red_alloc(ifp, 0, 0,
424 qlimit(&cl->cl_q) * 10/100,
425 qlimit(&cl->cl_q) * 30/100,
426 cl->cl_qflags, pkttime);
427 if (cl->cl_red != NULL)
428 qtype(&cl->cl_q) = Q_RED;
433 cl->cl_rio =
434 rio_alloc(ifp, 0, NULL, cl->cl_qflags, pkttime);
435 if (cl->cl_rio != NULL)
436 qtype(&cl->cl_q) = Q_RIO;
442 cl->cl_blue = blue_alloc(ifp, 0, 0, cl->cl_qflags);
443 if (cl->cl_blue != NULL)
444 qtype(&cl->cl_q) = Q_BLUE;
448 if (!(cl->cl_flags & TQCF_LAZY))
449 cl->cl_sfb = sfb_alloc(ifp, cl->cl_handle,
450 qlimit(&cl->cl_q), cl->cl_qflags);
451 if (cl->cl_sfb != NULL || (cl->cl_flags & TQCF_LAZY))
452 qtype(&cl->cl_q) = Q_SFB;
459 cl->cl_handle, cl->cl_pri, qlimit, flags, TQCF_BITS);
462 return (cl);
468 struct tcq_class *cl;
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)
486 if (!qempty(&cl->cl_q))
487 tcq_purgeq(tif, cl, 0, NULL, NULL);
489 tif->tif_classes[cl->cl_pri] = NULL;
490 if (tif->tif_maxpri == cl->cl_pri) {
491 for (pri = cl->cl_pri; pri >= 0; pri--)
500 if (tif->tif_default == cl)
503 if (cl->cl_qalg.ptr != NULL) {
505 if (q_is_rio(&cl->cl_q))
506 rio_destroy(cl->cl_rio);
509 if (q_is_red(&cl->cl_q))
510 red_destroy(cl->cl_red);
513 if (q_is_blue(&cl->cl_q))
514 blue_destroy(cl->cl_blue);
516 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
517 sfb_destroy(cl->cl_sfb);
518 cl->cl_qalg.ptr = NULL;
519 qtype(&cl->cl_q) = Q_DROPTAIL;
520 qstate(&cl->cl_q) = QS_RUNNING;
526 cl->cl_handle, cl->cl_pri);
529 zfree(tcq_cl_zone, cl);
534 tcq_enqueue(struct tcq_if *tif, struct tcq_class *cl, struct mbuf *m,
541 VERIFY(cl == NULL || cl->cl_tif == tif);
543 if (cl == NULL) {
545 cl = tcq_clh_to_clp(tif, t->pftag_qid);
547 cl = tcq_clh_to_clp(tif, 0);
549 if (cl == NULL) {
550 cl = tif->tif_default;
551 if (cl == NULL) {
561 ret = tcq_addq(cl, m, t);
571 PKTCNTR_ADD(&cl->cl_dropcnt, 1, len);
603 tcq_dequeue_cl(struct tcq_if *tif, struct tcq_class *cl,
611 if (cl == NULL) {
612 cl = tcq_clh_to_clp(tif, MBUF_SCIDX(sc));
613 if (cl == NULL)
617 if (qempty(&cl->cl_q))
623 return (tcq_pollq(cl));
625 m = tcq_getq(cl);
628 if (qempty(&cl->cl_q))
629 cl->cl_period++;
630 PKTCNTR_ADD(&cl->cl_xmitcnt, 1, m_pktlen(m));
637 tcq_addq(struct tcq_class *cl, struct mbuf *m, struct pf_mtag *t)
639 struct tcq_if *tif = cl->cl_tif;
645 if (q_is_rio(&cl->cl_q))
646 return (rio_addq(cl->cl_rio, &cl->cl_q, m, t));
650 if (q_is_red(&cl->cl_q))
651 return (red_addq(cl->cl_red, &cl->cl_q, m, t));
655 if (q_is_blue(&cl->cl_q))
656 return (blue_addq(cl->cl_blue, &cl->cl_q, m, t));
659 if (q_is_sfb(&cl->cl_q)) {
660 if (cl->cl_sfb == NULL) {
663 VERIFY(cl->cl_flags & TQCF_LAZY);
664 cl->cl_flags &= ~TQCF_LAZY;
667 cl->cl_sfb = sfb_alloc(ifp, cl->cl_handle,
668 qlimit(&cl->cl_q), cl->cl_qflags);
669 if (cl->cl_sfb == NULL) {
671 qtype(&cl->cl_q) = Q_DROPTAIL;
672 cl->cl_flags &= ~TQCF_SFB;
673 cl->cl_qflags &= ~(SFBF_ECN | SFBF_FLOWCTL);
678 tcq_style(tif), cl->cl_handle,
679 cl->cl_pri);
693 if (cl->cl_sfb != NULL)
694 return (sfb_addq(cl->cl_sfb, &cl->cl_q, m, t));
695 } else if (qlen(&cl->cl_q) >= qlimit(&cl->cl_q)) {
702 if (cl->cl_flags & TQCF_CLEARDSCP)
706 _addq(&cl->cl_q, m);
712 tcq_getq(struct tcq_class *cl)
714 IFCQ_LOCK_ASSERT_HELD(cl->cl_tif->tif_ifq);
717 if (q_is_rio(&cl->cl_q))
718 return (rio_getq(cl->cl_rio, &cl->cl_q));
722 if (q_is_red(&cl->cl_q))
723 return (red_getq(cl->cl_red, &cl->cl_q));
727 if (q_is_blue(&cl->cl_q))
728 return (blue_getq(cl->cl_blue, &cl->cl_q));
731 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
732 return (sfb_getq(cl->cl_sfb, &cl->cl_q));
734 return (_getq(&cl->cl_q));
738 tcq_pollq(struct tcq_class *cl)
740 IFCQ_LOCK_ASSERT_HELD(cl->cl_tif->tif_ifq);
742 return (qhead(&cl->cl_q));
746 tcq_purgeq(struct tcq_if *tif, struct tcq_class *cl, u_int32_t flow,
754 if ((qlen = qlen(&cl->cl_q)) == 0)
761 if (q_is_rio(&cl->cl_q))
762 rio_purgeq(cl->cl_rio, &cl->cl_q, flow, &cnt, &len);
766 if (q_is_red(&cl->cl_q))
767 red_purgeq(cl->cl_red, &cl->cl_q, flow, &cnt, &len);
771 if (q_is_blue(&cl->cl_q))
772 blue_purgeq(cl->cl_blue, &cl->cl_q, flow, &cnt, &len);
775 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
776 sfb_purgeq(cl->cl_sfb, &cl->cl_q, flow, &cnt, &len);
778 _flushq_flow(&cl->cl_q, flow, &cnt, &len);
781 VERIFY(qlen(&cl->cl_q) == (qlen - cnt));
783 PKTCNTR_ADD(&cl->cl_dropcnt, cnt, len);
793 cl->cl_handle, cl->cl_pri, qlen, qlen(&cl->cl_q),
805 tcq_updateq(struct tcq_if *tif, struct tcq_class *cl, cqev_t ev)
812 cl->cl_handle, cl->cl_pri, ifclassq_ev2str(ev));
816 if (q_is_rio(&cl->cl_q))
817 return (rio_updateq(cl->cl_rio, ev));
820 if (q_is_red(&cl->cl_q))
821 return (red_updateq(cl->cl_red, ev));
824 if (q_is_blue(&cl->cl_q))
825 return (blue_updateq(cl->cl_blue, ev));
827 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
828 return (sfb_updateq(cl->cl_sfb, ev));
835 struct tcq_class *cl;
839 if ((cl = tcq_clh_to_clp(tif, qid)) == NULL)
842 sp->class_handle = cl->cl_handle;
843 sp->priority = cl->cl_pri;
844 sp->qlength = qlen(&cl->cl_q);
845 sp->qlimit = qlimit(&cl->cl_q);
846 sp->period = cl->cl_period;
847 sp->xmitcnt = cl->cl_xmitcnt;
848 sp->dropcnt = cl->cl_dropcnt;
850 sp->qtype = qtype(&cl->cl_q);
851 sp->qstate = qstate(&cl->cl_q);
853 if (q_is_red(&cl->cl_q))
854 red_getstats(cl->cl_red, &sp->red[0]);
857 if (q_is_rio(&cl->cl_q))
858 rio_getstats(cl->cl_rio, &sp->red[0]);
861 if (q_is_blue(&cl->cl_q))
862 blue_getstats(cl->cl_blue, &sp->blue);
864 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
865 sfb_getstats(cl->cl_sfb, &sp->sfb);
874 struct tcq_class *cl;
884 cl = ifq->ifcq_disc_slots[i].cl;
885 sr->packets = qlen(&cl->cl_q);
886 sr->bytes = qsize(&cl->cl_q);
895 struct tcq_class *cl;
901 if ((cl = tif->tif_classes[idx]) != NULL &&
902 cl->cl_handle == chandle)
903 return (cl);
938 ifq->ifcq_disc_slots[i].cl, m, m_pftag(m)));
959 ifq->ifcq_disc_slots[i].cl, sc, op));
1053 ifq->ifcq_disc_slots[SCIDX_BK_SYS].cl = cl0;
1056 ifq->ifcq_disc_slots[SCIDX_BK].cl = cl0;
1060 ifq->ifcq_disc_slots[SCIDX_BE].cl = cl1;
1063 ifq->ifcq_disc_slots[SCIDX_RD].cl = cl1;
1066 ifq->ifcq_disc_slots[SCIDX_OAM].cl = cl1;
1070 ifq->ifcq_disc_slots[SCIDX_AV].cl = cl2;
1073 ifq->ifcq_disc_slots[SCIDX_RV].cl = cl2;
1076 ifq->ifcq_disc_slots[SCIDX_VI].cl = cl2;
1080 ifq->ifcq_disc_slots[SCIDX_VO].cl = cl3;
1083 ifq->ifcq_disc_slots[SCIDX_CTL].cl = cl3;
1107 ifq->ifcq_disc_slots[i].cl = NULL;
1133 struct tcq_class *cl;
1148 cl = ifq->ifcq_disc_slots[SCIDX_BK_SYS].cl;
1152 err = tcq_resumeq(tif, cl);
1156 err = tcq_suspendq(tif, cl);
1175 tcq_purgeq(tif, cl, 0, NULL, NULL);
1186 tcq_resumeq(struct tcq_if *tif, struct tcq_class *cl)
1194 if (q_is_rio(&cl->cl_q))
1195 err = rio_suspendq(cl->cl_rio, &cl->cl_q, FALSE);
1199 if (q_is_red(&cl->cl_q))
1200 err = red_suspendq(cl->cl_red, &cl->cl_q, FALSE);
1204 if (q_is_blue(&cl->cl_q))
1205 err = blue_suspendq(cl->cl_blue, &cl->cl_q, FALSE);
1208 if (q_is_sfb(&cl->cl_q) && cl->cl_sfb != NULL)
1209 err = sfb_suspendq(cl->cl_sfb, &cl->cl_q, FALSE);
1212 qstate(&cl->cl_q) = QS_RUNNING;
1218 tcq_suspendq(struct tcq_if *tif, struct tcq_class *cl)
1226 if (q_is_rio(&cl->cl_q))
1227 err = rio_suspendq(cl->cl_rio, &cl->cl_q, TRUE);
1231 if (q_is_red(&cl->cl_q))
1232 err = red_suspendq(cl->cl_red, &cl->cl_q, TRUE);
1236 if (q_is_blue(&cl->cl_q))
1237 err = blue_suspendq(cl->cl_blue, &cl->cl_q, TRUE);
1240 if (q_is_sfb(&cl->cl_q)) {
1241 if (cl->cl_sfb != NULL) {
1242 err = sfb_suspendq(cl->cl_sfb, &cl->cl_q, TRUE);
1244 VERIFY(cl->cl_flags & TQCF_LAZY);
1250 qstate(&cl->cl_q) = QS_SUSPENDED;