]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: fix missing RX bitrate update for mesh forwarding path
authorSarika Sharma <sarika.sharma@oss.qualcomm.com>
Fri, 24 Oct 2025 04:36:27 +0000 (10:06 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 27 Oct 2025 08:18:19 +0000 (09:18 +0100)
Currently, RX bitrate statistics are not updated for packets received
on the mesh forwarding path during fast RX processing. This results in
incomplete RX rate tracking in station dump outputs for mesh scenarios.

Update ieee80211_invoke_fast_rx() to record the RX rate using
sta_stats_encode_rate() and store it in the last_rate field of
ieee80211_sta_rx_stats when RX_QUEUED is returned from
ieee80211_rx_mesh_data(). This ensures that RX bitrate is properly
accounted for in both RSS and non-RSS paths.

Signed-off-by: Sarika Sharma <sarika.sharma@oss.qualcomm.com>
Link: https://patch.msgid.link/20251024043627.1640447-1-sarika.sharma@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c

index 29175a0c9f688f78d39b3790bfa1ff4a8d2bc231..4641a2a80856ae1b4fd15141b729878bb16b3353 100644 (file)
@@ -4952,6 +4952,11 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
 
        /* after this point, don't punt to the slowpath! */
 
+       if (fast_rx->uses_rss)
+               stats = this_cpu_ptr(rx->link_sta->pcpu_rx_stats);
+       else
+               stats = &rx->link_sta->rx_stats;
+
        if (rx->key && !(status->flag & RX_FLAG_MIC_STRIPPED) &&
            pskb_trim(skb, skb->len - fast_rx->icv_len))
                goto drop;
@@ -4986,6 +4991,8 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
        res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb);
        switch (res) {
        case RX_QUEUED:
+               stats->last_rx = jiffies;
+               stats->last_rate = sta_stats_encode_rate(status);
                return true;
        case RX_CONTINUE:
                break;
@@ -4999,11 +5006,6 @@ static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
  drop:
        dev_kfree_skb(skb);
 
-       if (fast_rx->uses_rss)
-               stats = this_cpu_ptr(rx->link_sta->pcpu_rx_stats);
-       else
-               stats = &rx->link_sta->rx_stats;
-
        stats->dropped++;
        return true;
 }