Linux wireless drivers development
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 7/9] mt76: dma: use ieee80211_tx_status_ext to free packets when tx fails
Date: Mon, 10 May 2021 11:27:01 +0200	[thread overview]
Message-ID: <20210510092703.90500-7-nbd@nbd.name> (raw)
In-Reply-To: <20210510092703.90500-1-nbd@nbd.name>

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

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/dma.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
index 75c1f54b1fe5..5e1c1506a4c6 100644
--- a/drivers/net/wireless/mediatek/mt76/dma.c
+++ b/drivers/net/wireless/mediatek/mt76/dma.c
@@ -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 ieee80211_sta *sta)
 {
+	struct ieee80211_tx_status status = {
+		.sta = sta,
+	};
 	struct mt76_tx_info tx_info = {
 		.skb = skb,
 	};
@@ -361,11 +364,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;
@@ -428,8 +429,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;
 }
 
-- 
2.30.1


  parent reply	other threads:[~2021-05-10  9:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10  9:26 [PATCH 1/9] mt76: mt7915: move mt7915_queue_rx_skb to mac.c Felix Fietkau
2021-05-10  9:26 ` [PATCH 2/9] mt76: mt7615: fix fixed-rate tx status reporting Felix Fietkau
2021-05-10  9:26 ` [PATCH 3/9] mt76: mt7615: avoid use of ieee80211_tx_info_clear_status Felix Fietkau
2021-05-10  9:26 ` [PATCH 4/9] mt76: mt7603: " Felix Fietkau
2021-05-10  9:26 ` [PATCH 5/9] mt76: intialize tx queue entry wcid to 0xffff by default Felix Fietkau
2021-05-10  9:27 ` [PATCH 6/9] mt76: improve tx status codepath Felix Fietkau
2021-05-10  9:27 ` Felix Fietkau [this message]
2021-05-10  9:27 ` [PATCH 8/9] mt76: mt7915: rework tx rate reporting Felix Fietkau
2021-05-10  9:27 ` [PATCH 9/9] mt76: mt7915: add support for tx status reporting Felix Fietkau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210510092703.90500-7-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox