Commit 43635a5a authored by Vasanthakumar Thiagarajan's avatar Vasanthakumar Thiagarajan Committed by Johannes Berg

wifi: mac80211: use the corresponding link for stats update

With link_id reported in rx_status for MLO connection, do the
stats update on the appropriate link instead of always deflink.
Signed-off-by: default avatarVasanthakumar Thiagarajan <quic_vthiagar@quicinc.com>
Link: https://lore.kernel.org/r/20220817104213.2531-3-quic_vthiagar@quicinc.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent ea9d807b
...@@ -4522,19 +4522,30 @@ static void ieee80211_rx_8023(struct ieee80211_rx_data *rx, ...@@ -4522,19 +4522,30 @@ static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
struct ieee80211_sta_rx_stats *stats; struct ieee80211_sta_rx_stats *stats;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
struct sta_info *sta = rx->sta; struct sta_info *sta = rx->sta;
struct link_sta_info *link_sta;
struct sk_buff *skb = rx->skb; struct sk_buff *skb = rx->skb;
void *sa = skb->data + ETH_ALEN; void *sa = skb->data + ETH_ALEN;
void *da = skb->data; void *da = skb->data;
stats = &sta->deflink.rx_stats; if (rx->link_id >= 0) {
link_sta = rcu_dereference(sta->link[rx->link_id]);
if (WARN_ON_ONCE(!link_sta)) {
dev_kfree_skb(rx->skb);
return;
}
} else {
link_sta = &sta->deflink;
}
stats = &link_sta->rx_stats;
if (fast_rx->uses_rss) if (fast_rx->uses_rss)
stats = this_cpu_ptr(sta->deflink.pcpu_rx_stats); stats = this_cpu_ptr(link_sta->pcpu_rx_stats);
/* statistics part of ieee80211_rx_h_sta_process() */ /* statistics part of ieee80211_rx_h_sta_process() */
if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) { if (!(status->flag & RX_FLAG_NO_SIGNAL_VAL)) {
stats->last_signal = status->signal; stats->last_signal = status->signal;
if (!fast_rx->uses_rss) if (!fast_rx->uses_rss)
ewma_signal_add(&sta->deflink.rx_stats_avg.signal, ewma_signal_add(&link_sta->rx_stats_avg.signal,
-status->signal); -status->signal);
} }
...@@ -4550,7 +4561,7 @@ static void ieee80211_rx_8023(struct ieee80211_rx_data *rx, ...@@ -4550,7 +4561,7 @@ static void ieee80211_rx_8023(struct ieee80211_rx_data *rx,
stats->chain_signal_last[i] = signal; stats->chain_signal_last[i] = signal;
if (!fast_rx->uses_rss) if (!fast_rx->uses_rss)
ewma_signal_add(&sta->deflink.rx_stats_avg.chain_signal[i], ewma_signal_add(&link_sta->rx_stats_avg.chain_signal[i],
-signal); -signal);
} }
} }
...@@ -4626,7 +4637,8 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx, ...@@ -4626,7 +4637,8 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
u8 da[ETH_ALEN]; u8 da[ETH_ALEN];
u8 sa[ETH_ALEN]; u8 sa[ETH_ALEN];
} addrs __aligned(2); } addrs __aligned(2);
struct ieee80211_sta_rx_stats *stats = &sta->deflink.rx_stats; struct link_sta_info *link_sta;
struct ieee80211_sta_rx_stats *stats;
/* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write /* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write
* to a common data structure; drivers can implement that per queue * to a common data structure; drivers can implement that per queue
...@@ -4727,8 +4739,19 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx, ...@@ -4727,8 +4739,19 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
return true; return true;
drop: drop:
dev_kfree_skb(skb); dev_kfree_skb(skb);
if (rx->link_id >= 0) {
link_sta = rcu_dereference(sta->link[rx->link_id]);
if (!link_sta)
return true;
} else {
link_sta = &sta->deflink;
}
if (fast_rx->uses_rss) if (fast_rx->uses_rss)
stats = this_cpu_ptr(sta->deflink.pcpu_rx_stats); stats = this_cpu_ptr(link_sta->pcpu_rx_stats);
else
stats = &link_sta->rx_stats;
stats->dropped++; stats->dropped++;
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment