Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9900252pxu; Tue, 29 Dec 2020 08:04:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMoCt8ah+9cuuNWuieHdimfwfaVD8oQ7yqY3Sc/dJ3wkrhXjM9fex1XyzZE2Ma9/Q/0mS0 X-Received: by 2002:aa7:dcd0:: with SMTP id w16mr47135201edu.229.1609257839925; Tue, 29 Dec 2020 08:03:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609257839; cv=none; d=google.com; s=arc-20160816; b=aw4i5VsEqdJQjegUvPUojzX0aq+LBnUCsIWsOavLvnq+xL/TocNZePG/HFd/zVpDv8 Guf1KhANME/JU2U4cGmYc9kZjwJbAbZaGnWZTjx0Ehms9rUvCfUVPrttSzmqngKPK/Ox EKibZ9y4tPoNoLVQkZDmrlnzTlHN5SH07qMaltAzOS/Xl8er836OWZrwbKgCljkCJlKg p1om5rio/n64jDye+VlShhBJZI5oc68a7DlbPmZHhuEA0dSedvL1x0UzTFByPztLzg2O T8dzuakACTMQvQc/akwYtQvy5kBdFulXtkr4KTk60a+DJw8o8Al5399A+s5hGhRKgOym D7PQ== 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=4Cc2WIYX0G5jqvwSfwbMlmVwB7JJTTi0EjZpMo3oQNI=; b=rbs5n/x5Xx0E6gcN5k/8z5NUj4nRCE9nwqD61Fkrp97Y2iLNzNes8eIrBLBJ/t8dpc 2YzJMdNBn+QngDElZGDoJ5fccDDck5st7A0DfKUTMyzZv03OyGrxfKdqmgTiq7uLCyh8 LU8UkJBy8jC+EC6TCydTp0DMdGfPnoqXUmlCk5ew7RWuIoUGjSUjaE9chVIdxhP6reEp j4WmQi59A+ASXjYsqp5A2iAkm8SGI+UxzHQ/sZRGbR54bcB1DGjCK18odQZmdOQ6i06o VqLxhB/N3+eeh/6JEQOazn4QXEaTPJs6EA6wNB1N19mPef2wsnSI+f/Z6HgDWzPgLZr6 lxUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Thfv4HDg; 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 v18si20140091ejb.13.2020.12.29.08.03.37; Tue, 29 Dec 2020 08:03:59 -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=Thfv4HDg; 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 S1726656AbgL2QC1 (ORCPT + 99 others); Tue, 29 Dec 2020 11:02:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbgL2QC0 (ORCPT ); Tue, 29 Dec 2020 11:02:26 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59F41C06179A for ; Tue, 29 Dec 2020 08:01:31 -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=4Cc2WIYX0G5jqvwSfwbMlmVwB7JJTTi0EjZpMo3oQNI=; b=Thfv4HDgiDx8fATXrmvBzEegrs bI9mFlrhpIaNAJggKI1oczkV4QnV1xO2KhSv3cUzLzUNdIALltaJnVbtWmG/stZysKEeNaAnZdlIo qsIzYJSu5JKWBHLoRiA0Tr0qH1JhR9l4+OXNvzm2abYz+Ky4Ijc8DGWE+UupmBF4hCu8=; 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 1kuHRA-0005ka-IN; Tue, 29 Dec 2020 17:01:28 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH 6/8] mac80211: minstrel_ht: improve sample rate selection Date: Tue, 29 Dec 2020 17:01:23 +0100 Message-Id: <20201229160125.92794-6-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201229160125.92794-1-nbd@nbd.name> References: <20201229160125.92794-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 950e6d2b4525..dcc4394a872a 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