netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: Leslie Monis <lesliemonis@gmail.com>, davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: sched: pie: fix 64-bit division
Date: Tue, 26 Feb 2019 17:53:16 -0800	[thread overview]
Message-ID: <9f439285-50cc-f732-13ba-741ded0ca768@infradead.org> (raw)
In-Reply-To: <20190227010006.22219-1-lesliemonis@gmail.com>

On 2/26/19 5:00 PM, Leslie Monis wrote:
> Use div_u64() to resolve build failures on 32-bit platforms.
> 
> Fixes: 3f7ae5f3dc52 ("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>

Thanks.

[https://lore.kernel.org/lkml/6ecd1bde-c15b-0568-2b72-6e0796a87864@infradead.org/]

> ---
>  net/sched/sch_pie.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/sched/sch_pie.c b/net/sched/sch_pie.c
> index 4c0670b6aec1..f93cfe034c72 100644
> --- a/net/sched/sch_pie.c
> +++ b/net/sched/sch_pie.c
> @@ -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;
> 


-- 
~Randy

  reply	other threads:[~2019-02-27  1:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27  1:00 [PATCH net-next] net: sched: pie: fix 64-bit division Leslie Monis
2019-02-27  1:53 ` Randy Dunlap [this message]
2019-02-27  2:55 ` David Miller
2019-02-27 10:11 ` David Laight
2019-02-27 16:12   ` Leslie Monis
2019-02-28 10:10     ` David Laight
2019-02-28 10:16       ` Leslie Monis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f439285-50cc-f732-13ba-741ded0ca768@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=davem@davemloft.net \
    --cc=lesliemonis@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).