From patchwork Fri Mar 1 17:37:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huehn X-Patchwork-Id: 2202551 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id B0DAD40079 for ; Fri, 1 Mar 2013 17:37:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751543Ab3CARhq (ORCPT ); Fri, 1 Mar 2013 12:37:46 -0500 Received: from mail.net.t-labs.tu-berlin.de ([130.149.220.252]:36841 "EHLO mail.net.t-labs.tu-berlin.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751202Ab3CARhp (ORCPT ); Fri, 1 Mar 2013 12:37:45 -0500 Received: from dai175.aot.tu-berlin.de.de (dai175.aot.tu-berlin.de [130.149.232.175]) by mail.net.t-labs.tu-berlin.de (Postfix) with ESMTPSA id E19444C47F8; Fri, 1 Mar 2013 18:37:43 +0100 (CET) From: Thomas Huehn To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, johannes.berg@intel.com, nbd@openwrt.org, thomas@net.t-labs.tu-berlin.de Subject: [PATCH 6/7] mac80211: treat minstrel success probabilities below 10% as implausible Date: Fri, 1 Mar 2013 18:37:35 +0100 Message-Id: <1362159456-39448-7-git-send-email-thomas@net.t-labs.tu-berlin.de> X-Mailer: git-send-email 1.8.1.1 In-Reply-To: <1362159456-39448-1-git-send-email-thomas@net.t-labs.tu-berlin.de> References: <1362159456-39448-1-git-send-email-thomas@net.t-labs.tu-berlin.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Based on minstrel_ht this patch treats success probabilities below 10% as implausible values for throughput calculation in minstrel's statistics. Current throughput per rate with such a low success probability is reset to 0 MBit/s. Signed-off-by: Thomas Huehn --- net/mac80211/rc80211_minstrel.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index c28e60a..8af71f6 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c @@ -92,7 +92,6 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi) mr->probability = minstrel_ewma(mr->probability, mr->cur_prob, EWMA_LEVEL); - mr->cur_tp = mr->probability * (1000000 / usecs); } else mr->sample_skipped++; @@ -101,6 +100,12 @@ minstrel_update_stats(struct minstrel_priv *mp, struct minstrel_sta_info *mi) mr->success = 0; mr->attempts = 0; + /* Update throughput per rate, reset thr. below 10% success */ + if (mr->probability < MINSTREL_FRAC(10, 100)) + mr->cur_tp = 0; + else + mr->cur_tp = mr->probability * (1000000 / usecs); + /* Sample less often below the 10% chance of success. * Sample less often above the 95% chance of success. */ if (mr->probability > MINSTREL_FRAC(95, 100) ||