Lines Matching refs:vars

26 	struct pie_vars vars;  member
34 struct pie_vars *vars, u32 backlog, u32 packet_size) in pie_drop_early() argument
37 u64 local_prob = vars->prob; in pie_drop_early()
41 if (vars->burst_time > 0) in pie_drop_early()
47 if ((vars->qdelay < params->target / 2) && in pie_drop_early()
48 (vars->prob < MAX_PROB / 5)) in pie_drop_early()
63 local_prob = vars->prob; in pie_drop_early()
66 vars->accu_prob = 0; in pie_drop_early()
68 vars->accu_prob += local_prob; in pie_drop_early()
70 if (vars->accu_prob < (MAX_PROB / 100) * 85) in pie_drop_early()
72 if (vars->accu_prob >= (MAX_PROB / 2) * 17) in pie_drop_early()
77 vars->accu_prob = 0; in pie_drop_early()
96 if (!pie_drop_early(sch, &q->params, &q->vars, sch->qstats.backlog, in pie_qdisc_enqueue()
99 } else if (q->params.ecn && (q->vars.prob <= MAX_PROB / 10) && in pie_qdisc_enqueue()
123 q->vars.accu_prob = 0; in pie_qdisc_enqueue()
206 struct pie_vars *vars, u32 backlog) in pie_process_dequeue() argument
215 vars->qdelay = now - pie_get_enqueue_time(skb); in pie_process_dequeue()
217 if (vars->dq_tstamp != DTIME_INVALID) in pie_process_dequeue()
218 dtime = now - vars->dq_tstamp; in pie_process_dequeue()
220 vars->dq_tstamp = now; in pie_process_dequeue()
223 vars->qdelay = 0; in pie_process_dequeue()
235 if (backlog >= QUEUE_THRESHOLD && vars->dq_count == DQCOUNT_INVALID) { in pie_process_dequeue()
236 vars->dq_tstamp = psched_get_time(); in pie_process_dequeue()
237 vars->dq_count = 0; in pie_process_dequeue()
249 if (vars->dq_count != DQCOUNT_INVALID) { in pie_process_dequeue()
250 vars->dq_count += skb->len; in pie_process_dequeue()
252 if (vars->dq_count >= QUEUE_THRESHOLD) { in pie_process_dequeue()
253 u32 count = vars->dq_count << PIE_SCALE; in pie_process_dequeue()
255 dtime = now - vars->dq_tstamp; in pie_process_dequeue()
262 if (vars->avg_dq_rate == 0) in pie_process_dequeue()
263 vars->avg_dq_rate = count; in pie_process_dequeue()
265 vars->avg_dq_rate = in pie_process_dequeue()
266 (vars->avg_dq_rate - in pie_process_dequeue()
267 (vars->avg_dq_rate >> 3)) + (count >> 3); in pie_process_dequeue()
275 vars->dq_count = DQCOUNT_INVALID; in pie_process_dequeue()
277 vars->dq_count = 0; in pie_process_dequeue()
278 vars->dq_tstamp = psched_get_time(); in pie_process_dequeue()
288 if (vars->burst_time > 0) { in pie_process_dequeue()
289 if (vars->burst_time > dtime) in pie_process_dequeue()
290 vars->burst_time -= dtime; in pie_process_dequeue()
292 vars->burst_time = 0; in pie_process_dequeue()
297 void pie_calculate_probability(struct pie_params *params, struct pie_vars *vars, in pie_calculate_probability() argument
309 qdelay_old = vars->qdelay; in pie_calculate_probability()
310 vars->qdelay_old = vars->qdelay; in pie_calculate_probability()
312 if (vars->avg_dq_rate > 0) in pie_calculate_probability()
313 qdelay = (backlog << PIE_SCALE) / vars->avg_dq_rate; in pie_calculate_probability()
317 qdelay = vars->qdelay; in pie_calculate_probability()
318 qdelay_old = vars->qdelay_old; in pie_calculate_probability()
340 if (vars->prob < MAX_PROB / 10) { in pie_calculate_probability()
345 while (vars->prob < div_u64(MAX_PROB, power) && in pie_calculate_probability()
357 oldprob = vars->prob; in pie_calculate_probability()
361 vars->prob >= MAX_PROB / 10) in pie_calculate_probability()
372 vars->prob += delta; in pie_calculate_probability()
376 if (vars->prob < oldprob) { in pie_calculate_probability()
377 vars->prob = MAX_PROB; in pie_calculate_probability()
387 if (vars->prob > oldprob) in pie_calculate_probability()
388 vars->prob = 0; in pie_calculate_probability()
397 vars->prob -= vars->prob / 64; in pie_calculate_probability()
399 vars->qdelay = qdelay; in pie_calculate_probability()
400 vars->backlog_old = backlog; in pie_calculate_probability()
408 if ((vars->qdelay < params->target / 2) && in pie_calculate_probability()
409 (vars->qdelay_old < params->target / 2) && in pie_calculate_probability()
410 vars->prob == 0 && in pie_calculate_probability()
411 (!params->dq_rate_estimator || vars->avg_dq_rate > 0)) { in pie_calculate_probability()
412 pie_vars_init(vars); in pie_calculate_probability()
416 vars->qdelay_old = qdelay; in pie_calculate_probability()
429 pie_calculate_probability(&q->params, &q->vars, sch->qstats.backlog); in pie_timer()
444 pie_vars_init(&q->vars); in pie_init()
496 .prob = q->vars.prob << BITS_PER_BYTE, in pie_dump_stats()
497 .delay = ((u32)PSCHED_TICKS2NS(q->vars.qdelay)) / in pie_dump_stats()
511 st.avg_dq_rate = q->vars.avg_dq_rate * in pie_dump_stats()
525 pie_process_dequeue(skb, &q->params, &q->vars, sch->qstats.backlog); in pie_qdisc_dequeue()
534 pie_vars_init(&q->vars); in pie_reset()