From: Patrick McHardy <kaber@trash.net>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
Antonio Almeida <vexwek@gmail.com>,
David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, Martin Devera <devik@cdi.cz>,
Eric Dumazet <dada1@cosmosbay.com>,
Vladimir Ivashchenko <hazard@francoudi.com>,
Badalian Vyacheslav <slavon@bigtelecom.ru>
Subject: Re: [PATCH iproute2 3/2 v2] tc_core: Return double from tc_core_tick2time()
Date: Wed, 10 Jun 2009 14:25:53 +0200 [thread overview]
Message-ID: <4A2FA651.1030207@trash.net> (raw)
In-Reply-To: <20090610074634.GB2673@ff.dom.local>
Jarek Poplawski wrote:
> On Wed, Jun 10, 2009 at 01:04:36AM +0200, Patrick McHardy wrote:
>> Jarek Poplawski wrote:
>>> Hmm... I'm not sure this floor() is needed here, but maybe I'll get it
>>> tomorrow...
>> Its not. It was mainly a suggestion to make the symetry more explicit.
>> I hope gcc understands :)
>
> If so, then maybe let's reconsider previous example:
>
>> Let's see how it's used (mainly) in tc_calc_xmittime() e.g. for
>> Antonio's mostly 800byte and 555Mbit rate:
>>
>> tc_core_time2tick(TIME_UNITS_PER_SEC * (double)size/rate)
>> tc_core_time2tick(1000000 * (double) 800/69375000)
>> tc_core_time2tick(11.53153)
>
> Let's say it returns 116 (after x10 with ceil()). Then, going backwards:
>
> tc_calc_xmitsize()
> {
> return ((double) 69375000 * tc_core_tick2time(116)) / TIME_UNITS_PER_SEC;
> }
>
> would give us: 763 after /10 with floor(), and 804 without floor().
> The latter looks nicer to me but I leave the choice to you or Stephen.
Agreed, I made a thinko somewhere.
prev parent reply other threads:[~2009-06-10 12:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 8:05 [PATCH iproute2 1/2] tc_core: Use double in tc_core_time2tick() Jarek Poplawski
2009-06-09 8:08 ` David Miller
2009-06-09 8:18 ` Jarek Poplawski
2009-06-09 14:03 ` Patrick McHardy
2009-06-09 21:54 ` Jarek Poplawski
2009-06-09 22:20 ` Jarek Poplawski
2009-06-09 22:53 ` [PATCH iproute2 3/2] tc_core: Return double from tc_core_tick2time() Jarek Poplawski
2009-06-09 23:04 ` Patrick McHardy
2009-06-10 7:46 ` [PATCH iproute2 3/2 v2] " Jarek Poplawski
2009-06-10 12:25 ` Patrick McHardy [this message]
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=4A2FA651.1030207@trash.net \
--to=kaber@trash.net \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=devik@cdi.cz \
--cc=hazard@francoudi.com \
--cc=jarkao2@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=slavon@bigtelecom.ru \
--cc=vexwek@gmail.com \
/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).