diff options
Diffstat (limited to 'include/net/red.h')
-rw-r--r-- | include/net/red.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/red.h b/include/net/red.h index ef46058d35bf..76e0b5f922c6 100644 --- a/include/net/red.h +++ b/include/net/red.h | |||
@@ -130,7 +130,8 @@ struct red_parms { | |||
130 | u32 qth_max; /* Max avg length threshold: Wlog scaled */ | 130 | u32 qth_max; /* Max avg length threshold: Wlog scaled */ |
131 | u32 Scell_max; | 131 | u32 Scell_max; |
132 | u32 max_P; /* probability, [0 .. 1.0] 32 scaled */ | 132 | u32 max_P; /* probability, [0 .. 1.0] 32 scaled */ |
133 | u32 max_P_reciprocal; /* reciprocal_value(max_P / qth_delta) */ | 133 | /* reciprocal_value(max_P / qth_delta) */ |
134 | struct reciprocal_value max_P_reciprocal; | ||
134 | u32 qth_delta; /* max_th - min_th */ | 135 | u32 qth_delta; /* max_th - min_th */ |
135 | u32 target_min; /* min_th + 0.4*(max_th - min_th) */ | 136 | u32 target_min; /* min_th + 0.4*(max_th - min_th) */ |
136 | u32 target_max; /* min_th + 0.6*(max_th - min_th) */ | 137 | u32 target_max; /* min_th + 0.6*(max_th - min_th) */ |
@@ -303,7 +304,7 @@ static inline unsigned long red_calc_qavg(const struct red_parms *p, | |||
303 | 304 | ||
304 | static inline u32 red_random(const struct red_parms *p) | 305 | static inline u32 red_random(const struct red_parms *p) |
305 | { | 306 | { |
306 | return reciprocal_divide(net_random(), p->max_P_reciprocal); | 307 | return reciprocal_divide(prandom_u32(), p->max_P_reciprocal); |
307 | } | 308 | } |
308 | 309 | ||
309 | static inline int red_mark_probability(const struct red_parms *p, | 310 | static inline int red_mark_probability(const struct red_parms *p, |