From patchwork Mon Feb 1 12:24:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 8178571 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0916DBEEE5 for ; Mon, 1 Feb 2016 12:24:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E087203C4 for ; Mon, 1 Feb 2016 12:24:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01A24203C1 for ; Mon, 1 Feb 2016 12:24:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753865AbcBAMYZ (ORCPT ); Mon, 1 Feb 2016 07:24:25 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:33729 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753265AbcBAMYY (ORCPT ); Mon, 1 Feb 2016 07:24:24 -0500 Received: by mail-wm0-f50.google.com with SMTP id l66so67671044wml.0 for ; Mon, 01 Feb 2016 04:24:23 -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=FBQd2D8Zg8VIQ5hd/+1gDoTpoLuJ65R72CPP1wNnBgk=; b=Qw26u+flABDtY46jjUb4NTbh+Fijd0v6NVn4FyA0/F++rfhd5PmsMO8Vd19S5DduGT IRt2pADMBtpcE/iQnqb735aAkroAv2s0KixeDzOHQEBl5aiBfW91C6q61nyqAijxfBrw luKOXd/cda3k0zDQZa5L+CRhHu2wlm9hmZlhfxBzOTANaurLPbci8OQQkIMWZnOWfYZk PmJVjDFCLBWhYMZpa8bqKLukDAON52DHjYvp5/uWGcy5SKGpOb1/YnvuJJDVo+cW2mUM DNa1kHUGG4ysmezDQCvp9l4/tbK3kl93Yi3fue4TqJVlkFjTXAtj/dhoqT7bJyrbtQP9 dP5w== 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=FBQd2D8Zg8VIQ5hd/+1gDoTpoLuJ65R72CPP1wNnBgk=; b=YNeqOd1u+I4HDn2paCFcONwsCYCmqRuRO+vHuPjadMBm28AQdi/AHiwzEd8s8rWw9e MsFq5ddFmfz+H93JwtCnca3VoJ3q2PkYnDeErVoqHZZwKFA0WvrMSPvJkrSOsrV9aOPz QTtvijWENlc6hcijQFl3rnK42CHCqXFwhPC9JQRk2kvF4o+k5Xw+u44vcQ7tZpUpOxC9 0J8u6bRJ1DZHPxR+k+rXVGHMyOyBeG89enLRT0hrjuufua2qSPDb9d4lIUvp8YYt12/D sonv9zJUtLszZliSFDjJ9vmB/DlB3VNV6bv3eLdR5lQ55Wz1H2ah6J/hQ5h5VRFSowCI /kvw== X-Gm-Message-State: AG10YOQO6gAGsy/8yHre7CNXN5Tr3/vVBDlXGROZstZCubAReuDwTCqte1YO8e74gIvTtx2V X-Received: by 10.194.20.105 with SMTP id m9mr21876954wje.161.1454329462896; Mon, 01 Feb 2016 04:24:22 -0800 (PST) Received: from sven-desktop.home.narfation.org (x4d064d0d.dyn.telefonica.de. [77.6.77.13]) by smtp.gmail.com with ESMTPSA id i2sm28777293wjx.42.2016.02.01.04.24.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Feb 2016 04:24:22 -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: [PATCH] mac80211: minstrel: Scale expected_throughput by 10 Date: Mon, 1 Feb 2016 13:24:10 +0100 Message-Id: <1454329450-31527-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 --- net/mac80211/rc80211_minstrel.c | 2 +- net/mac80211/rc80211_minstrel_ht.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }