Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13179177pxu; Sun, 3 Jan 2021 05:10:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9zQS322AXJcDmsnSJjNd44aN8ny9gCaHNNMJtWNUNVcEHMlcu65P8Zv1HVELnbUCPRGaT X-Received: by 2002:a50:998f:: with SMTP id m15mr52279825edb.342.1609679426828; Sun, 03 Jan 2021 05:10:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609679426; cv=none; d=google.com; s=arc-20160816; b=fn087VfApdasYdJo127ZY2H5yZqFV+ccmsCMq/AQ+oX+1aMFIuQy0woOSLbZ9O+L53 OXWCswmCChvCdcXRTtxBTEBYuqF4bycy52z++tpzVqcV2KHSsZ2tGl1xsB0O+B/cc9t7 Wiz8tm82saiz23PcUz71UVzWxvgboLmw2td//QG+BKNh+gQP2+Zon7qhfS9IqYUcXWGT YSRBpPPqfNT0YNiz6voWhqBHyWXgj+0pPqtj13WiKtD2wy/Mz+AFxCfu6BLqPXF9jz/d X04Vs8jhud/IZl/jwoGAFffPN+7vUznjomr1AB1NKpgOUZN0yG0UAyRY/NJ3O7Q82PZP +9sw== 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=Slu1eBCYnJmQvxfXtekts8XLkx/aWdJ122wBZaAXkps0QERTEa1ZK0vtFVZZFjhP0T OBbL+TLS+ikrOqWdc2AVtr0rXvjz8CWFywOebtCcmLAFo1PAhzBcx8buReVp0girZjeq +zi1vUXQe8xsHrbWj06NQUam+QMGXd5XEdmtPXGPt83YxEmokUeMV9N7UERSTU4VFtiR ek/WfJT4OuNCBtszxgYG3mXgTtk0ruD26Rdo4R/J2xltAUn5jQyZbFlXk+BoM8CylJoa XdUvl2vT5UQ8qlvVt8KOufH//yy/qgOqu9cvFmcTnN39F++wAr7UxBtCQiBj0ituCJQd hY3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=gWzGm4l1; 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 r9si28448335ejb.246.2021.01.03.05.10.04; Sun, 03 Jan 2021 05:10:26 -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=gWzGm4l1; 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 S1726523AbhACLwm (ORCPT + 99 others); Sun, 3 Jan 2021 06:52:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726248AbhACLwl (ORCPT ); Sun, 3 Jan 2021 06:52:41 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5E34C0613D3 for ; Sun, 3 Jan 2021 03:51:45 -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=gWzGm4l1oX0sZTP0Ixfx+/5RPY nQDA/6NcZ3DzSHmTCIYTz1huP9itQt+yfaz8ePnTDGU487OYO1EedtZEde5aeOFeHE0AixLH+zdYR zONVfMKccPrvj1vkid5EB1FMHuj6inu88XeOphbIDGVh6N0RfUnvhXg4YYTAS8jJVMjk=; 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 1kw1vD-0000gv-3s; Sun, 03 Jan 2021 12:51:43 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v2 6/8] mac80211: minstrel_ht: improve sample rate selection Date: Sun, 3 Jan 2021 12:51:38 +0100 Message-Id: <20210103115140.18614-6-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210103115140.18614-1-nbd@nbd.name> References: <20210103115140.18614-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