Skip to contentSkip to conversation

mac80211: fix rx byte values not updated on mesh link

PATCH In review Thiraviyam Mariyappan 2 participants 2 messages Dec 2, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: fix rx byte values not updated on mesh link

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

---
 net/mac80211/mesh_plink.c |  6 +++++-
 net/mac80211/rx.c         | 44 ++++++++++++++++++++++++++++++++++----------
 2 files changed, 39 insertions(+), 11 deletions(-)
net/mac80211/mesh_plink.c +5 -1
index aca26df..e840277 100644
@@ -416,6 +416,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
 	struct ieee80211_supported_band *sband;
 	u32 rates, basic_rates = 0, changed = 0;
 	enum ieee80211_sta_rx_bandwidth bw = sta->sta.bandwidth;
+	struct ieee80211_sta_rx_stats *stats;
 
 	sband = ieee80211_get_sband(sdata);
 	if (!sband)
@@ -425,7 +426,10 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
 					&basic_rates);
 
 	spin_lock_bh(&sta->mesh->plink_lock);
-	sta->rx_stats.last_rx = jiffies;
+	stats = &sta->rx_stats;
+	if (ieee80211_hw_check(&local->hw, USES_RSS))
+		stats = this_cpu_ptr(sta->pcpu_rx_stats);
+	stats->last_rx = jiffies;
 
 	/* rates and capabilities don't change during peering */
 	if (sta->mesh->plink_state == NL80211_PLINK_ESTAB &&
net/mac80211/rx.c +34 -10

98 lines not on this page · raw message

Signature · 7 lines
2.7.4


-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
maintainer
#1 lore raw
Quoted 4 lines · Thiraviyam Mariyappan

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..."

Quoted 13 lines

+++ b/net/mac80211/rx.c

net/mac80211/rx.c +1 -0
@@ -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:

net/mac80211/rx.c ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx) · line 2351

Quoted 10 lines
net/mac80211/rx.c +6 -2
-	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

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k