Lines Matching defs:avg
284 * to be compared with avg.
329 int avg, droptype;
332 avg = rp->red_avg;
347 * being idle for more than 1 minute, set avg to zero.
350 avg = 0;
355 /* the following line does (avg = (1 - Wq)^n * avg) */
357 avg = (avg >> FP_SHIFT) *
362 /* run estimator. (note: avg is scaled by WEIGHT in fixed-point) */
363 avg += (qlen(q) << FP_SHIFT) - (avg >> rp->red_wshift);
364 rp->red_avg = avg; /* save the new value */
374 if (avg >= rp->red_thmin_s && qlen(q) > 1) {
375 if (avg >= rp->red_thmax_s) {
376 /* avg >= th_max: forced drop */
382 } else if (drop_early((avg - rp->red_thmin_s) >> rp->red_wshift,
397 /* avg < th_min */
438 * prob = p_max * (avg - th_min) / (th_max - th_min)
440 * = (avg-th_min) / (2*(th_max-th_min)*inv_p_max - count*(avg-th_min))
458 * drop probability = (avg - TH_MIN) / d
530 * helper routine to calibrate avg during idle.