From patchwork Mon Feb 1 12:58:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 8178801 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5D1249F1C1 for ; Mon, 1 Feb 2016 12:59:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74E562042A for ; Mon, 1 Feb 2016 12:59:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81C1B20340 for ; Mon, 1 Feb 2016 12:59:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932164AbcBAM7G (ORCPT ); Mon, 1 Feb 2016 07:59:06 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37870 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932065AbcBAM7F (ORCPT ); Mon, 1 Feb 2016 07:59:05 -0500 Received: by mail-wm0-f45.google.com with SMTP id l66so69914520wml.0 for ; Mon, 01 Feb 2016 04:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=open-mesh-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=pTJdR2REAC8Tbm3t3dRlbxKJai421YUT2HYdvXVc3n0=; b=gE26mf0OxyfXsNqSjEq2rA2h5Klc/ufEsqtnm+8IPsGkvSssCth9hnVSJbkip/iHBR NAl5ZI6X8liNMu2Hw/K0Jj2vMiNlgkQZmARASmPBsYTAq/WrFp/gKfzfgpb7WzNFupZk n+dPoUuGKXMaPHTK1hOT+1NingKfuYpcrQlYEvZrFHFuZEJYujEQr4wenhKy1mtDPPCn 5ywaufP6eFr2quHuvr0THyBDnBHB5JwKzKWKvB+FgdutbhgYTHIpgGKulN/BDY/zueyh /SuzoSqtxU5fkSlWeG9/7tp/vmxhm9gPy0AL0eyV1TNA/bNW3HHccTlF5gtVitoF7fKL RvXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pTJdR2REAC8Tbm3t3dRlbxKJai421YUT2HYdvXVc3n0=; b=PwCpZDZc6SRLVaoGy9GgkNRFsU1zO+QzQLcho9LWG8hePVAzC6xUu6SSmG3dW2dXeF DoG//tpPa3P6tBvNtbAvW0NuJ44wE1M+J/cXrV/XCUZRIzlhQnh5BESxt+37ugawibh4 8AoueHxqG5eUAWlYzxMkptMvm2ZeenAwXGTAPPdBxF8dn+bTgLLyX0tpJvUlfKnWEs5V VfaNvhQH89PtLumbQGYBDEFK7nwc0d36zoCANM97uDWVw/DfgJYqRgVE3cNdBOgvZvWp ea+v2jjJlKYXb3IrLCoLRx+VerpZ2JiYm3/Ymegx0uWH4RpPObir6YJcSBbA7gUtnr5A z+SQ== X-Gm-Message-State: AG10YOQuAXPWGuRRYW+zlb3/5qzIMLGSa3nQF6LIT3+SL8sIMwS61jt5Zx+aIj/p6kqEYXEP X-Received: by 10.28.145.204 with SMTP id t195mr11915758wmd.91.1454331544425; Mon, 01 Feb 2016 04:59:04 -0800 (PST) Received: from sven-desktop.home.narfation.org (x4d064d0d.dyn.telefonica.de. [77.6.77.13]) by smtp.gmail.com with ESMTPSA id t76sm11401021wmd.13.2016.02.01.04.59.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Feb 2016 04:59:03 -0800 (PST) From: Sven Eckelmann To: linux-wireless@vger.kernel.org Cc: thomas@net.t-labs.tu-berlin.de, antonio@open-mesh.com, nbd@nbd.name, johannes@sipsolutions.net, Sven Eckelmann Subject: [PATCHv2] mac80211: minstrel: Change expected throughput back to Mbps Date: Mon, 1 Feb 2016 13:58:51 +0100 Message-Id: <1454331531-2472-1-git-send-email-sven@open-mesh.com> X-Mailer: git-send-email 2.7.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The change from cur_tp to the function minstrel_get_tp_avg/minstrel_ht_get_tp_avg changed the unit used for the current throughtput. For example in minstrel_ht the correct conversion between them would be: mrs->cur_tp / 10 == minstrel_ht_get_tp_avg(..). This factor 10 must also be included in the calculation of minstrel_get_expected_throughput and minstrel_ht_get_expected_throughput to get similar results as before the change. Fixes: 6a27b2c40b48 ("mac80211: restructure per-rate throughput calculation into function") Signed-off-by: Sven Eckelmann --- v2: - Modified PATCH title net/mac80211/rc80211_minstrel.c | 2 +- net/mac80211/rc80211_minstrel_ht.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index 3ece7d1..b54f398 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c @@ -711,7 +711,7 @@ static u32 minstrel_get_expected_throughput(void *priv_sta) * computing cur_tp */ tmp_mrs = &mi->r[idx].stats; - tmp_cur_tp = minstrel_get_tp_avg(&mi->r[idx], tmp_mrs->prob_ewma); + tmp_cur_tp = minstrel_get_tp_avg(&mi->r[idx], tmp_mrs->prob_ewma) * 10; tmp_cur_tp = tmp_cur_tp * 1200 * 8 / 1024; return tmp_cur_tp; diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 3928dbd..8928151 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -1334,7 +1334,8 @@ static u32 minstrel_ht_get_expected_throughput(void *priv_sta) prob = mi->groups[i].rates[j].prob_ewma; /* convert tp_avg from pkt per second in kbps */ - tp_avg = minstrel_ht_get_tp_avg(mi, i, j, prob) * AVG_PKT_SIZE * 8 / 1024; + tp_avg = minstrel_ht_get_tp_avg(mi, i, j, prob) * 10; + tp_avg *= AVG_PKT_SIZE * 8 / 1024; return tp_avg; }