From: Leslie Monis <lesliemonis@gmail•com>
To: Stephen Hemminger <stephen@networkplumber•org>
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 20:54:45 +0530 [thread overview]
Message-ID: <20190327152445.GA5322@Inspiron-3521> (raw)
In-Reply-To: <20190327075357.293922b3@shemminger-XPS-13-9360>
On Wed, Mar 27, 2019 at 07:53:57AM -0700, Stephen Hemminger wrote:
> 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
Alright. I will correct this.
Thanks
next prev parent reply other threads:[~2019-03-27 15:24 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
2019-03-27 15:24 ` Leslie Monis [this message]
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=20190327152445.GA5322@Inspiron-3521 \
--to=lesliemonis@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=stephen@networkplumber$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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