Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3943521pxj; Mon, 21 Jun 2021 09:54:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfKzovqCaSfQX9vYHG6eEiAVWl5ooNay5h+rE+5kYnRvqgfx2ux0qqAkYSOCqULJ1BDyS4 X-Received: by 2002:aa7:cb9a:: with SMTP id r26mr3093152edt.78.1624294449128; Mon, 21 Jun 2021 09:54:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624294449; cv=none; d=google.com; s=arc-20160816; b=HgS3AS1ZQWrpoSbd6oGsu4x2BqR9kSXYekO6btDww2HfyEwa+EjE4KYNUKA9asCyGZ z3+4uNozYRI1lhy2650oHqYUVpuhiv4wQJsj4BIuLyWty85+qYMft8YcgK1RPQf1+XiY Oz+0BWy2ZKw7F3mwEN7mlfDc4QHKbr43buLp/3A8D5REK6y23//H0gDvZMsV9e1piB2+ cFBGyUjSK3mXdIQURXWoTYHMXvBBuP02udVS23RvDbxLI93QG6fuNNjlSd4JQdQVlipR lHLm1/y/vg810rFg1yDC9N79CwxZVM7/eNxefmz+O6ytXAgc0caMQIQnpQ1V9T6g0k/W YDxw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VZS5ihqcqhpmg52Uu7zKtT1fOkeTCHpvzj6H2V0mD2Y=; b=B5E21cCP+EezhNo3OtTLAvj6FER+oX9T8Bcg6J+7tYpbzHG4YJxNQ4Zh6RJEUc0Rm7 sL1EYoZEOhG9uHJBk6uWrIHTMZcgsyPYcBbfscRH7lUJreYA0+5OVuXFep0n33JWIgQW SUk5Zp6jm/sDt2DjATaHPPrug/MvOvSqBByGEb/TXYXrXhdtQtJKqkFUb/MhVYTUH3WD MJFje2rMxnq2WlGUMrko/MLmN8jWtCwxJXNmXiABn0kmDVKxxakXsCIUTjZH6t+tlzoi atBpBjC4CvJ33WDG9c0WCJqsUMBeu/+4HJpZHyHyHauj/q3pv75sHijfI/3ehgZweYnV VFIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p6OcJPoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la20si12830842ejc.3.2021.06.21.09.53.47; Mon, 21 Jun 2021 09:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p6OcJPoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230381AbhFUQxG (ORCPT + 99 others); Mon, 21 Jun 2021 12:53:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:41158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232973AbhFUQtH (ORCPT ); Mon, 21 Jun 2021 12:49:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6FBD261459; Mon, 21 Jun 2021 16:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624293260; bh=Abcu7R72Y+ESvSiana/X/2E5PeEUfqnt9bI4nmFOqFA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p6OcJPoBfp/YR1+eiZ0l+f7+NJBhbgL42tYyrtypU168thtOndG4pKDWnu7cZwJGI YJa/sO29FLOzR3U8jjXlCXilbnJU6pdLmJW7u5AGkolEOAemlBnbWhpAHcLeIisFwd N6Ckeu82TDL3Zpe18O/AaEX7CKUSNrcC0OLs3a3A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau , Johannes Berg Subject: [PATCH 5.12 157/178] mac80211: minstrel_ht: fix sample time check Date: Mon, 21 Jun 2021 18:16:11 +0200 Message-Id: <20210621154928.100445782@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Felix Fietkau commit 1236af327af476731aa548dfcbbefb1a3ec6726a upstream. We need to skip sampling if the next sample time is after jiffies, not before. This patch fixes an issue where in some cases only very little sampling (or none at all) is performed, leading to really bad data rates Fixes: 80d55154b2f8 ("mac80211: minstrel_ht: significantly redesign the rate probing strategy") Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20210617103854.61875-1-nbd@nbd.name Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/rc80211_minstrel_ht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -1516,7 +1516,7 @@ minstrel_ht_get_rate(void *priv, struct (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO)) return; - if (time_is_before_jiffies(mi->sample_time)) + if (time_is_after_jiffies(mi->sample_time)) return; mi->sample_time = jiffies + MINSTREL_SAMPLE_INTERVAL;