Skip to content

Commit d656a4c

Browse files
committed
mac80211: consider per-CPU statistics if present
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 <tmariyap@codeaurora.org> Link: https://lore.kernel.org/r/20210610220814.13b35f5797c5.I511e9b33c5694e0d6cef4b6ae755c873d7c22124@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 9df66d5 commit d656a4c

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

‎net/mac80211/sta_info.c‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,10 +2093,9 @@ static struct ieee80211_sta_rx_stats *
20932093
sta_get_last_rx_stats(struct sta_info *sta)
20942094
{
20952095
struct ieee80211_sta_rx_stats *stats = &sta->rx_stats;
2096-
struct ieee80211_local *local = sta->local;
20972096
int cpu;
20982097

2099-
if (!ieee80211_hw_check(&local->hw, USES_RSS))
2098+
if (!sta->pcpu_rx_stats)
21002099
return stats;
21012100

21022101
for_each_possible_cpu(cpu) {
@@ -2196,9 +2195,7 @@ static void sta_set_tidstats(struct sta_info *sta,
21962195
int cpu;
21972196

21982197
if (!(tidstats->filled & BIT(NL80211_TID_STATS_RX_MSDU))) {
2199-
if (!ieee80211_hw_check(&local->hw, USES_RSS))
2200-
tidstats->rx_msdu +=
2201-
sta_get_tidstats_msdu(&sta->rx_stats, tid);
2198+
tidstats->rx_msdu += sta_get_tidstats_msdu(&sta->rx_stats, tid);
22022199

22032200
if (sta->pcpu_rx_stats) {
22042201
for_each_possible_cpu(cpu) {
@@ -2277,7 +2274,6 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
22772274
sinfo->rx_beacon = sdata->u.mgd.count_beacon_signal;
22782275

22792276
drv_sta_statistics(local, sdata, &sta->sta, sinfo);
2280-
22812277
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_INACTIVE_TIME) |
22822278
BIT_ULL(NL80211_STA_INFO_STA_FLAGS) |
22832279
BIT_ULL(NL80211_STA_INFO_BSS_PARAM) |
@@ -2312,8 +2308,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo,
23122308

23132309
if (!(sinfo->filled & (BIT_ULL(NL80211_STA_INFO_RX_BYTES64) |
23142310
BIT_ULL(NL80211_STA_INFO_RX_BYTES)))) {
2315-
if (!ieee80211_hw_check(&local->hw, USES_RSS))
2316-
sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats);
2311+
sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats);
23172312

23182313
if (sta->pcpu_rx_stats) {
23192314
for_each_possible_cpu(cpu) {

0 commit comments

Comments
 (0)