Skip to contentSkip to conversation

wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer

PATCH In review Felix Fietkau 3 participants 3 messages Sep 27, 2022 – Oct 6, 2022

Subsystems (2)
lore
Share & tools
lore

Felix Fietkau

author maintainer
#0 lore raw

PATCH 1/1 wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer

mt7915 and newer need to report the rate_info that's stored in wcid->rate, since they don't fill info->status.rates.

---
 drivers/net/wireless/mediatek/mt76/tx.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/tx.c +8 -2
index e67cc7909bce..6c054850363f 100644
@@ -60,14 +60,20 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
 			.skb = skb,
 			.info = IEEE80211_SKB_CB(skb),
 		};
+		struct ieee80211_rate_status rs = {};
 		struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb);
 		struct mt76_wcid *wcid;
 
 		wcid = rcu_dereference(dev->wcid[cb->wcid]);
 		if (wcid) {
 			status.sta = wcid_to_sta(wcid);
-			status.rates = NULL;
-			status.n_rates = 0;
+			if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
+				rs.rate_idx = wcid->rate;
+				status.rates = &rs;
+				status.n_rates = 1;
+			} else {
+				status.n_rates = 0;
+			}
 		}
 
 		hw = mt76_tx_status_get_hw(dev, skb);
Signature · 1 line
2.36.1
Tested-by on v1 1/1
#1 lore raw
Quoted 41 lines · Felix Fietkau

mt7915 and newer need to report the rate_info that's stored in wcid->rate, since they don't fill info->status.rates.

---
 drivers/net/wireless/mediatek/mt76/tx.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/wireless/mediatek/mt76/tx.c +8 -3
index e67cc7909bce..6c054850363f 100644
@@ -60,14 +60,20 @@ mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
                        .skb = skb,
                        .info = IEEE80211_SKB_CB(skb),
                };
+               struct ieee80211_rate_status rs = {};
                struct mt76_tx_cb *cb = mt76_tx_skb_cb(skb);
                struct mt76_wcid *wcid;
 
                wcid = rcu_dereference(dev->wcid[cb->wcid]);
                if (wcid) {
                        status.sta = wcid_to_sta(wcid);
-                       status.rates = NULL;
-                       status.n_rates = 0;
+                       if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) {
+                               rs.rate_idx = wcid->rate;
+                               status.rates = &rs;
+                               status.n_rates = 1;
+                       } else {
+                               status.n_rates = 0;
+                       }
                }
 
                hw = mt76_tx_status_get_hw(dev, skb);
--
Quoted 2 lines

2.36.1

Thanks, the issue is solved.

Signature · 2 lines
Best Regards,
Mike Gavrilov.
#2 lore raw
In reply to Felix Fietkau
Quoted 9 lines · Felix Fietkau

mt7915 and newer need to report the rate_info that's stored in wcid->rate, since they don't fill info->status.rates.

Patch applied to wireless.git, thanks.

6b430f72b2bc wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches