From: Stephen Hemminger <stephen@networkplumber.org>
To: Leslie Monis <lesliemonis@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 1/2] tc: pie: change maximum integer value of tc_pie_xstats->prob
Date: Wed, 27 Mar 2019 07:53:57 -0700 [thread overview]
Message-ID: <20190327075357.293922b3@shemminger-XPS-13-9360> (raw)
In-Reply-To: <20190323184835.20456-2-lesliemonis@gmail.com>
On Sun, 24 Mar 2019 00:18:34 +0530
Leslie Monis <lesliemonis@gmail.com> wrote:
> tc_pie_xstats->prob has a maximum value of (2^64 - 1).
>
> Signed-off-by: Leslie Monis <lesliemonis@gmail.com>
> ---
> tc/q_pie.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tc/q_pie.c b/tc/q_pie.c
> index f7924ef5..6566ca10 100644
> --- a/tc/q_pie.c
> +++ b/tc/q_pie.c
> @@ -198,7 +198,7 @@ static int pie_print_xstats(struct qdisc_util *qu, FILE *f,
> st = RTA_DATA(xstats);
> /*prob is returned as a fracion of maximum integer value */
> fprintf(f, "prob %f delay %uus avg_dq_rate %u\n",
> - (double)st->prob / (double)0xffffffff, st->delay,
> + (double)st->prob / (double)0xffffffffffffffff, st->delay,
This won't work correctly on 32bit systems because that value won't fit there.. You would be better off using UINT64_MAX
next prev parent reply other threads:[~2019-03-27 14:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-23 18:48 [PATCH iproute2 0/2] tc: pie: make tc/q_pie.c consistent with the kernel Leslie Monis
2019-03-23 18:48 ` [PATCH iproute2 1/2] tc: pie: change maximum integer value of tc_pie_xstats->prob Leslie Monis
2019-03-27 14:53 ` Stephen Hemminger [this message]
2019-03-27 15:24 ` Leslie Monis
2019-03-23 18:48 ` [PATCH iproute2 2/2] tc: pie: update man page Leslie Monis
2019-03-27 14:54 ` Stephen Hemminger
2019-03-27 15:25 ` 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=20190327075357.293922b3@shemminger-XPS-13-9360 \
--to=stephen@networkplumber.org \
--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