• Home
  • Raw
  • Download

Lines Matching refs:p

169 static inline void red_set_parms(struct red_parms *p,  in red_set_parms()  argument
176 p->qth_min = qth_min << Wlog; in red_set_parms()
177 p->qth_max = qth_max << Wlog; in red_set_parms()
178 p->Wlog = Wlog; in red_set_parms()
179 p->Plog = Plog; in red_set_parms()
182 p->qth_delta = delta; in red_set_parms()
187 p->max_P = max_P; in red_set_parms()
190 p->max_P_reciprocal = reciprocal_value(max_p_delta); in red_set_parms()
197 p->target_min = qth_min + 2*delta; in red_set_parms()
198 p->target_max = qth_min + 3*delta; in red_set_parms()
200 p->Scell_log = Scell_log; in red_set_parms()
201 p->Scell_max = (255 << Scell_log); in red_set_parms()
204 memcpy(p->Stab, stab, sizeof(p->Stab)); in red_set_parms()
229 static inline unsigned long red_calc_qavg_from_idle_time(const struct red_parms *p, in red_calc_qavg_from_idle_time() argument
233 long us_idle = min_t(s64, delta, p->Scell_max); in red_calc_qavg_from_idle_time()
256 shift = p->Stab[(us_idle >> p->Scell_log) & RED_STAB_MASK]; in red_calc_qavg_from_idle_time()
268 us_idle = (v->qavg * (u64)us_idle) >> p->Scell_log; in red_calc_qavg_from_idle_time()
277 static inline unsigned long red_calc_qavg_no_idle_time(const struct red_parms *p, in red_calc_qavg_no_idle_time() argument
290 return v->qavg + (backlog - (v->qavg >> p->Wlog)); in red_calc_qavg_no_idle_time()
293 static inline unsigned long red_calc_qavg(const struct red_parms *p, in red_calc_qavg() argument
298 return red_calc_qavg_no_idle_time(p, v, backlog); in red_calc_qavg()
300 return red_calc_qavg_from_idle_time(p, v); in red_calc_qavg()
304 static inline u32 red_random(const struct red_parms *p) in red_random() argument
306 return reciprocal_divide(net_random(), p->max_P_reciprocal); in red_random()
309 static inline int red_mark_probability(const struct red_parms *p, in red_mark_probability() argument
329 return !(((qavg - p->qth_min) >> p->Wlog) * v->qcount < v->qR); in red_mark_probability()
338 static inline int red_cmp_thresh(const struct red_parms *p, unsigned long qavg) in red_cmp_thresh() argument
340 if (qavg < p->qth_min) in red_cmp_thresh()
342 else if (qavg >= p->qth_max) in red_cmp_thresh()
354 static inline int red_action(const struct red_parms *p, in red_action() argument
358 switch (red_cmp_thresh(p, qavg)) { in red_action()
365 if (red_mark_probability(p, v, qavg)) { in red_action()
367 v->qR = red_random(p); in red_action()
371 v->qR = red_random(p); in red_action()
384 static inline void red_adaptative_algo(struct red_parms *p, struct red_vars *v) in red_adaptative_algo() argument
391 qavg = red_calc_qavg_from_idle_time(p, v); in red_adaptative_algo()
394 qavg >>= p->Wlog; in red_adaptative_algo()
396 if (qavg > p->target_max && p->max_P <= MAX_P_MAX) in red_adaptative_algo()
397 p->max_P += MAX_P_ALPHA(p->max_P); /* maxp = maxp + alpha */ in red_adaptative_algo()
398 else if (qavg < p->target_min && p->max_P >= MAX_P_MIN) in red_adaptative_algo()
399 p->max_P = (p->max_P/10)*9; /* maxp = maxp * Beta */ in red_adaptative_algo()
401 max_p_delta = DIV_ROUND_CLOSEST(p->max_P, p->qth_delta); in red_adaptative_algo()
403 p->max_P_reciprocal = reciprocal_value(max_p_delta); in red_adaptative_algo()