From: Larry Finger <Larry.Finger@lwfinger.net>
To: Mattias Nissler <mattias.nissler@gmx.de>,
Stefano Brivio <stefano.brivio@polimi.it>
Cc: wireless <linux-wireless@vger.kernel.org>,
"Mark (The Wirie)" <mark@thewirie.com>
Subject: Question about code in rc80211_pid_algo.c
Date: Fri, 25 Mar 2011 22:39:27 -0500 [thread overview]
Message-ID: <4D8D5FEF.6010009@lwfinger.net> (raw)
Hi,
I'm writing to you as the listed authors of the PID code in the mainline kernel.
I am helping adapt the PID algorithm for an appliance that will use the Realtek
vendor driver and the ALFA AWUS036H device. The vendor driver's rate-control
mechanism is not very effective. As the target kernel for the appliance is
2.6.21, we are not backporting mac80211 and the rtl8187 driver.
The package is working quite well, but Mark, the project manager, brought one
section to my attention and I am forwarding it.
In routine rate_control_pid_sample(), the percentage failure is calculated, then
if the rate has been changed, the code goes on to "update the rate behaviour
info". At that point, the calculation is
tmp = (pf - spinfo->last_pf);
tmp = RC_PID_DO_ARITH_RIGHT_SHIFT(tmp, RC_PID_ARITH_SHIFT);
From our analysis of the code, both pf and last_pf must be in the range 0-100,
and the first statement results in tmp between -100 and 100. After the second
line does an arithmetic right shift of 8, the resulting value will always be
zero. Did we miss something, or is this really a convoluted way to set "tmp" to
zero?
Thanks,
Larry
next reply other threads:[~2011-03-26 3:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-26 3:39 Larry Finger [this message]
2011-03-26 11:50 ` Question about code in rc80211_pid_algo.c Mattias Nissler
2011-03-26 13:00 ` Larry Finger
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=4D8D5FEF.6010009@lwfinger.net \
--to=larry.finger@lwfinger.net \
--cc=linux-wireless@vger.kernel.org \
--cc=mark@thewirie.com \
--cc=mattias.nissler@gmx.de \
--cc=stefano.brivio@polimi.it \
/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