[PATCH] mac80211: fix rx byte values not updated on mesh link
Johannes Berg
johannes at sipsolutions.net
Wed Dec 2 03:23:57 EST 2020
On Wed, 2020-12-02 at 10:25 +0530, Thiraviyam Mariyappan wrote:
> In mesh link, rx byte values were not updating though rx packets keep
> increasing in the station dump. This is because of rx_stats were updated
> regardless of USES_RSS flag is enabled/disabled. Solved the issue by
> updating the rx_stats from percpu pointers according to the USES_RSS flag
You should write commit logs in imperative voice, e.g. "Solve the
issue..."
> +++ b/net/mac80211/rx.c
> @@ -2212,6 +2212,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
> unsigned int frag, seq;
> struct ieee80211_fragment_entry *entry;
> struct sk_buff *skb;
> + struct ieee80211_sta_rx_stats *stats;
>
> hdr = (struct ieee80211_hdr *)rx->skb->data;
> fc = hdr->frame_control;
> @@ -2340,8 +2341,12 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
> out:
> ieee80211_led_rx(rx->local);
> out_no_led:
> - if (rx->sta)
> - rx->sta->rx_stats.packets++;
> + if (rx->sta) {
> + stats = &rx->sta->rx_stats;
> + if (ieee80211_hw_check(&rx->sdata->local->hw, USES_RSS))
> + stats = this_cpu_ptr(rx->sta->pcpu_rx_stats);
> + stats->packets++;
> + }
> return RX_CONTINUE;
>
This is certainly not only related to mesh, so the commit log is wrong.
Also, let's not copy/paste this code so much ...
johannes
More information about the ath11k
mailing list