From: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: Arnd Hannemann <Arnd.Hannemann@nets.rwth-aachen.de>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"joe@perches.com" <joe@perches.com>,
"proski@gnu.org" <proski@gnu.org>
Subject: Re: [PATCH v2] mac80211: Fix output of minstrels rc_stats
Date: Tue, 01 Sep 2009 10:05:20 +0200 [thread overview]
Message-ID: <4A9CD5C0.9080700@nets.rwth-aachen.de> (raw)
In-Reply-To: <646765f40908311754l7bd16185pe21182cdba6e6ac8@mail.gmail.com>
Julian Calaby wrote:
> On Tue, Aug 25, 2009 at 04:51, Arnd
> Hannemann<hannemann@nets.rwth-aachen.de> wrote:
>> An integer overflow in the minstrel debug code prevented the
>> throughput to be displayed correctly. This patch fixes that,
>> by permutating operations like proposed by Pavel Roskin.
>>
>> Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
>> ---
>> net/mac80211/rc80211_minstrel_debugfs.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/mac80211/rc80211_minstrel_debugfs.c b/net/mac80211/rc80211_minstrel_debugfs.c
>> index 98f4807..3d72ec5 100644
>> --- a/net/mac80211/rc80211_minstrel_debugfs.c
>> +++ b/net/mac80211/rc80211_minstrel_debugfs.c
>> @@ -83,7 +83,7 @@ minstrel_stats_open(struct inode *inode, struct file *file)
>> p += sprintf(p, "%3u%s", mr->bitrate / 2,
>> (mr->bitrate & 1 ? ".5" : " "));
>>
>> - tp = ((mr->cur_tp * 96) / 18000) >> 10;
>> + tp = mr->cur_tp / ((18000 << 10) / 96);
>
> Sorry about being so late, but wouldn't:
>
> tp = ((mr->cur_tp * 2) / 375) >> 10;
>
> also work? (Assuming that the numbers in the constant aren't important)
I needed a while to figure out why those constants are used, but finally
they made some sense, so I think its best to preserve them.
mr->cur_tp is the time to send one 1200 byte packet (9600 bits),
the loss probelity is scaled between 0-18000 to reduce rounding error.
>
> or even:
>
> tp = (mr->cur_tp / 375) >> 9;
See above.
Best regards,
Arnd
prev parent reply other threads:[~2009-09-01 8:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-24 17:42 [PATCH] mac80211: Fix output of minstrels rc_stats Arnd Hannemann
2009-08-24 17:57 ` Joe Perches
2009-08-24 18:19 ` Arnd Hannemann
2009-08-24 18:20 ` Pavel Roskin
2009-08-24 18:36 ` Arnd Hannemann
2009-08-24 18:38 ` Arnd Hannemann
2009-08-24 18:51 ` [PATCH v2] " Arnd Hannemann
2009-09-01 0:54 ` Julian Calaby
2009-09-01 8:05 ` Arnd Hannemann [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=4A9CD5C0.9080700@nets.rwth-aachen.de \
--to=hannemann@nets.rwth-aachen.de \
--cc=Arnd.Hannemann@nets.rwth-aachen.de \
--cc=joe@perches.com \
--cc=julian.calaby@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=proski@gnu.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).