Skip to content

Commit

Permalink
net: sched: pie: fix 64-bit division
Browse files Browse the repository at this point in the history
Use div_u64() to resolve build failures on 32-bit platforms.

Fixes: 3f7ae5f ("net: sched: pie: add more cases to auto-tune alpha and beta")
Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Leslie Monis authored and David S. Miller committed Feb 27, 2019
1 parent 3b40bf4 commit ff8285f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/sched/sch_pie.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static void calculate_probability(struct Qdisc *sch)
*/

if (qdelay == 0 && qdelay_old == 0 && update_prob)
q->vars.prob = (q->vars.prob * 98) / 100;
q->vars.prob = 98 * div_u64(q->vars.prob, 100);

q->vars.qdelay = qdelay;
q->vars.qlen_old = qlen;
Expand Down

0 comments on commit ff8285f

Please sign in to comment.