From owner-svn-src-user@FreeBSD.ORG Mon Sep 5 15:21:19 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10AAB106564A; Mon, 5 Sep 2011 15:21:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAB838FC0A; Mon, 5 Sep 2011 15:21:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p85FLIx9043205; Mon, 5 Sep 2011 15:21:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p85FLIex043203; Mon, 5 Sep 2011 15:21:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109051521.p85FLIex043203@svn.freebsd.org> From: Adrian Chadd Date: Mon, 5 Sep 2011 15:21:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225402 - user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Sep 2011 15:21:19 -0000 Author: adrian Date: Mon Sep 5 15:21:18 2011 New Revision: 225402 URL: http://svn.freebsd.org/changeset/base/225402 Log: As a temporary workaround, treat MCS error rates 5% higher than the best rate as "ok" when picking a best rate. This is all a hack to avoid having to implement the "correct" solution, whatever that is. For example, minstrel calculates a predicted A-MPDU throughput value based on the average A-MPDU sub-frame count and per-rate TX success probability. This, along with lowering sample_stats to 2 from 10 (ie, spend 2% of TX time trying to sample alternate rates) seems to keep my TCP TX mostly stable at around 120-130mbit for my testing. TODO: * The EWMA doesn't raise quickly enough and seems a bit wrong, eg: [ 0 MCS: 250] 329:329 (100%) (EWMA 63.6%) T 22 F 0 avg 407 last 19144 .. how'd the EWMA come out to be 63% given a 100% success rate overall? It made an incorrect judgement early on and hasn't yet had enough time to correct it. The sampling of other MCS rates is also not optimal - it shouldn't try sampling all of them during the sample interval. Instead, come up with a more intelligent way of picking the MCS rates to sample. Finally, comparing MCS rates by number is incorrect. This really should compare the per-rate throughput value, as higher MCS rate != higher throughput. But, as said above, this is "good enough" for local testing. It shouldn't be merged into -HEAD like this. Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.c Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.c Mon Sep 5 15:11:01 2011 (r225401) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_rate/sample/sample.c Mon Sep 5 15:21:18 2011 (r225402) @@ -206,13 +206,15 @@ pick_best_rate(struct ath_node *an, cons continue; /* - * For HT, Don't use a bit rate that has a higher failure - * rate than the current. + * For HT, Don't use a bit rate that is much more + * lossy than the best. * - * XXX This isn't optimal! + * XXX this isn't optimal; it's just designed to + * eliminate rates that are going to be obviously + * worse. */ if (an->an_node.ni_flags & IEEE80211_NODE_HT) { - if (best_rate_pct > pct) + if (best_rate_pct > (pct + 50)) continue; }