Lines Matching +full:100 +full:pa

135 	memcpy(&altq->pa, a, sizeof(struct pf_altq));  in pfaltq_store()
139 item.key = altq->pa.ifname; in pfaltq_store()
153 item.key = altq->pa.qname; in pfaltq_store()
154 item.data = &altq->pa.qid; in pfaltq_store()
247 if (bw->bw_percent < 100) in print_altq()
277 if (bw->bw_percent < 100) in print_queue()
306 eval_pfaltq(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw, in eval_pfaltq() argument
313 pa->ifbandwidth = bw->bw_absolute; in eval_pfaltq()
315 if ((rate = getifspeed(pa->ifname)) == 0) { in eval_pfaltq()
318 pa->ifname); in eval_pfaltq()
320 } else if ((pa->ifbandwidth = eval_bwspec(bw, rate)) == 0) in eval_pfaltq()
321 pa->ifbandwidth = rate; in eval_pfaltq()
326 if ((pa->scheduler != ALTQT_HFSC) && (pa->ifbandwidth > UINT_MAX)) { in eval_pfaltq()
327 pa->ifbandwidth = UINT_MAX; in eval_pfaltq()
329 "because selected scheduler is 32-bit limited\n", pa->ifname, in eval_pfaltq()
330 pa->ifbandwidth); in eval_pfaltq()
332 errors += eval_queue_opts(pa, opts, pa->ifbandwidth); in eval_pfaltq()
335 if (pa->tbrsize == 0) { in eval_pfaltq()
336 rate = pa->ifbandwidth; in eval_pfaltq()
347 size = size * getifmtu(pa->ifname); in eval_pfaltq()
348 pa->tbrsize = size; in eval_pfaltq()
364 switch (if_ppa->pa.scheduler) { in check_commit_altq()
388 eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw, in eval_pfqueue() argument
396 if ((if_ppa = pfaltq_lookup(pa->ifname)) == NULL) { in eval_pfqueue()
397 fprintf(stderr, "altq not defined on %s\n", pa->ifname); in eval_pfqueue()
400 pa->scheduler = if_ppa->pa.scheduler; in eval_pfqueue()
401 pa->ifbandwidth = if_ppa->pa.ifbandwidth; in eval_pfqueue()
403 if (qname_to_pfaltq(pa->qname, pa->ifname) != NULL) { in eval_pfqueue()
405 pa->qname, pa->ifname); in eval_pfqueue()
408 pa->qid = qname_to_qid(pa->qname); in eval_pfqueue()
411 if (pa->parent[0] != 0) { in eval_pfqueue()
412 parent = qname_to_pfaltq(pa->parent, pa->ifname); in eval_pfqueue()
415 pa->parent, pa->qname); in eval_pfqueue()
418 pa->parent_qid = parent->pa.qid; in eval_pfqueue()
420 if (pa->qlimit == 0) in eval_pfqueue()
421 pa->qlimit = DEFAULT_QLIMIT; in eval_pfqueue()
423 if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC || in eval_pfqueue()
424 pa->scheduler == ALTQT_FAIRQ) { in eval_pfqueue()
425 pa->bandwidth = eval_bwspec(bw, in eval_pfqueue()
426 parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth); in eval_pfqueue()
428 if (pa->bandwidth > pa->ifbandwidth) { in eval_pfqueue()
430 "interface\n", pa->qname); in eval_pfqueue()
441 if ((parent != NULL) && (pa->scheduler != ALTQT_HFSC)) { in eval_pfqueue()
442 if (pa->bandwidth > parent->pa.bandwidth) { in eval_pfqueue()
444 pa->qname); in eval_pfqueue()
447 parent->meta.bwsum += pa->bandwidth; in eval_pfqueue()
448 if (parent->meta.bwsum > parent->pa.bandwidth) { in eval_pfqueue()
451 parent->meta.bwsum, parent->pa.qname, in eval_pfqueue()
452 parent->pa.bandwidth); in eval_pfqueue()
457 if (eval_queue_opts(pa, opts, in eval_pfqueue()
458 parent == NULL ? pa->ifbandwidth : parent->pa.bandwidth)) in eval_pfqueue()
464 switch (pa->scheduler) { in eval_pfqueue()
466 error = eval_pfqueue_cbq(pf, pa, if_ppa); in eval_pfqueue()
469 error = eval_pfqueue_priq(pf, pa, if_ppa); in eval_pfqueue()
472 error = eval_pfqueue_hfsc(pf, pa, if_ppa, parent); in eval_pfqueue()
475 error = eval_pfqueue_fairq(pf, pa, if_ppa, parent); in eval_pfqueue()
490 eval_pfqueue_cbq(struct pfctl *pf, struct pf_altq *pa, struct pfctl_altq *if_ppa) in eval_pfqueue_cbq() argument
495 if (pa->priority >= CBQ_MAXPRI) { in eval_pfqueue_cbq()
500 ifmtu = getifmtu(pa->ifname); in eval_pfqueue_cbq()
501 opts = &pa->pq_u.cbq_opts; in eval_pfqueue_cbq()
517 if (pa->parent[0] == 0) in eval_pfqueue_cbq()
520 if (pa->pq_u.cbq_opts.flags & CBQCLF_ROOTCLASS) in eval_pfqueue_cbq()
522 if (pa->pq_u.cbq_opts.flags & CBQCLF_DEFCLASS) in eval_pfqueue_cbq()
525 cbq_compute_idletime(pf, pa); in eval_pfqueue_cbq()
533 cbq_compute_idletime(struct pfctl *pf, struct pf_altq *pa) in cbq_compute_idletime() argument
541 opts = &pa->pq_u.cbq_opts; in cbq_compute_idletime()
542 ifnsPerByte = (1.0 / (double)pa->ifbandwidth) * RM_NS_PER_SEC * 8; in cbq_compute_idletime()
546 if (pa->bandwidth == 0) in cbq_compute_idletime()
549 f = ((double) pa->bandwidth / (double) pa->ifbandwidth); in cbq_compute_idletime()
560 if (pa->bandwidth != 0 && (pf->opts & PF_OPT_QUIET) == 0) { in cbq_compute_idletime()
563 (double)INT_MAX * (double)pa->ifbandwidth)); in cbq_compute_idletime()
565 pa->qname); in cbq_compute_idletime()
626 warnx("should have one root queue on %s", if_ppa->pa.ifname); in check_commit_cbq()
630 warnx("should have one default queue on %s", if_ppa->pa.ifname); in check_commit_cbq()
677 eval_pfqueue_priq(struct pfctl *pf, struct pf_altq *pa, struct pfctl_altq *if_ppa) in eval_pfqueue_priq() argument
680 if (pa->priority >= PRIQ_MAXPRI) { in eval_pfqueue_priq()
684 if (BIT_ISSET(QPRI_BITSET_SIZE, pa->priority, &if_ppa->meta.qpris)) { in eval_pfqueue_priq()
686 pa->qname, pa->ifname); in eval_pfqueue_priq()
689 BIT_SET(QPRI_BITSET_SIZE, pa->priority, &if_ppa->meta.qpris); in eval_pfqueue_priq()
691 if (pa->pq_u.priq_opts.flags & PRCF_DEFAULTCLASS) in eval_pfqueue_priq()
704 warnx("should have one default queue on %s", if_ppa->pa.ifname); in check_commit_priq()
742 eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa, struct pfctl_altq *if_ppa, in eval_pfqueue_hfsc() argument
748 opts = &pa->pq_u.hfsc_opts; in eval_pfqueue_hfsc()
752 opts->lssc_m1 = pa->ifbandwidth; in eval_pfqueue_hfsc()
753 opts->lssc_m2 = pa->ifbandwidth; in eval_pfqueue_hfsc()
764 if (parent->pa.pq_u.hfsc_opts.flags & HFCF_DEFAULTCLASS) { in eval_pfqueue_hfsc()
766 pa->qname, pa->parent); in eval_pfqueue_hfsc()
770 if (pa->pq_u.hfsc_opts.flags & HFCF_DEFAULTCLASS) in eval_pfqueue_hfsc()
775 opts->lssc_m2 = pa->bandwidth; in eval_pfqueue_hfsc()
780 warnx("m2 is zero for %s", pa->qname); in eval_pfqueue_hfsc()
787 warnx("m1 must be zero for convex curve: %s", pa->qname); in eval_pfqueue_hfsc()
813 sc.m2 = pa->ifbandwidth / 100 * 80; in eval_pfqueue_hfsc()
829 sc.m1 = parent->pa.pq_u.hfsc_opts.lssc_m1; in eval_pfqueue_hfsc()
830 sc.d = parent->pa.pq_u.hfsc_opts.lssc_d; in eval_pfqueue_hfsc()
831 sc.m2 = parent->pa.pq_u.hfsc_opts.lssc_m2; in eval_pfqueue_hfsc()
840 if (opts->ulsc_m1 > pa->ifbandwidth || in eval_pfqueue_hfsc()
841 opts->ulsc_m2 > pa->ifbandwidth) { in eval_pfqueue_hfsc()
858 eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa, in eval_pfqueue_fairq() argument
864 opts = &pa->pq_u.fairq_opts; in eval_pfqueue_fairq()
868 opts->lssc_m1 = pa->ifbandwidth; in eval_pfqueue_fairq()
869 opts->lssc_m2 = pa->ifbandwidth; in eval_pfqueue_fairq()
878 if (parent->pa.pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) { in eval_pfqueue_fairq()
880 pa->qname, pa->parent); in eval_pfqueue_fairq()
884 if (pa->pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) in eval_pfqueue_fairq()
889 opts->lssc_m2 = pa->bandwidth; in eval_pfqueue_fairq()
911 sc.m1 = parent->pa.pq_u.fairq_opts.lssc_m1; in eval_pfqueue_fairq()
912 sc.d = parent->pa.pq_u.fairq_opts.lssc_d; in eval_pfqueue_fairq()
913 sc.m2 = parent->pa.pq_u.fairq_opts.lssc_m2; in eval_pfqueue_fairq()
929 warnx("should have one default queue on %s", if_ppa->pa.ifname); in check_commit_hfsc()
941 warnx("should have one default queue on %s", if_ppa->pa.ifname); in check_commit_fairq()
1240 if ((int)(rate * 100) % 100) in rate2str()
1292 eval_queue_opts(struct pf_altq *pa, struct node_queue_opt *opts, in eval_queue_opts() argument
1297 switch (pa->scheduler) { in eval_queue_opts()
1299 pa->pq_u.cbq_opts = opts->data.cbq_opts; in eval_queue_opts()
1302 pa->pq_u.priq_opts = opts->data.priq_opts; in eval_queue_opts()
1305 pa->pq_u.hfsc_opts.flags = opts->data.hfsc_opts.flags; in eval_queue_opts()
1307 pa->pq_u.hfsc_opts.lssc_m1 = in eval_queue_opts()
1310 pa->pq_u.hfsc_opts.lssc_m2 = in eval_queue_opts()
1313 pa->pq_u.hfsc_opts.lssc_d = in eval_queue_opts()
1317 pa->pq_u.hfsc_opts.rtsc_m1 = in eval_queue_opts()
1320 pa->pq_u.hfsc_opts.rtsc_m2 = in eval_queue_opts()
1323 pa->pq_u.hfsc_opts.rtsc_d = in eval_queue_opts()
1327 pa->pq_u.hfsc_opts.ulsc_m1 = in eval_queue_opts()
1330 pa->pq_u.hfsc_opts.ulsc_m2 = in eval_queue_opts()
1333 pa->pq_u.hfsc_opts.ulsc_d = in eval_queue_opts()
1338 pa->pq_u.fairq_opts.flags = opts->data.fairq_opts.flags; in eval_queue_opts()
1339 pa->pq_u.fairq_opts.nbuckets = opts->data.fairq_opts.nbuckets; in eval_queue_opts()
1340 pa->pq_u.fairq_opts.hogs_m1 = in eval_queue_opts()
1344 pa->pq_u.fairq_opts.lssc_m1 = in eval_queue_opts()
1347 pa->pq_u.fairq_opts.lssc_m2 = in eval_queue_opts()
1350 pa->pq_u.fairq_opts.lssc_d = in eval_queue_opts()
1355 pa->pq_u.codel_opts.target = opts->data.codel_opts.target; in eval_queue_opts()
1356 pa->pq_u.codel_opts.interval = opts->data.codel_opts.interval; in eval_queue_opts()
1357 pa->pq_u.codel_opts.ecn = opts->data.codel_opts.ecn; in eval_queue_opts()
1386 return (ref_bw / 100 * bw->bw_percent); in eval_bwspec()