Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp315242pxb; Fri, 15 Jan 2021 04:08:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBR0t36ElzUyrQjDNwG2KzabhaVOS+QRQOyearLKoUgWC6j82cRsjBqCtRF4/nEYf0H9u/ X-Received: by 2002:a17:906:c7d9:: with SMTP id dc25mr8782924ejb.138.1610712493030; Fri, 15 Jan 2021 04:08:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610712493; cv=none; d=google.com; s=arc-20160816; b=KN+xEOBJoa3xlFyIWu4lKtHYof6pBB4zIUM+uPF1Qtmf4jJTgjUwcegESydGqizHfy 6nmMrTWy6+OS3Nt43l3UYhVYU8ksdOSMrx/OyUqZ3+aNNTEIL41F1+gdl+foy35IdcAc uQUHXGo1PFSwnqOBEKO/tJGaoPJDtA+FEOhrfI/Kfu8OEs8QLSqF0F4HUOcVtGK8bGLI C1uEWzf8Zt93ENZ57etA2lDqPLAKKbRejq/+EmbEQ+zCgoybx7YNLOknbnNSce5MU+pM vUYBbrBoKqfEZAtjtNxsqLbq1Ag9EOq9hSUwey7miJkgvBdsiEw4rPj3ynVWIR/QmwJi AbRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Rq3gq4RyV7FSvf2OBOhD4HjvRyFRLwP4U7dMtG2ytI8=; b=cdhulvSgKQVgN/MH9teUFcB95TctwvaeiQ0w5OdgNsYM5gFdNObbtFXLFqxKJunex1 aE22WxUKkc8+u2aB+mRwuXdoNTS1mGqf9r3ZmI9yYsbr1A7p7QzrsBO/Jk2ZiQeYtA9g AmgIyoz3HvJX1js+SpQLUYG9V38nF0EqlOn64/QwP4lLb06Uh/7DW+e5rvWee2nr1QFY lfvdJy0HJ/ilivnTAFLWMVHrjPX/2IgQE6VeKjpsg5lGj6BA4OWgu0HD+y8+2p5TE0q1 3v3a26I3jVCLcVSe7e7gXajcmg1pgHRMehkz1YfmxlQRoYnnYj33k+F9WXba1QRur/1J zl5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=c+M+Si+y; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j4si3605020ejf.307.2021.01.15.04.07.49; Fri, 15 Jan 2021 04:08:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=c+M+Si+y; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726137AbhAOMDw (ORCPT + 99 others); Fri, 15 Jan 2021 07:03:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726370AbhAOMDv (ORCPT ); Fri, 15 Jan 2021 07:03:51 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A96FAC061799 for ; Fri, 15 Jan 2021 04:02:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=Rq3gq4RyV7FSvf2OBOhD4HjvRyFRLwP4U7dMtG2ytI8=; b=c+M+Si+yt/SbnvJuBBiWSOPFcv 51EqK5kCKqQ+9VHQm12olwZKJP2+gCMARh2AatYLKknVc4xNTjbz5XDV7QtBWCDmwhLV/+tlOBUVy iPP3ayfaKu271cVMEtw3qijcnwQqdKPk8Mgs8HkbcPAWg8f8s3+uWpHSJbWyMLhtrG1k=; Received: from p54ae91f2.dip0.t-ipconnect.de ([84.174.145.242] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1l0NoU-0006Y0-Mi; Fri, 15 Jan 2021 13:02:46 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v3 6/9] mac80211: minstrel_ht: improve sample rate selection Date: Fri, 15 Jan 2021 13:02:39 +0100 Message-Id: <20210115120242.89616-7-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210115120242.89616-1-nbd@nbd.name> References: <20210115120242.89616-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Always allow sampling of rates faster than the primary max throughput rate. When the second max_tp_rate is higher than the first one, sample attempts were previously skipped, potentially causing rate control to get stuck at a slightly lower rate Signed-off-by: Felix Fietkau --- net/mac80211/rc80211_minstrel_ht.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 5b20e17ec2e6..58f7400b78b2 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -1379,13 +1379,13 @@ minstrel_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi) mrs = &mg->rates[sample_idx]; sample_idx += sample_group * MCS_GROUP_RATES; - /* Set tp_rate1, tp_rate2 to the highest / second highest max_tp_rate */ + tp_rate1 = mi->max_tp_rate[0]; + + /* Set tp_rate2 to the second highest max_tp_rate */ if (minstrel_get_duration(mi->max_tp_rate[0]) > minstrel_get_duration(mi->max_tp_rate[1])) { - tp_rate1 = mi->max_tp_rate[1]; tp_rate2 = mi->max_tp_rate[0]; } else { - tp_rate1 = mi->max_tp_rate[0]; tp_rate2 = mi->max_tp_rate[1]; } -- 2.28.0