X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=include%2Fnet%2Fred.h;h=76e0b5f922c6c475e7f47a73d072282dfec53149;hb=632623153196bf183a69686ed9c07eee98ff1bf8;hp=ef46058d35bf0de1fdabf80915594f9d201a0a5c;hpb=3bb07f1b73ea6313b843807063e183e168c9182a;p=~andy%2Flinux diff --git a/include/net/red.h b/include/net/red.h index ef46058d35b..76e0b5f922c 100644 --- a/include/net/red.h +++ b/include/net/red.h @@ -130,7 +130,8 @@ struct red_parms { u32 qth_max; /* Max avg length threshold: Wlog scaled */ u32 Scell_max; u32 max_P; /* probability, [0 .. 1.0] 32 scaled */ - u32 max_P_reciprocal; /* reciprocal_value(max_P / qth_delta) */ + /* reciprocal_value(max_P / qth_delta) */ + struct reciprocal_value max_P_reciprocal; u32 qth_delta; /* max_th - min_th */ u32 target_min; /* min_th + 0.4*(max_th - min_th) */ 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, static inline u32 red_random(const struct red_parms *p) { - return reciprocal_divide(net_random(), p->max_P_reciprocal); + return reciprocal_divide(prandom_u32(), p->max_P_reciprocal); } static inline int red_mark_probability(const struct red_parms *p,