Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp656926pxv; Thu, 15 Jul 2021 12:39:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS4RLK1KSvMPisgAyos0eTvep2u3W4+Dxh5gc+zkXgiVHnX57Curl7iEgfMw753YmgoDBS X-Received: by 2002:a17:907:170c:: with SMTP id le12mr7518171ejc.288.1626377971192; Thu, 15 Jul 2021 12:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377971; cv=none; d=google.com; s=arc-20160816; b=VIyzoQcnbpA5gSHDepmdGYAdZ4XrK6RZGTVdQcOB2rNQk2mTml1f+IrhrwHDzGHOpg d7sUmKZlyzIRqkyVN517ad+nsMftYyvrbqhaO47/x0KZf/cQLc87TOQnltoL1vmcFd5l Nd1AMQnLMwsYyvSor5/JNx1oAfL7CWyacd4aunhqqwbh45i+0LnKiGwxuwnagC1CaRyQ 05OMMx1UAgrtSqe+IrPbYDKsqkKGjNzH6TnXEmBz107TIp9wP2euJh3NoS5Nq8yCxgbl rH1ZTYpK0AP9NbR64JuGRlUPEWqXnsUaUnDHjhk5kUQKW3TQMIG5rXMGo98XDgClSibt jwjQ== 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=jvynmIYHLHJ13VH6eRR9gRRiKJTN53BkHYsv9uY3hgw=; b=qaAZ80pV6z+xLe7zzj001/kiMZXFb86NdIL6vh4ZaxYoykIpIBc9fmhY/sE83iMMs+ Ipw4LMjm2wAFq33tnqk5JZKEfga7gs5j/CDl5YRYEfSizK+HhyMkTBuuaLP7/syeImkF m1sEka/SFd/z9WzxBnFpnFgJYew2m1UV5kZUuwQjt6G0G7kzeNOzXUP4ud/znUtzlm6a 8jX18ddegM7lnSbT0Gf+aOqg3XTz0OxfS+B4LYMxBCjN81M2GsrmLXp6/DR1G15zCigj cioz8BJk+BY6vDWTVMihl3m6t5P566ZpNFxxQJyy9bDnAZ1ChqW/4UkGLMmdUIzyB+Dd Ia6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OGrvNo36; 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 f25si8028848edu.543.2021.07.15.12.39.08; Thu, 15 Jul 2021 12:39:31 -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=OGrvNo36; 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 S244615AbhGOThf (ORCPT + 99 others); Thu, 15 Jul 2021 15:37:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:50994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241276AbhGOTMt (ORCPT ); Thu, 15 Jul 2021 15:12:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 873DE613DB; Thu, 15 Jul 2021 19:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376155; bh=9VgLUQBs92xOKfCw9yNr7isD9zAUSEpSnUkmlmOKwBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OGrvNo36e6jd4pPQGuQNu3bFwSvMct17/Wycp0lEzNt+FIEN5OD3HvwUcf4xgYJ/g Os6Sr+YvpdxxsiX+4TvSNhRMRkMbU4dQykyDXidVfkOJkFFhgsBSP3ZaBRdQONhD6t LEv5QZKTYJitQTtxIFUFOr/8b86LT2Sgpw1q4ah8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thiraviyam Mariyappan , Johannes Berg , Sasha Levin Subject: [PATCH 5.13 149/266] mac80211: consider per-CPU statistics if present Date: Thu, 15 Jul 2021 20:38:24 +0200 Message-Id: <20210715182639.745551813@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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: Johannes Berg [ Upstream commit d656a4c6ead6c3f252b2f2532bc9735598f7e317 ] If we have been keeping per-CPU statistics, consider them regardless of USES_RSS, because we may not actually fill those, for example in non-fast-RX cases when the connection is not compatible with fast-RX. If we didn't fill them, the additional data will be zero and not affect anything, and if we did fill them then it's more correct to consider them. This fixes an issue in mesh mode where some statistics are not updated due to USES_RSS being set, but fast-RX isn't used. Reported-by: Thiraviyam Mariyappan Link: https://lore.kernel.org/r/20210610220814.13b35f5797c5.I511e9b33c5694e0d6cef4b6ae755c873d7c22124@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/sta_info.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 13250cadb420..e18c3855f616 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -2088,10 +2088,9 @@ static struct ieee80211_sta_rx_stats * sta_get_last_rx_stats(struct sta_info *sta) { struct ieee80211_sta_rx_stats *stats = &sta->rx_stats; - struct ieee80211_local *local = sta->local; int cpu; - if (!ieee80211_hw_check(&local->hw, USES_RSS)) + if (!sta->pcpu_rx_stats) return stats; for_each_possible_cpu(cpu) { @@ -2191,9 +2190,7 @@ static void sta_set_tidstats(struct sta_info *sta, int cpu; if (!(tidstats->filled & BIT(NL80211_TID_STATS_RX_MSDU))) { - if (!ieee80211_hw_check(&local->hw, USES_RSS)) - tidstats->rx_msdu += - sta_get_tidstats_msdu(&sta->rx_stats, tid); + tidstats->rx_msdu += sta_get_tidstats_msdu(&sta->rx_stats, tid); if (sta->pcpu_rx_stats) { for_each_possible_cpu(cpu) { @@ -2272,7 +2269,6 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, sinfo->rx_beacon = sdata->u.mgd.count_beacon_signal; drv_sta_statistics(local, sdata, &sta->sta, sinfo); - sinfo->filled |= BIT_ULL(NL80211_STA_INFO_INACTIVE_TIME) | BIT_ULL(NL80211_STA_INFO_STA_FLAGS) | BIT_ULL(NL80211_STA_INFO_BSS_PARAM) | @@ -2307,8 +2303,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, if (!(sinfo->filled & (BIT_ULL(NL80211_STA_INFO_RX_BYTES64) | BIT_ULL(NL80211_STA_INFO_RX_BYTES)))) { - if (!ieee80211_hw_check(&local->hw, USES_RSS)) - sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats); + sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats); if (sta->pcpu_rx_stats) { for_each_possible_cpu(cpu) { -- 2.30.2