On Wed, Jan 23, 2013 at 12:08 PM, Felix Fietkau <span dir="ltr">&lt;<a href="mailto:nbd@openwrt.org" target="_blank">nbd@openwrt.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>On 2013-01-23 8:40 PM, Christopher Wiley wrote:<br>
&gt; On Mon, Jan 21, 2013 at 4:10 AM, Felix Fietkau &lt;<a href="mailto:nbd@openwrt.org" target="_blank">nbd@openwrt.org</a><br>
</div><div>&gt; &lt;mailto:<a href="mailto:nbd@openwrt.org" target="_blank">nbd@openwrt.org</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     On 2013-01-17 8:56 PM, Christopher Wiley wrote:<br>
&gt;     &gt; Temporarily disable &quot;high&quot; bitrates during association with a BSS.<br>
&gt;     &gt;<br>
&gt;     &gt; Users of wpa_supplicant can set disable_high_bitrates=1 in their<br>
&gt;     &gt; interface config, which causes the driver to disable high bitrates on<br>
&gt;     &gt; the interface during associations.  The user can then call over<br>
&gt;     DBus via<br>
&gt;     &gt; EnableHighBitrates() to re-enable high bitrates at their discretion.<br>
&gt;     &gt;<br>
&gt;     &gt; This is intended to facilitate staying at low bitrates all the way<br>
&gt;     &gt; through DHCP negotiations and other one time initial connection setup<br>
&gt;     &gt; steps.  Some setup processes, like WPA negotiation, can time out<br>
&gt;     before<br>
&gt;     &gt; the system rate control algorithm has a chance to wind down to sane<br>
&gt;     &gt; rates.<br>
&gt;     &gt;<br>
&gt;     &gt; Signed-hostap: Christoper Wiley &lt;<a href="mailto:wiley@chromium.org" target="_blank">wiley@chromium.org</a><br>
</div>&gt;     &lt;mailto:<a href="mailto:wiley@chromium.org" target="_blank">wiley@chromium.org</a>&gt;&gt;<br>
<div>&gt;     What driver / rate control algorithm are you using this workaround for?<br>
&gt;     Wouldn&#39;t it be better to fix the rate control module instead? Having a<br>
&gt;     rate control module start with high data rates and no proper fallback<br>
&gt;     this early seems like a bug or design flaw to me that should be<br>
&gt;     addressed properly instead of worked around with a patch like this.<br>
&gt;<br>
&gt;     - Felix<br>
&gt;<br>
&gt;<br>
&gt; This was happening on an ath9k module using<br>
&gt; the ath9k_btcoex_rate_control algorithm on a 9462 part specifically.  It<br>
&gt; is true that this is not a real fix for the underlying problem (which<br>
&gt; will need to be in the driver).  This patch just converts the total<br>
&gt; breakage of not being able to connect at all to a brief period of poor<br>
&gt; connectivity after high rates are enabled as the rate control algorithm<br>
&gt; winds down.  However, I think it is valuable to allow distributions to<br>
&gt; work around rate control bugs in the various drivers they have to use on<br>
&gt; their respective platforms.<br>
</div>I&#39;m not really convinced that it is a good idea to carry such<br>
workarounds just in case other drivers might be broken as well.<br>
<br>
I also think it would be a *really* bad idea for distributions to just<br>
enable a hack like this by default, or even suggest it to users.<br>
While it may indeed succeed in working around a particular kind of bug<br>
in a stupid rate control module, it might as well trigger a different<br>
kind of bug in a different module.<br>
<br>
I strongly believe that adding complexity and bloat to codebases for<br>
unnecessary workarounds is bad in the long run and should be avoided if<br>
possible.<br>
<br>
How about just changing the ath9k rate control to initialize its tables<br>
in a way that it will start with lower rates and work its way up.<br>
Shouldn&#39;t be too hard, the module itself is not very complex.<br>
<span><font color="#888888"><br>
- Felix<br>
</font></span></blockquote></div><div><br></div><div>I don&#39;t really think this is such a zero-sum game.  We&#39;re hardening wpa_supplicant against a class of hard to reproduce errors and using an existing kernel interface in a straightforward way.</div>

<br><div>If we&#39;re going to speculate about hypothetical bugs in other modules, we should also speculate about bugs in other rate control modules.  This particular sort of rate control bug is difficult because it is a hard to reproduce corner case that snags an otherwise acceptable optimization: be optimistic about rates and count on backoff to correct for errors.  I don&#39;t really think its a bad idea for distributions to work around a driver bug that has been known (even just on this list) for over a year.  That this has gone on this long says a lot about the subtlety of this kind of bug.</div>
<div><br></div><div>I can&#39;t say I&#39;m familiar with how rate control is done, but suppose I did want to go in and write up a patch.  What files and functions would I start looking at and poking to make an appropriate change?</div>
<div><br></div><div>Christopher Wiley</div>