Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp326850pxj; Thu, 17 Jun 2021 03:44:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3sQU7QnPhT3rovXTz56XnhxH2lz0z640v/y8Fw8rpqkRjm+4U1o4gpp562AnXJxb4TyCi X-Received: by 2002:a17:906:24db:: with SMTP id f27mr4524256ejb.321.1623926641777; Thu, 17 Jun 2021 03:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623926641; cv=none; d=google.com; s=arc-20160816; b=zAEElS4WxaxSH/5NsDgXn5KMKP8l7ifUjYbTg/9SMtbHeFKcPD/CiP8KHmyGPnnMUL hS9n9Vj74KlEJ7lqBy/g20o3iw73XsY8OAtvMMC59IkT5bDy1nDT77E93GuRhRNKUF5+ bxmref6dzJBn8Y8Y4Il5LJ9IQ5krHonNjoZDFZAuZElMx+Qii4pUYTGxXTiOF0VVCzFB G9ibxYmVTPmL+c4Oo9N2sHmsTDXruNTpSzRomqpMRurt/SaPwJd28o1KrgJBnK6RkEqA WEFkP53ygdF5ck7ljeNG1tyH7VWZnvUqdN3dn3e/jQHlGbZwvNj6fFqnhQiw7C88x+Qf Uucg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=88P+mVU+T6x1CWy71RbTkXq1aoDnrH6RLWxo83LbSLY=; b=NdGjs+YpssMo9IM0dCB1b6wDhEonFDXOxQIK+EBx8KFSdixShrxXa5JjfByoUJoedM 43WHwTDdzKV3W8Yd4YeJvjaw6HC/adzpVabHyctrmpoGPRHG+3V4gmDvkayya2LAJoEH uSRS4Y3zP/LjpB9xFkc4/YU7Ra8WSgLKEG06pVXrJKhI732Aw51aL77/DkOZ13Hu9ubM 2c/ZVsMZW2H8d+6Ua8u8FTBtqBitq1p3ccqEfMaFBtT1V0vKvfIUoxgPOgzDL4m449Mj KGF3+42Y+kzrjbexMr1R0tlUiWFPxyISB6LLHvl0Z53eV10px3iIHS6iRn8E+wsUv27M 9C5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=mahF303D; 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 z22si5080718edb.151.2021.06.17.03.43.26; Thu, 17 Jun 2021 03:44:01 -0700 (PDT) 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=mahF303D; 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 S231260AbhFQKlH (ORCPT + 99 others); Thu, 17 Jun 2021 06:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbhFQKlH (ORCPT ); Thu, 17 Jun 2021 06:41:07 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 190C4C061574; Thu, 17 Jun 2021 03:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version: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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=88P+mVU+T6x1CWy71RbTkXq1aoDnrH6RLWxo83LbSLY=; b=mahF303DjtNkHL9cY4B+Hvj3CM EBXccR0lItf6Oo0oxTltJH3T+Hp0uQZMcHKAMzbOtWH88wbUE3PstMxV/Pwozxvo5nQm5CbBV/RHE gQAm8AwBBBp8df4KQFlJzKbRR+3F4Vbmnn+4et8+GtklRn3vZ+OJ8h6eXDbqXR0+CuIQ=; Received: from p54ae9ff2.dip0.t-ipconnect.de ([84.174.159.242] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1ltpQG-0000UO-Rh; Thu, 17 Jun 2021 12:38:57 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, stable@vger.kernel.org Subject: [PATCH 5.13] mac80211: minstrel_ht: fix sample time check Date: Thu, 17 Jun 2021 12:38:54 +0200 Message-Id: <20210617103854.61875-1-nbd@nbd.name> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- net/mac80211/rc80211_minstrel_ht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 6487b05da6fa..a6f3fb4a9197 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -1514,7 +1514,7 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, (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; -- 2.30.1