[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4A2FA651.1030207@trash.net>
Date: Wed, 10 Jun 2009 14:25:53 +0200
From: Patrick McHardy <kaber@...sh.net>
To: Jarek Poplawski <jarkao2@...il.com>
CC: Stephen Hemminger <shemminger@...tta.com>,
Antonio Almeida <vexwek@...il.com>,
David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
Martin Devera <devik@....cz>,
Eric Dumazet <dada1@...mosbay.com>,
Vladimir Ivashchenko <hazard@...ncoudi.com>,
Badalian Vyacheslav <slavon@...telecom.ru>
Subject: Re: [PATCH iproute2 3/2 v2] tc_core: Return double from tc_core_tick2time()
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists