* [PATCH 6.0] wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer
@ 2022-09-27 9:38 Felix Fietkau
2022-09-27 12:00 ` Mikhail Gavrilov
2022-10-06 5:20 ` Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Felix Fietkau @ 2022-09-27 9:38 UTC (permalink / raw)
To: linux-wireless; +Cc: kvalo, Jonas Jelonek, Mikhail Gavrilov
mt7915 and newer need to report the rate_info that's stored in wcid->rate,
since they don't fill info->status.rates.
Cc: Jonas Jelonek <jelonek.jonas@gmail.com>
Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Link: https://lore.kernel.org/all/CABXGCsP0znm9pS-MiKtyxTXR7XiyFVqen0qzNpicGHDZKCzbwg@mail.gmail.com/
Fixes: 44fa75f207d8 ("mac80211: extend current rate control tx status API")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
drivers/net/wireless/mediatek/mt76/tx.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index e67cc7909bce..6c054850363f 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -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);
--
2.36.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 6.0] wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer
2022-09-27 9:38 [PATCH 6.0] wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer Felix Fietkau
@ 2022-09-27 12:00 ` Mikhail Gavrilov
2022-10-06 5:20 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Mikhail Gavrilov @ 2022-09-27 12:00 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, kvalo, Jonas Jelonek
On Tue, Sep 27, 2022 at 2:38 PM Felix Fietkau <nbd@nbd.name> wrote:
>
> mt7915 and newer need to report the rate_info that's stored in wcid->rate,
> since they don't fill info->status.rates.
>
> Cc: Jonas Jelonek <jelonek.jonas@gmail.com>
> Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
> Link: https://lore.kernel.org/all/CABXGCsP0znm9pS-MiKtyxTXR7XiyFVqen0qzNpicGHDZKCzbwg@mail.gmail.com/
> Fixes: 44fa75f207d8 ("mac80211: extend current rate control tx status API")
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
> drivers/net/wireless/mediatek/mt76/tx.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
> index e67cc7909bce..6c054850363f 100644
> --- a/drivers/net/wireless/mediatek/mt76/tx.c
> +++ b/drivers/net/wireless/mediatek/mt76/tx.c
> @@ -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);
> --
> 2.36.1
>
Thanks, the issue is solved.
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
--
Best Regards,
Mike Gavrilov.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 6.0] wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer
2022-09-27 9:38 [PATCH 6.0] wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer Felix Fietkau
2022-09-27 12:00 ` Mikhail Gavrilov
@ 2022-10-06 5:20 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2022-10-06 5:20 UTC (permalink / raw)
To: Felix Fietkau; +Cc: linux-wireless, Jonas Jelonek, Mikhail Gavrilov
Felix Fietkau <nbd@nbd.name> wrote:
> mt7915 and newer need to report the rate_info that's stored in wcid->rate,
> since they don't fill info->status.rates.
>
> Cc: Jonas Jelonek <jelonek.jonas@gmail.com>
> Reported-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
> Link: https://lore.kernel.org/all/CABXGCsP0znm9pS-MiKtyxTXR7XiyFVqen0qzNpicGHDZKCzbwg@mail.gmail.com/
> Fixes: 44fa75f207d8 ("mac80211: extend current rate control tx status API")
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Patch applied to wireless.git, thanks.
6b430f72b2bc wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer
--
https://patchwork.kernel.org/project/linux-wireless/patch/20220927093823.6007-1-nbd@nbd.name/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-06 5:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 9:38 [PATCH 6.0] wifi: mt76: fix rate reporting / throughput regression on mt7915 and newer Felix Fietkau
2022-09-27 12:00 ` Mikhail Gavrilov
2022-10-06 5:20 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).