diff options
Diffstat (limited to 'sys/netpfil/ipfw/dn_sched_fq_pie.c')
-rw-r--r-- | sys/netpfil/ipfw/dn_sched_fq_pie.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/sys/netpfil/ipfw/dn_sched_fq_pie.c b/sys/netpfil/ipfw/dn_sched_fq_pie.c index d62becd91435..2f21ca77e33a 100644 --- a/sys/netpfil/ipfw/dn_sched_fq_pie.c +++ b/sys/netpfil/ipfw/dn_sched_fq_pie.c @@ -42,7 +42,6 @@ * and off option is available but it does not work properly in this version. */ - #ifdef _KERNEL #include <sys/malloc.h> #include <sys/socket.h> @@ -120,7 +119,6 @@ struct fq_pie_schk { struct dn_sch_fq_pie_parms cfg; }; - /* fq_pie scheduler instance extra state vars. * The purpose of separation this structure is to preserve number of active * sub-queues and the flows array pointer even after the scheduler instance @@ -143,7 +141,6 @@ struct fq_pie_si { struct fq_pie_si_extra *si_extra; /* extra state vars*/ }; - static struct dn_alg fq_pie_desc; /* Default FQ-PIE parameters including PIE */ @@ -196,7 +193,7 @@ fqpie_sysctl_target_tupdate_maxb_handler(SYSCTL_HANDLER_ARGS) value = fq_pie_sysctl.pcfg.tupdate; else value = fq_pie_sysctl.pcfg.max_burst; - + value = value / AQM_TIME_1US; error = sysctl_handle_long(oidp, &value, 0, req); if (error != 0 || req->newptr == NULL) @@ -204,7 +201,7 @@ fqpie_sysctl_target_tupdate_maxb_handler(SYSCTL_HANDLER_ARGS) if (value < 1 || value > 10 * AQM_TIME_1S) return (EINVAL); value = value * AQM_TIME_1US; - + if (!strcmp(oidp->oid_name,"target")) fq_pie_sysctl.pcfg.qdelay_ref = value; else if (!strcmp(oidp->oid_name,"tupdate")) @@ -242,7 +239,7 @@ static SYSCTL_NODE(_net_inet_ip_dummynet, OID_AUTO, fqpie, "FQ_PIE"); #ifdef SYSCTL_NODE - + SYSCTL_PROC(_net_inet_ip_dummynet_fqpie, OID_AUTO, target, CTLTYPE_LONG | CTLFLAG_RW | CTLFLAG_NEEDGIANT, NULL, 0, fqpie_sysctl_target_tupdate_maxb_handler, "L", @@ -473,7 +470,7 @@ fq_calculate_drop_prob(void *x) } pst->drop_prob = prob; - + /* store current delay value */ pst->qdelay_old = pst->current_qdelay; @@ -514,7 +511,7 @@ fq_activate_pie(struct fq_pie_flow *q) pst->avg_dq_time = 0; pst->sflags = PIE_INMEASUREMENT | PIE_ACTIVE; pst->measurement_start = AQM_UNOW; - + callout_reset_sbt(&pst->aqm_pie_callout, (uint64_t)pprms->tupdate * SBT_1US, 0, fq_calculate_drop_prob, q, 0); @@ -522,7 +519,6 @@ fq_activate_pie(struct fq_pie_flow *q) mtx_unlock(&pst->lock_mtx); } - /* * Deactivate PIE and stop probe update callout */ @@ -580,7 +576,7 @@ fqpie_callout_cleanup(void *x) mtx_unlock(&pst->lock_mtx); mtx_destroy(&pst->lock_mtx); psi_extra = q->psi_extra; - + DN_BH_WLOCK(); psi_extra->nr_active_q--; @@ -629,7 +625,7 @@ pie_dequeue(struct fq_pie_flow *q, struct fq_pie_si *si) /*we extarct packet ts only when Departure Rate Estimation dis not used*/ m = fq_pie_extract_head(q, &pkt_ts, si, !(pprms->flags & PIE_DEPRATEEST_ENABLED)); - + if (!m || !(pst->sflags & PIE_ACTIVE)) return m; @@ -680,7 +676,6 @@ pie_dequeue(struct fq_pie_flow *q, struct fq_pie_si *si) return m; } - /* * Enqueue a packet in q, subject to space and FQ-PIE queue management policy * (whose parameters are in q->fs). @@ -776,7 +771,7 @@ pie_drop_head(struct fq_pie_flow *q, struct fq_pie_si *si) si->main_q.q_time = dn_cfg.curr_time; /* reset accu_prob after packet drop */ q->pst.accu_prob = 0; - + FREE_PKT(m); } @@ -883,11 +878,11 @@ fq_pie_enqueue(struct dn_sch_inst *_si, struct dn_queue *_q, * Note: 'pie_enqueue' function returns 1 only when it unable to * add timestamp to packet (no limit check)*/ drop = pie_enqueue(&flows[idx], m, si); - + /* pie unable to timestamp a packet */ if (drop) return 1; - + /* If the flow (sub-queue) is not active ,then add it to tail of * new flows list, initialize and activate it. */ @@ -997,7 +992,7 @@ fq_pie_dequeue(struct dn_sch_inst *_si) return mbuf; } while (1); - + /* unreachable point */ return NULL; } @@ -1067,7 +1062,6 @@ fq_pie_new_sched(struct dn_sch_inst *_si) return 0; } - /* * Free fq_pie scheduler instance. */ @@ -1099,7 +1093,7 @@ fq_pie_config(struct dn_schk *_schk) struct fq_pie_schk *schk; struct dn_extra_parms *ep; struct dn_sch_fq_pie_parms *fqp_cfg; - + schk = (struct fq_pie_schk *)(_schk+1); ep = (struct dn_extra_parms *) _schk->cfg; @@ -1110,7 +1104,6 @@ fq_pie_config(struct dn_schk *_schk) */ if (ep && ep->oid.len ==sizeof(*ep) && ep->oid.subtype == DN_SCH_PARAMS) { - fqp_cfg = &schk->cfg; if (ep->par[0] < 0) fqp_cfg->pcfg.qdelay_ref = fq_pie_sysctl.pcfg.qdelay_ref; @@ -1185,7 +1178,6 @@ fq_pie_config(struct dn_schk *_schk) */ static int fq_pie_getconfig (struct dn_schk *_schk, struct dn_extra_parms *ep) { - struct fq_pie_schk *schk = (struct fq_pie_schk *)(_schk+1); struct dn_sch_fq_pie_parms *fqp_cfg; @@ -1199,7 +1191,7 @@ fq_pie_getconfig (struct dn_schk *_schk, struct dn_extra_parms *ep) { ep->par[4] = fqp_cfg->pcfg.alpha; ep->par[5] = fqp_cfg->pcfg.beta; ep->par[6] = fqp_cfg->pcfg.flags; - + ep->par[7] = fqp_cfg->quantum; ep->par[8] = fqp_cfg->limit; ep->par[9] = fqp_cfg->flows_cnt; |