From patchwork Sat Oct 18 17:13:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karl Beldan X-Patchwork-Id: 5100211 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 84EE5C11AC for ; Sat, 18 Oct 2014 17:14:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 92DB720172 for ; Sat, 18 Oct 2014 17:13:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 953DD20176 for ; Sat, 18 Oct 2014 17:13:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751713AbaJRRNz (ORCPT ); Sat, 18 Oct 2014 13:13:55 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:37602 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751695AbaJRRNy (ORCPT ); Sat, 18 Oct 2014 13:13:54 -0400 Received: by mail-wi0-f172.google.com with SMTP id n3so4192213wiv.17 for ; Sat, 18 Oct 2014 10:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y6+UBVGsTW7OI8DSFrZwVN/2J6cgC/3u7po1l2HCS5c=; b=TNOHZnJ0REJGYuxkKX5m+bDU3zjpb9BGn9yfZmw9L3QxrWxjIPkNP12/e7YgARcYwe Xq/26AGrCUJVw0VOwnv7ckM37tCAJpGyw8PJ8YDtYGuTFU9NccXwsrCpEspzFcBAHiRD 6n/hvKt1SZfTQRiwxpFLbcXoP6xIHObDrX9tXlAkB/1cdVeUgEVFeWhVE6S3AU8x9zk7 a+dhozIKbRMyfO/YSMNbdW9xh0Anh7pod4196unwEjdgkF9sl0PnrAfoLQ4nwtRhC1Ep uII96t/ul6rEz1b6S7K5gjNSx+5v02kFnVpRJu/i4LVh70deykmq8OY69GZ4P+zxZ4vs BeVQ== X-Received: by 10.180.208.42 with SMTP id mb10mr7085546wic.49.1413652433004; Sat, 18 Oct 2014 10:13:53 -0700 (PDT) Received: from magnum.frso.rivierawaves.com (ppp-seco11pa2-46-193-143-43.wb.wifirst.net. [46.193.143.43]) by mx.google.com with ESMTPSA id kw2sm5712585wjb.34.2014.10.18.10.13.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Oct 2014 10:13:52 -0700 (PDT) From: Karl Beldan To: Johannes Berg Cc: Karl Beldan , linux-wireless , karl.beldan@gmail.com, Felix Fietkau Subject: [PATCH v3 1/4] mac80211: minstrel_ht: Increase the range of handled rate indexes Date: Sat, 18 Oct 2014 19:13:41 +0200 Message-Id: <1413652424-14345-2-git-send-email-karl.beldan@gmail.com> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1413652424-14345-1-git-send-email-karl.beldan@gmail.com> References: <1413575459-29612-5-git-send-email-karl.beldan@gmail.com> <1413652424-14345-1-git-send-email-karl.beldan@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 From: Karl Beldan Since 5935839ad735 ("mac80211: improve minstrel_ht rate sorting by throughput & probability"), the rate indexes are manipulated via u8's and hence allow for a maximum of 256 mcs_group entries in minstrel_mcs_groups. ATM, minstrel_ht advertizes support up to 3HTSS@40MHz, consuming: 8(MCS_GROUP_RATES) * (3(SS)*2(GI)*2(BW)+1(CCK)), i.e. 104 entries. Support for 3VHTSS@80MHz will require: 10(MCS_GROUP_RATES) * (3(SS)*2(GI)*2(BW)+1(CCK)) + 10(MCS_GROUP_RATES) * (3(SS)*2(GI)*3(BW)), i.e. 130 + 180 entries. This change moves from u8s to u16s where necessary. Signed-off-by: Karl Beldan Cc: Felix Fietkau --- net/mac80211/rc80211_minstrel_ht.c | 16 ++++++++-------- net/mac80211/rc80211_minstrel_ht.h | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 17ef54a..ccec718 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -240,8 +240,8 @@ minstrel_ht_calc_tp(struct minstrel_ht_sta *mi, int group, int rate) * MCS groups, CCK rates do not provide aggregation and are therefore at last. */ static void -minstrel_ht_sort_best_tp_rates(struct minstrel_ht_sta *mi, u8 index, - u8 *tp_list) +minstrel_ht_sort_best_tp_rates(struct minstrel_ht_sta *mi, u16 index, + u16 *tp_list) { int cur_group, cur_idx, cur_thr, cur_prob; int tmp_group, tmp_idx, tmp_thr, tmp_prob; @@ -278,7 +278,7 @@ minstrel_ht_sort_best_tp_rates(struct minstrel_ht_sta *mi, u8 index, * Find and set the topmost probability rate per sta and per group */ static void -minstrel_ht_set_best_prob_rate(struct minstrel_ht_sta *mi, u8 index) +minstrel_ht_set_best_prob_rate(struct minstrel_ht_sta *mi, u16 index) { struct minstrel_mcs_group_data *mg; struct minstrel_rate_stats *mr; @@ -321,8 +321,8 @@ minstrel_ht_set_best_prob_rate(struct minstrel_ht_sta *mi, u8 index) */ static void minstrel_ht_assign_best_tp_rates(struct minstrel_ht_sta *mi, - u8 tmp_mcs_tp_rate[MAX_THR_RATES], - u8 tmp_cck_tp_rate[MAX_THR_RATES]) + u16 tmp_mcs_tp_rate[MAX_THR_RATES], + u16 tmp_cck_tp_rate[MAX_THR_RATES]) { unsigned int tmp_group, tmp_idx, tmp_cck_tp, tmp_mcs_tp; int i; @@ -386,8 +386,8 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) struct minstrel_mcs_group_data *mg; struct minstrel_rate_stats *mr; int group, i, j; - u8 tmp_mcs_tp_rate[MAX_THR_RATES], tmp_group_tp_rate[MAX_THR_RATES]; - u8 tmp_cck_tp_rate[MAX_THR_RATES], index; + u16 tmp_mcs_tp_rate[MAX_THR_RATES], tmp_group_tp_rate[MAX_THR_RATES]; + u16 tmp_cck_tp_rate[MAX_THR_RATES], index; if (mi->ampdu_packets > 0) { mi->avg_ampdu_len = minstrel_ewma(mi->avg_ampdu_len, @@ -517,7 +517,7 @@ minstrel_next_sample_idx(struct minstrel_ht_sta *mi) } static void -minstrel_downgrade_rate(struct minstrel_ht_sta *mi, u8 *idx, bool primary) +minstrel_downgrade_rate(struct minstrel_ht_sta *mi, u16 *idx, bool primary) { int group, orig_group; diff --git a/net/mac80211/rc80211_minstrel_ht.h b/net/mac80211/rc80211_minstrel_ht.h index 01570e0..8b54e89 100644 --- a/net/mac80211/rc80211_minstrel_ht.h +++ b/net/mac80211/rc80211_minstrel_ht.h @@ -34,8 +34,8 @@ struct minstrel_mcs_group_data { u8 supported; /* sorted rate set within a MCS group*/ - u8 max_group_tp_rate[MAX_THR_RATES]; - u8 max_group_prob_rate; + u16 max_group_tp_rate[MAX_THR_RATES]; + u16 max_group_prob_rate; /* MCS rate statistics */ struct minstrel_rate_stats rates[MCS_GROUP_RATES]; @@ -52,8 +52,8 @@ struct minstrel_ht_sta { unsigned int avg_ampdu_len; /* overall sorted rate set */ - u8 max_tp_rate[MAX_THR_RATES]; - u8 max_prob_rate; + u16 max_tp_rate[MAX_THR_RATES]; + u16 max_prob_rate; /* time of last status update */ unsigned long stats_update;