Lines Matching +full:avg +full:- +full:samples

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
98 int plr[4] ; /* pkt loss rate (2^31-1 means 100%) */
119 u_int c_1 ; /* max_p/(max_th-min_th) (scaled) */
120 u_int c_2 ; /* max_p*min_th/(max_th-min_th) (scaled) */
121 u_int c_3 ; /* for GRED, (1-max_p)/max_th (scaled) */
122 u_int c_4 ; /* for GRED, 1 - 2*max_p (scaled) */
123 u_int * w_q_lookup ; /* lookup table for computing (1-w_q)^t */
126 int lookup_weight ; /* equal to (1-w_q)^t / (1-w_q)^(t+1) */
151 int avg ; /* average queue length est. (scaled) */ member
174 struct dn_heap7 scheduler_heap ; /* top extract - key Finish time*/
175 struct dn_heap7 not_eligible_heap; /* top extract- key Start time */
176 struct dn_heap7 idle_heap ; /* random extract - key Start=Finish time */
193 struct dn_flow_set fs ; /* used with fixed-rate flows */
216 int avg ; /* average queue length est. (scaled) */ member
239 struct dn_heap7 scheduler_heap ; /* top extract - key Finish time*/
240 struct dn_heap7 not_eligible_heap; /* top extract- key Start time */
241 struct dn_heap7 idle_heap ; /* random extract - key Start=Finish time */
257 struct dn_flow_set fs ; /* used with fixed-rate flows */
264 int *samples; member
270 int samples[ED_MAX_SAMPLES_NO]; member
298 oid->len = len; in oid_fill()
299 oid->type = type; in oid_fill()
300 oid->subtype = 0; in oid_fill()
301 oid->id = id; in oid_fill()
320 * -1: unknown (for now is unused)
384 if (p->pipe_nr == 0 && p->fs.fs_nr == 0) in dn_compat_del()
386 if (p->pipe_nr != 0 && p->fs.fs_nr != 0) in dn_compat_del()
389 if (p8->pipe_nr == 0 && p8->fs.fs_nr == 0) in dn_compat_del()
391 if (p8->pipe_nr != 0 && p8->fs.fs_nr != 0) in dn_compat_del()
395 if (p->pipe_nr != 0) { /* pipe x delete */ in dn_compat_del()
396 cmd.a[0] = p->pipe_nr; in dn_compat_del()
400 cmd.a[0] = (is7) ? p->fs.fs_nr : p8->fs.fs_nr; in dn_compat_del()
414 f = &p7->fs; in dn_compat_config_queue()
416 f = &p8->fs; in dn_compat_config_queue()
418 fs->fs_nr = f->fs_nr; in dn_compat_config_queue()
419 fs->sched_nr = f->parent_nr; in dn_compat_config_queue()
420 fs->flow_mask = f->flow_mask; in dn_compat_config_queue()
421 fs->buckets = f->rq_size; in dn_compat_config_queue()
422 fs->qsize = f->qsize; in dn_compat_config_queue()
423 fs->plr[0] = f->plr[0]; in dn_compat_config_queue()
424 fs->plr[1] = f->plr[1]; in dn_compat_config_queue()
425 fs->plr[2] = f->plr[2]; in dn_compat_config_queue()
426 fs->plr[3] = f->plr[3]; in dn_compat_config_queue()
427 fs->par[0] = f->weight; in dn_compat_config_queue()
428 fs->flags = convertflags2new(f->flags_fs); in dn_compat_config_queue()
429 if (fs->flags & DN_IS_GENTLE_RED || fs->flags & DN_IS_RED) { in dn_compat_config_queue()
430 fs->w_q = f->w_q; in dn_compat_config_queue()
431 fs->max_th = f->max_th; in dn_compat_config_queue()
432 fs->min_th = f->min_th; in dn_compat_config_queue()
433 fs->max_p = f->max_p; in dn_compat_config_queue()
445 int i = p7->pipe_nr; in dn_compat_config_pipe()
447 sch->sched_nr = i; in dn_compat_config_pipe()
448 sch->oid.subtype = 0; in dn_compat_config_pipe()
449 p->link_nr = i; in dn_compat_config_pipe()
450 fs->fs_nr = i + 2*DN_MAX_ID; in dn_compat_config_pipe()
451 fs->sched_nr = i + DN_MAX_ID; in dn_compat_config_pipe()
454 p->bandwidth = p7->bandwidth; in dn_compat_config_pipe()
455 p->delay = p7->delay; in dn_compat_config_pipe()
458 p->burst = p8->burst; in dn_compat_config_pipe()
463 fs->fs_nr = i + 2*DN_MAX_ID; in dn_compat_config_pipe()
464 fs->sched_nr = i + DN_MAX_ID; in dn_compat_config_pipe()
467 sch->buckets = fs->buckets; /*XXX*/ in dn_compat_config_pipe()
468 fs->buckets = 0; in dn_compat_config_pipe()
469 if (fs->flags & DN_HAVE_MASK) { in dn_compat_config_pipe()
470 sch->flags |= DN_HAVE_MASK; in dn_compat_config_pipe()
471 fs->flags &= ~DN_HAVE_MASK; in dn_compat_config_pipe()
472 sch->sched_mask = fs->flow_mask; in dn_compat_config_pipe()
473 bzero(&fs->flow_mask, sizeof(struct ipfw_flow_id)); in dn_compat_config_pipe()
485 p8->samples = &(((struct dn_pipe_max8 *)p8)->samples[0]); in dn_compat_config_profile()
487 pf->link_nr = p->link_nr; in dn_compat_config_profile()
488 pf->loss_level = p8->loss_level; in dn_compat_config_profile()
489 // pf->bandwidth = p->bandwidth; //XXX bandwidth redundant? in dn_compat_config_profile()
490 pf->samples_no = p8->samples_no; in dn_compat_config_profile()
491 strncpy(pf->name, p8->name,sizeof(pf->name)); in dn_compat_config_profile()
492 bcopy(p8->samples, pf->samples, sizeof(pf->samples)); in dn_compat_config_profile()
498 * If p->pipe_nr != 0 the command is 'pipe x config', so need to create
523 base->id = DN_API_VERSION; in dn_compat_configure()
526 i = p7->pipe_nr; in dn_compat_configure()
537 if (!is7 && p8->samples_no > 0) { in dn_compat_configure()
554 error = do_config(base, (char *)buf - (char *)base); in dn_compat_configure()
567 * - half scheduler: schk_count/2 in dn_compat_calc_size()
568 * - all flowset: fsk_count in dn_compat_calc_size()
569 * - all flowset queues: queue_count in dn_compat_calc_size()
570 * - all pipe queue: si_count in dn_compat_calc_size()
584 struct dn_flow_queue7 *fq7 = (struct dn_flow_queue7 *)*a->start; in dn_c_copy_q()
585 struct dn_flow_queue8 *fq8 = (struct dn_flow_queue8 *)*a->start; in dn_c_copy_q()
591 fq7->len = ni->length; in dn_c_copy_q()
592 fq7->len_bytes = ni->len_bytes; in dn_c_copy_q()
593 fq7->id = ni->fid; in dn_c_copy_q()
597 fq7->tot_pkts = ni->tot_pkts; in dn_c_copy_q()
598 fq7->tot_bytes = ni->tot_bytes; in dn_c_copy_q()
599 fq7->drops = ni->drops; in dn_c_copy_q()
602 fq8->tot_pkts = ni->tot_pkts; in dn_c_copy_q()
603 fq8->tot_bytes = ni->tot_bytes; in dn_c_copy_q()
604 fq8->drops = ni->drops; in dn_c_copy_q()
607 *a->start += size; in dn_c_copy_q()
614 struct dn_link *l = &s->link; in dn_c_copy_pipe()
615 struct dn_fsk *f = s->fs; in dn_c_copy_pipe()
617 struct dn_pipe7 *pipe7 = (struct dn_pipe7 *)*a->start; in dn_c_copy_pipe()
618 struct dn_pipe8 *pipe8 = (struct dn_pipe8 *)*a->start; in dn_c_copy_pipe()
623 fs = &pipe7->fs; in dn_c_copy_pipe()
626 fs = &pipe8->fs; in dn_c_copy_pipe()
631 pipe7->next.sle_next = (struct dn_pipe7 *)DN_IS_PIPE; in dn_c_copy_pipe()
632 pipe7->bandwidth = l->bandwidth; in dn_c_copy_pipe()
633 pipe7->delay = l->delay * 1000 / hz; in dn_c_copy_pipe()
634 pipe7->pipe_nr = l->link_nr - DN_MAX_ID; in dn_c_copy_pipe()
637 if (s->profile) { in dn_c_copy_pipe()
638 struct dn_profile *pf = s->profile; in dn_c_copy_pipe()
639 strncpy(pipe8->name, pf->name, sizeof(pf->name)); in dn_c_copy_pipe()
640 pipe8->loss_level = pf->loss_level; in dn_c_copy_pipe()
641 pipe8->samples_no = pf->samples_no; in dn_c_copy_pipe()
643 pipe8->burst = div64(l->burst , 8 * hz); in dn_c_copy_pipe()
646 fs->flow_mask = s->sch.sched_mask; in dn_c_copy_pipe()
647 fs->rq_size = s->sch.buckets ? s->sch.buckets : 1; in dn_c_copy_pipe()
649 fs->parent_nr = l->link_nr - DN_MAX_ID; in dn_c_copy_pipe()
650 fs->qsize = f->fs.qsize; in dn_c_copy_pipe()
651 fs->plr[0] = f->fs.plr[0]; in dn_c_copy_pipe()
652 fs->plr[1] = f->fs.plr[1]; in dn_c_copy_pipe()
653 fs->plr[2] = f->fs.plr[2]; in dn_c_copy_pipe()
654 fs->plr[3] = f->fs.plr[3]; in dn_c_copy_pipe()
655 fs->w_q = f->fs.w_q; in dn_c_copy_pipe()
656 fs->max_th = f->max_th; in dn_c_copy_pipe()
657 fs->min_th = f->min_th; in dn_c_copy_pipe()
658 fs->max_p = f->fs.max_p; in dn_c_copy_pipe()
659 fs->rq_elements = nq; in dn_c_copy_pipe()
661 fs->flags_fs = convertflags2old(f->fs.flags); in dn_c_copy_pipe()
663 *a->start += size; in dn_c_copy_pipe()
670 int have = a->end - *a->start; in dn_compat_copy_pipe()
678 * - struct dn_pipe in dn_compat_copy_pipe()
679 * - if there are instances, dn_queue * n_instances in dn_compat_copy_pipe()
681 n_queue = (s->sch.flags & DN_HAVE_MASK ? dn_ht_entries(s->siht) : in dn_compat_copy_pipe()
682 (s->siht ? 1 : 0)); in dn_compat_copy_pipe()
692 if (s->sch.flags & DN_HAVE_MASK) in dn_compat_copy_pipe()
693 dn_ht_scan(s->siht, dn_c_copy_q, a); in dn_compat_copy_pipe()
694 else if (s->siht) in dn_compat_copy_pipe()
695 dn_c_copy_q(s->siht, a); in dn_compat_copy_pipe()
702 struct dn_flow_set *fs = (struct dn_flow_set *)*a->start; in dn_c_copy_fs()
704 fs->next.sle_next = (struct dn_flow_set *)DN_IS_QUEUE; in dn_c_copy_fs()
705 fs->fs_nr = f->fs.fs_nr; in dn_c_copy_fs()
706 fs->qsize = f->fs.qsize; in dn_c_copy_fs()
707 fs->plr[0] = f->fs.plr[0]; in dn_c_copy_fs()
708 fs->plr[1] = f->fs.plr[1]; in dn_c_copy_fs()
709 fs->plr[2] = f->fs.plr[2]; in dn_c_copy_fs()
710 fs->plr[3] = f->fs.plr[3]; in dn_c_copy_fs()
711 fs->w_q = f->fs.w_q; in dn_c_copy_fs()
712 fs->max_th = f->max_th; in dn_c_copy_fs()
713 fs->min_th = f->min_th; in dn_c_copy_fs()
714 fs->max_p = f->fs.max_p; in dn_c_copy_fs()
715 fs->flow_mask = f->fs.flow_mask; in dn_c_copy_fs()
716 fs->rq_elements = nq; in dn_c_copy_fs()
717 fs->rq_size = (f->fs.buckets ? f->fs.buckets : 1); in dn_c_copy_fs()
718 fs->parent_nr = f->fs.sched_nr; in dn_c_copy_fs()
719 fs->weight = f->fs.par[0]; in dn_c_copy_fs()
721 fs->flags_fs = convertflags2old(f->fs.flags); in dn_c_copy_fs()
722 *a->start += sizeof(struct dn_flow_set); in dn_c_copy_fs()
729 int have = a->end - *a->start; in dn_compat_copy_queue()
737 n_queue = (fs->fs.flags & DN_HAVE_MASK ? dn_ht_entries(fs->qht) : in dn_compat_copy_queue()
738 (fs->qht ? 1 : 0)); in dn_compat_copy_queue()
750 if (fs->fs.flags & DN_HAVE_MASK) in dn_compat_copy_queue()
751 dn_ht_scan(fs->qht, dn_c_copy_q, a); in dn_compat_copy_queue()
752 else if (fs->qht) in dn_compat_copy_queue()
753 dn_c_copy_q(fs->qht, a); in dn_compat_copy_queue()
763 if (a->type == DN_COMPAT_PIPE) { in copy_data_helper_compat()
765 if (s->sch.oid.subtype != 1 || s->sch.sched_nr <= DN_MAX_ID) { in copy_data_helper_compat()
773 } else if (a->type == DN_COMPAT_QUEUE) { in copy_data_helper_compat()
775 if (fs->fs.fs_nr >= DN_MAX_ID) in copy_data_helper_compat()
792 int len = sopt->sopt_valsize; in ip_dummynet_compat()
804 switch (sopt->sopt_name) { in ip_dummynet_compat()
806 printf("dummynet: -- unknown option %d", sopt->sopt_name); in ip_dummynet_compat()
840 int original_size = sopt->sopt_valsize; in ip_dummynet_compat()
846 size = sopt->sopt_valsize; in ip_dummynet_compat()
847 sopt->sopt_valsize = original_size; in ip_dummynet_compat()