Skip to content

Commit

Permalink
mt76: dma: use ieee80211_tx_status_ext to free packets when tx fails
Browse files Browse the repository at this point in the history
[ Upstream commit 94e4f57 ]

Fixes AQL issues on full queues, especially with 802.3 encap offload

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
nbd168 authored and gregkh committed Jul 19, 2021
1 parent 2a64f37 commit 4d23e60
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions drivers/net/wireless/mediatek/mt76/dma.c
Expand Up @@ -349,6 +349,9 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
struct sk_buff *skb, struct mt76_wcid *wcid,
struct ieee80211_sta *sta)
{
struct ieee80211_tx_status status = {
.sta = sta,
};
struct mt76_tx_info tx_info = {
.skb = skb,
};
Expand All @@ -360,11 +363,9 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
u8 *txwi;

t = mt76_get_txwi(dev);
if (!t) {
hw = mt76_tx_status_get_hw(dev, skb);
ieee80211_free_txskb(hw, skb);
return -ENOMEM;
}
if (!t)
goto free_skb;

txwi = mt76_get_txwi_ptr(dev, t);

skb->prev = skb->next = NULL;
Expand Down Expand Up @@ -427,8 +428,13 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
}
#endif

dev_kfree_skb(tx_info.skb);
mt76_put_txwi(dev, t);

free_skb:
status.skb = tx_info.skb;
hw = mt76_tx_status_get_hw(dev, tx_info.skb);
ieee80211_tx_status_ext(hw, &status);

return ret;
}

Expand Down

0 comments on commit 4d23e60

Please sign in to comment.