Commit 94e4f579 authored by Felix Fietkau's avatar Felix Fietkau

mt76: dma: use ieee80211_tx_status_ext to free packets when tx fails

Fixes AQL issues on full queues, especially with 802.3 encap offload
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 0fe88644
...@@ -350,6 +350,9 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q, ...@@ -350,6 +350,9 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
struct sk_buff *skb, struct mt76_wcid *wcid, struct sk_buff *skb, struct mt76_wcid *wcid,
struct ieee80211_sta *sta) struct ieee80211_sta *sta)
{ {
struct ieee80211_tx_status status = {
.sta = sta,
};
struct mt76_tx_info tx_info = { struct mt76_tx_info tx_info = {
.skb = skb, .skb = skb,
}; };
...@@ -361,11 +364,9 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q, ...@@ -361,11 +364,9 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
u8 *txwi; u8 *txwi;
t = mt76_get_txwi(dev); t = mt76_get_txwi(dev);
if (!t) { if (!t)
hw = mt76_tx_status_get_hw(dev, skb); goto free_skb;
ieee80211_free_txskb(hw, skb);
return -ENOMEM;
}
txwi = mt76_get_txwi_ptr(dev, t); txwi = mt76_get_txwi_ptr(dev, t);
skb->prev = skb->next = NULL; skb->prev = skb->next = NULL;
...@@ -428,8 +429,13 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q, ...@@ -428,8 +429,13 @@ mt76_dma_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
} }
#endif #endif
dev_kfree_skb(tx_info.skb);
mt76_put_txwi(dev, t); 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; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment