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:
parent
8ebaa5b0a7
commit
0be6ed1338
|
@ -61,7 +61,7 @@ static bool rssi_threshold_check(struct ieee80211_sub_if_data *sdata,
|
||||||
s32 rssi_threshold = sdata->u.mesh.mshcfg.rssi_threshold;
|
s32 rssi_threshold = sdata->u.mesh.mshcfg.rssi_threshold;
|
||||||
return rssi_threshold == 0 ||
|
return rssi_threshold == 0 ||
|
||||||
(sta &&
|
(sta &&
|
||||||
(s8)-ewma_signal_read(&sta->rx_stats.avg_signal) >
|
(s8)-ewma_signal_read(&sta->rx_stats_avg.signal) >
|
||||||
rssi_threshold);
|
rssi_threshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1455,7 +1455,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
|
||||||
sta->rx_stats.bytes += rx->skb->len;
|
sta->rx_stats.bytes += rx->skb->len;
|
||||||
if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
|
if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
|
||||||
sta->rx_stats.last_signal = status->signal;
|
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) {
|
if (status->chains) {
|
||||||
|
@ -1467,7 +1467,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
sta->rx_stats.chain_signal_last[i] = signal;
|
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);
|
-signal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,9 +341,9 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
|
||||||
sta->reserved_tid = IEEE80211_TID_UNRESERVED;
|
sta->reserved_tid = IEEE80211_TID_UNRESERVED;
|
||||||
|
|
||||||
sta->last_connected = ktime_get_seconds();
|
sta->last_connected = ktime_get_seconds();
|
||||||
ewma_signal_init(&sta->rx_stats.avg_signal);
|
ewma_signal_init(&sta->rx_stats_avg.signal);
|
||||||
for (i = 0; i < ARRAY_SIZE(sta->rx_stats.chain_signal_avg); i++)
|
for (i = 0; i < ARRAY_SIZE(sta->rx_stats_avg.chain_signal); i++)
|
||||||
ewma_signal_init(&sta->rx_stats.chain_signal_avg[i]);
|
ewma_signal_init(&sta->rx_stats_avg.chain_signal[i]);
|
||||||
|
|
||||||
if (local->ops->wake_tx_queue) {
|
if (local->ops->wake_tx_queue) {
|
||||||
void *txq_data;
|
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))) {
|
if (!(sinfo->filled & BIT(NL80211_STA_INFO_SIGNAL_AVG))) {
|
||||||
sinfo->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);
|
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] =
|
sinfo->chain_signal[i] =
|
||||||
sta->rx_stats.chain_signal_last[i];
|
sta->rx_stats.chain_signal_last[i];
|
||||||
sinfo->chain_signal_avg[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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -450,16 +450,18 @@ struct sta_info {
|
||||||
unsigned long fragments;
|
unsigned long fragments;
|
||||||
unsigned long dropped;
|
unsigned long dropped;
|
||||||
int last_signal;
|
int last_signal;
|
||||||
struct ewma_signal avg_signal;
|
|
||||||
u8 chains;
|
u8 chains;
|
||||||
s8 chain_signal_last[IEEE80211_MAX_CHAINS];
|
s8 chain_signal_last[IEEE80211_MAX_CHAINS];
|
||||||
struct ewma_signal chain_signal_avg[IEEE80211_MAX_CHAINS];
|
|
||||||
int last_rate_idx;
|
int last_rate_idx;
|
||||||
u32 last_rate_flag;
|
u32 last_rate_flag;
|
||||||
u32 last_rate_vht_flag;
|
u32 last_rate_vht_flag;
|
||||||
u8 last_rate_vht_nss;
|
u8 last_rate_vht_nss;
|
||||||
u64 msdu[IEEE80211_NUM_TIDS + 1];
|
u64 msdu[IEEE80211_NUM_TIDS + 1];
|
||||||
} rx_stats;
|
} rx_stats;
|
||||||
|
struct {
|
||||||
|
struct ewma_signal signal;
|
||||||
|
struct ewma_signal chain_signal[IEEE80211_MAX_CHAINS];
|
||||||
|
} rx_stats_avg;
|
||||||
|
|
||||||
/* Plus 1 for non-QoS frames */
|
/* Plus 1 for non-QoS frames */
|
||||||
__le16 last_seq_ctrl[IEEE80211_NUM_TIDS + 1];
|
__le16 last_seq_ctrl[IEEE80211_NUM_TIDS + 1];
|
||||||
|
|
Loading…
Reference in New Issue