]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: correct RX stats packet increment for multi-link
authorSarika Sharma <quic_sarishar@quicinc.com>
Wed, 28 May 2025 05:44:19 +0000 (11:14 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 24 Jun 2025 13:19:27 +0000 (15:19 +0200)
Currently, RX stats packets are incremented for deflink member for
non-ML and multi-link(ML) station case. However, for ML station,
packets should be incremented based on the specific link.

Therefore, if a valid link_id is present, fetch the corresponding
link station information and increment the RX packets for that link.
For non-MLO stations, the deflink will still be used.

Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
Link: https://patch.msgid.link/20250528054420.3050133-10-quic_sarishar@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c

index e73431549ce77e29346ee8f4d1273a18bef81991..8699755081ad6c5915910166f183acfce3189117 100644 (file)
@@ -231,8 +231,19 @@ static void __ieee80211_queue_skb_to_iface(struct ieee80211_sub_if_data *sdata,
 
        skb_queue_tail(&sdata->skb_queue, skb);
        wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work);
-       if (sta)
-               sta->deflink.rx_stats.packets++;
+       if (sta) {
+               struct link_sta_info *link_sta_info;
+
+               if (link_id >= 0) {
+                       link_sta_info = rcu_dereference(sta->link[link_id]);
+                       if (!link_sta_info)
+                               return;
+               } else {
+                       link_sta_info = &sta->deflink;
+               }
+
+               link_sta_info->rx_stats.packets++;
+       }
 }
 
 static void ieee80211_queue_skb_to_iface(struct ieee80211_sub_if_data *sdata,