diff mbox series

[5.9] mt76: mt7915: use ieee80211_free_txskb to free tx skbs

Message ID 20200812144943.91974-1-nbd@nbd.name (mailing list archive)
State Accepted
Commit b4be5a53ebf478ffcfb4c98c0ccc4a8d922b9a02
Delegated to: Kalle Valo
Headers show
Series [5.9] mt76: mt7915: use ieee80211_free_txskb to free tx skbs | expand

Commit Message

Felix Fietkau Aug. 12, 2020, 2:49 p.m. UTC
Using dev_kfree_skb for tx skbs breaks AQL. This worked until now only
by accident, because a mac80211 issue breaks AQL on drivers with firmware
rate control that report the rate via ieee80211_tx_status_ext as struct
rate_info.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/mt7915/init.c | 8 ++++++--
 drivers/net/wireless/mediatek/mt76/mt7915/mac.c  | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

Comments

Toke Høiland-Jørgensen Aug. 12, 2020, 3:19 p.m. UTC | #1
Felix Fietkau <nbd@nbd.name> writes:

> Using dev_kfree_skb for tx skbs breaks AQL. This worked until now only
> by accident, because a mac80211 issue breaks AQL on drivers with firmware
> rate control that report the rate via ieee80211_tx_status_ext as struct
> rate_info.

Ah, nice catch! Is it safe to assume that you also have a fix pending
for the mac80211 issue you're talking about in the commit message? :)

Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>

-Toke
Felix Fietkau Aug. 12, 2020, 3:22 p.m. UTC | #2
On 2020-08-12 17:19, Toke Høiland-Jørgensen wrote:
> Felix Fietkau <nbd@nbd.name> writes:
> 
>> Using dev_kfree_skb for tx skbs breaks AQL. This worked until now only
>> by accident, because a mac80211 issue breaks AQL on drivers with firmware
>> rate control that report the rate via ieee80211_tx_status_ext as struct
>> rate_info.
> 
> Ah, nice catch! Is it safe to assume that you also have a fix pending
> for the mac80211 issue you're talking about in the commit message? :)
Sure, I will send it soon.

- Felix
Kalle Valo Aug. 27, 2020, 1:13 p.m. UTC | #3
Felix Fietkau <nbd@nbd.name> wrote:

> Using dev_kfree_skb for tx skbs breaks AQL. This worked until now only
> by accident, because a mac80211 issue breaks AQL on drivers with firmware
> rate control that report the rate via ieee80211_tx_status_ext as struct
> rate_info.
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>

Patch applied to wireless-drivers.git, thanks.

b4be5a53ebf4 mt76: mt7915: use ieee80211_free_txskb to free tx skbs
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
index aadf56e80bae..d7a3b05ab50c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
@@ -691,8 +691,12 @@  void mt7915_unregister_device(struct mt7915_dev *dev)
 	spin_lock_bh(&dev->token_lock);
 	idr_for_each_entry(&dev->token, txwi, id) {
 		mt7915_txp_skb_unmap(&dev->mt76, txwi);
-		if (txwi->skb)
-			dev_kfree_skb_any(txwi->skb);
+		if (txwi->skb) {
+			struct ieee80211_hw *hw;
+
+			hw = mt76_tx_status_get_hw(&dev->mt76, txwi->skb);
+			ieee80211_free_txskb(hw, txwi->skb);
+		}
 		mt76_put_txwi(&dev->mt76, txwi);
 	}
 	spin_unlock_bh(&dev->token_lock);
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index a264e304a3df..5800b2d1fb23 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@ -844,7 +844,7 @@  mt7915_tx_complete_status(struct mt76_dev *mdev, struct sk_buff *skb,
 	if (sta || !(info->flags & IEEE80211_TX_CTL_NO_ACK))
 		mt7915_tx_status(sta, hw, info, NULL);
 
-	dev_kfree_skb(skb);
+	ieee80211_free_txskb(hw, skb);
 }
 
 void mt7915_txp_skb_unmap(struct mt76_dev *dev,