mac80211: move averaged values out of rx_stats

Move the averaged values out of rx_stats and into rx_stats_avg,
to cleanly split them out. The averaged ones cannot be supported
for parallel RX in a per-CPU fashion, while the other values can
be collected per CPU and then combined/selected when needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2016-03-31 20:02:05 +03:00
parent 8ebaa5b0a7
commit 0be6ed1338
4 changed files with 12 additions and 10 deletions

View File

@ -61,7 +61,7 @@ static bool rssi_threshold_check(struct ieee80211_sub_if_data *sdata,
s32 rssi_threshold = sdata->u.mesh.mshcfg.rssi_threshold;
return rssi_threshold == 0 ||
(sta &&
(s8)-ewma_signal_read(&sta->rx_stats.avg_signal) >
(s8)-ewma_signal_read(&sta->rx_stats_avg.signal) >
rssi_threshold);
}

View File

@ -1455,7 +1455,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
sta->rx_stats.bytes += rx->skb->len;
if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
sta->rx_stats.last_signal = status->signal;
ewma_signal_add(&sta->rx_stats.avg_signal, -status->signal);
ewma_signal_add(&sta->rx_stats_avg.signal, -status->signal);
}
if (status->chains) {
@ -1467,7 +1467,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
continue;
sta->rx_stats.chain_signal_last[i] = signal;
ewma_signal_add(&sta->rx_stats.chain_signal_avg[i],
ewma_signal_add(&sta->rx_stats_avg.chain_signal[i],
-signal);
}
}

View File

@ -341,9 +341,9 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
sta->reserved_tid = IEEE80211_TID_UNRESERVED;
sta->last_connected = ktime_get_seconds();
ewma_signal_init(&sta->rx_stats.avg_signal);
for (i = 0; i < ARRAY_SIZE(sta->rx_stats.chain_signal_avg); i++)
ewma_signal_init(&sta->rx_stats.chain_signal_avg[i]);
ewma_signal_init(&sta->rx_stats_avg.signal);
for (i = 0; i < ARRAY_SIZE(sta->rx_stats_avg.chain_signal); i++)
ewma_signal_init(&sta->rx_stats_avg.chain_signal[i]);
if (local->ops->wake_tx_queue) {
void *txq_data;
@ -2056,7 +2056,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
if (!(sinfo->filled & BIT(NL80211_STA_INFO_SIGNAL_AVG))) {
sinfo->signal_avg =
-ewma_signal_read(&sta->rx_stats.avg_signal);
-ewma_signal_read(&sta->rx_stats_avg.signal);
sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL_AVG);
}
}
@ -2072,7 +2072,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
sinfo->chain_signal[i] =
sta->rx_stats.chain_signal_last[i];
sinfo->chain_signal_avg[i] =
-ewma_signal_read(&sta->rx_stats.chain_signal_avg[i]);
-ewma_signal_read(&sta->rx_stats_avg.chain_signal[i]);
}
}

View File

@ -450,16 +450,18 @@ struct sta_info {
unsigned long fragments;
unsigned long dropped;
int last_signal;
struct ewma_signal avg_signal;
u8 chains;
s8 chain_signal_last[IEEE80211_MAX_CHAINS];
struct ewma_signal chain_signal_avg[IEEE80211_MAX_CHAINS];
int last_rate_idx;
u32 last_rate_flag;
u32 last_rate_vht_flag;
u8 last_rate_vht_nss;
u64 msdu[IEEE80211_NUM_TIDS + 1];
} rx_stats;
struct {
struct ewma_signal signal;
struct ewma_signal chain_signal[IEEE80211_MAX_CHAINS];
} rx_stats_avg;
/* Plus 1 for non-QoS frames */
__le16 last_seq_ctrl[IEEE80211_NUM_TIDS + 1];