Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3828676ybl; Tue, 20 Aug 2019 02:57:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUXOzAXwMXzrNLQXJ9ZTyzXHlkvO6hoEhKeWSOcZfuSoQK/0iu7dQ2y7cAXTceMIOoiNHi X-Received: by 2002:a17:902:141:: with SMTP id 59mr27988687plb.324.1566295024602; Tue, 20 Aug 2019 02:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566295024; cv=none; d=google.com; s=arc-20160816; b=0sOQ5uPT8GZiQqKmmzBIVPxtZZ2VRpRAXBAX2Vl24FAK9+qbrmNFIYaQoRaw1ucORe 8DIb5u9fi+jEpZ1p1C5a+wu2XmVHnYkPLEP31v96v9ZAUMv1zNGhsY4lxxAZrjsJhlYw QCp514injLP4DwKlaTF7g2KyOgB2eS6QLCRZInp/7hK2vSOh0koRJCRnk16SpF6imS9l cT9eo+u++JIjqaZq3mh784zopTriZPVxTVF74ECS4hoGCdJYwc0JZhNfw+KGzk1mYdo2 C2WaEa6k06pazPriElaBJGTm4B6WQM0xpz1sAaXejx/AkqMoeyJ6N7ILx7TYto36LO+g whyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=sbJGifAP2hJqOW3Xo1SlJAcr8ALTVQTYf9HL5FatkPg=; b=KT4YIy7UDkHVXnTIUcY3gc3x9V2/cbO2Pstxen0KkFiFd3GLdTjhwJn/X2kbv/ZhY5 Fl/KeYZIzXQ10pU/l4w2hd3BTz8uAr/dKI6DZDdjFpahhZA+rpquTaddqLbxC33TqN/I UJiDkBqLbWgGB3R+unAF9jE5dhgNe1sN5/4HPTylObLmOygCbmh53897l6ixoaXCs3Ns UnaCsko2FUAtTP/9Kz/LpWxYGfEVqzyxfs6V6uM2lxphYvXmkV6qpwlrmPfCNSahDfKR rEgSwPRNYOJRd7yBhuByWqdGtSzhymqWckQ2BuABEl50cfduoTQp/4yqpy4/NG3w8NZH o/vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=aigo6H0l; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l186si11515750pgd.455.2019.08.20.02.56.49; Tue, 20 Aug 2019 02:57:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=aigo6H0l; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729383AbfHTJyv (ORCPT + 99 others); Tue, 20 Aug 2019 05:54:51 -0400 Received: from nbd.name ([46.4.11.11]:35126 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728426AbfHTJyv (ORCPT ); Tue, 20 Aug 2019 05:54:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sbJGifAP2hJqOW3Xo1SlJAcr8ALTVQTYf9HL5FatkPg=; b=aigo6H0lvuwf8n6qHtEd5NBwle qQszuQuXw5eUKAyh73tTrIMNSF5j1CG4qOTBcPTHB0ZjEwTvvoyhL1t0S5fWIO2waXcO2BjvAXdXC 7NABYcNZINUF36HnZD76yeNo53yYDAxqPufFVh0SAtwU12osU3oeTWzu9wZsk8y5p5M0=; Received: from p54ae9443.dip0.t-ipconnect.de ([84.174.148.67] helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i00qn-0003nw-VR; Tue, 20 Aug 2019 11:54:50 +0200 Received: by maeck.local (Postfix, from userid 501) id 57C3763E610D; Tue, 20 Aug 2019 11:54:49 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH 3/4] mac80211: minstrel_ht: fix default max throughput rate indexes Date: Tue, 20 Aug 2019 11:54:48 +0200 Message-Id: <20190820095449.45255-3-nbd@nbd.name> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190820095449.45255-1-nbd@nbd.name> References: <20190820095449.45255-1-nbd@nbd.name> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Use the first supported rate instead of 0 (which can be invalid) Signed-off-by: Felix Fietkau --- net/mac80211/rc80211_minstrel_ht.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index ad5da9a71da0..c5868a1de306 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -486,7 +486,7 @@ minstrel_ht_assign_best_tp_rates(struct minstrel_ht_sta *mi, tmp_prob = mi->groups[tmp_group].rates[tmp_idx].prob_ewma; tmp_mcs_tp = minstrel_ht_get_tp_avg(mi, tmp_group, tmp_idx, tmp_prob); - if (tmp_cck_tp > tmp_mcs_tp) { + if (tmp_cck_tp_rate && tmp_cck_tp > tmp_mcs_tp) { for(i = 0; i < MAX_THR_RATES; i++) { minstrel_ht_sort_best_tp_rates(mi, tmp_cck_tp_rate[i], tmp_mcs_tp_rate); @@ -558,11 +558,19 @@ minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) mi->sample_slow = 0; mi->sample_count = 0; - /* Initialize global rate indexes */ - for(j = 0; j < MAX_THR_RATES; j++){ - tmp_mcs_tp_rate[j] = 0; - tmp_cck_tp_rate[j] = 0; - } + memset(tmp_mcs_tp_rate, 0, sizeof(tmp_mcs_tp_rate)); + memset(tmp_cck_tp_rate, 0, sizeof(tmp_cck_tp_rate)); + if (mi->supported[MINSTREL_CCK_GROUP]) + for (j = 0; j < ARRAY_SIZE(tmp_cck_tp_rate); j++) + tmp_cck_tp_rate[j] = MINSTREL_CCK_GROUP * MCS_GROUP_RATES; + + if (mi->supported[MINSTREL_VHT_GROUP_0]) + index = MINSTREL_VHT_GROUP_0 * MCS_GROUP_RATES; + else + index = MINSTREL_HT_GROUP_0 * MCS_GROUP_RATES; + + for (j = 0; j < ARRAY_SIZE(tmp_mcs_tp_rate); j++) + tmp_mcs_tp_rate[j] = index; /* Find best rate sets within all MCS groups*/ for (group = 0; group < ARRAY_SIZE(minstrel_mcs_groups); group++) { -- 2.17.0