Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp708782pxv; Thu, 15 Jul 2021 14:05:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzu6oUwiTOET5rM+izJn/NQO2f5Sa3++DFKjDKXMDMCselMK+nn0xjY4OOTgz3xvVZrSnAr X-Received: by 2002:a1c:1d8e:: with SMTP id d136mr6628012wmd.52.1626383123627; Thu, 15 Jul 2021 14:05:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383123; cv=none; d=google.com; s=arc-20160816; b=KG87hjJHztcFt+yxxTpGpYIYyVgb7DR49atNFA9A2KtF+y3/nqrDC9pM+DSeIAEyLt H6BrJnlP8q44QwknlPw8rUMILeoPXLKf+mKz3lf/Dt9Y+Qytr+53TbWXCJglaaMBic+S pi3rNHm6oO3aGPdfL3KZVAlYoLxBGjpYGDmrVKDw4PDsuC5r2BKCB4+Y3FQ0fbeBLJ4M BKrqnoJw6LCoCPTGEZtWhZvjT3SMP4noy0zmUWF8KFPFO0sB3WzYDhyHpW10hCq7L7+G mMLQFPlYiLv91igmq3C69dbB6nbLdEGcym2tdml7ZpUSWD7pqoDSJSz4DeQANTtP3ssd Jm3Q== 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=kJIqrUfJXS4XoMFbRLVGVue+1lBW801fedvmJPFfXtaiKHUk1NwyEIqsX7OjsfHt5Q QZtYcNKRLZRwS6HFYOujIbCF6Q4RyM6JxBUfJq0z26jvt/oqmQb6fOVaN+kqeX1CESUx JeTOi9i+oL+EPyDRWIt1/Q3wDWdaZqswYkHG7lduDlddObS8uVTgkSBVZJI6FuKUVZei A7BQkR3N+IYHMyCTCSE4rvvSsFIh4MhuO2IJ7dpFd919eB3uCnd0dUQwcqtn4WTJsirW 9ft3apVSlyzgRkTzEbx3o4+dbw3KuLdReLYq2wGIKocmMhyT5Uul6Kr1zRTGIocJ3236 am6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ub3t5N81; 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 qh5si8404200ejb.72.2021.07.15.14.05.00; Thu, 15 Jul 2021 14:05:23 -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=ub3t5N81; 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 S242861AbhGOTQJ (ORCPT + 99 others); Thu, 15 Jul 2021 15:16:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:38918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243278AbhGOTBy (ORCPT ); Thu, 15 Jul 2021 15:01:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 18CAC601FE; Thu, 15 Jul 2021 18:58:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375529; bh=9VgLUQBs92xOKfCw9yNr7isD9zAUSEpSnUkmlmOKwBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ub3t5N81Gt6fk7vEsBhk1H9dFblMezP7Rf72lRsHntxfRAXYeId4UqUfrKZlM3B7p M910xd+egCCPG8YjE5LISmSnGpuiv+vqWpz1JS5F/UzcE/M8UFFqf5tRjhLIEJrRkJ 8SdQhzcSfCslQV9Kif8DXj/nwC0r2fRi9AneW2Vc= 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.12 127/242] mac80211: consider per-CPU statistics if present Date: Thu, 15 Jul 2021 20:38:09 +0200 Message-Id: <20210715182615.394880851@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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