All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mt76: tx: check return value of tx_queue_skb in mt76_tx
       [not found] <cover.1553204966.git.lorenzo@kernel.org>
@ 2019-03-21 21:51 ` Lorenzo Bianconi
  2019-03-23 11:36   ` Felix Fietkau
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Bianconi @ 2019-03-21 21:51 UTC (permalink / raw)
  To: nbd; +Cc: linux-wireless, lorenzo.bianconi, sgruszka

Do not kick the queue if tx_queue_skb fails in mt76_tx

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/wireless/mediatek/mt76/tx.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c
index 60bbb6561d8f..833c414cea83 100644
--- a/drivers/net/wireless/mediatek/mt76/tx.c
+++ b/drivers/net/wireless/mediatek/mt76/tx.c
@@ -258,8 +258,8 @@ mt76_tx(struct mt76_dev *dev, struct ieee80211_sta *sta,
 {
 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+	int err, qid = skb_get_queue_mapping(skb);
 	struct mt76_queue *q;
-	int qid = skb_get_queue_mapping(skb);
 
 	if (WARN_ON(qid >= MT_TXQ_PSD)) {
 		qid = MT_TXQ_BE;
@@ -286,7 +286,10 @@ mt76_tx(struct mt76_dev *dev, struct ieee80211_sta *sta,
 	q = dev->q_tx[qid].q;
 
 	spin_lock_bh(&q->lock);
-	dev->queue_ops->tx_queue_skb(dev, qid, skb, wcid, sta);
+	err = dev->queue_ops->tx_queue_skb(dev, qid, skb, wcid, sta);
+	if (err < 0)
+		goto out;
+
 	dev->queue_ops->kick(dev, q);
 
 	if (q->queued > q->ndesc - 8 && !q->stopped) {
@@ -294,6 +297,7 @@ mt76_tx(struct mt76_dev *dev, struct ieee80211_sta *sta,
 		q->stopped = true;
 	}
 
+out:
 	spin_unlock_bh(&q->lock);
 }
 EXPORT_SYMBOL_GPL(mt76_tx);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mt76: tx: check return value of tx_queue_skb in mt76_tx
  2019-03-21 21:51 ` [PATCH] mt76: tx: check return value of tx_queue_skb in mt76_tx Lorenzo Bianconi
@ 2019-03-23 11:36   ` Felix Fietkau
  0 siblings, 0 replies; 2+ messages in thread
From: Felix Fietkau @ 2019-03-23 11:36 UTC (permalink / raw)
  To: Lorenzo Bianconi; +Cc: linux-wireless, lorenzo.bianconi, sgruszka

On 2019-03-21 22:51, Lorenzo Bianconi wrote:
> Do not kick the queue if tx_queue_skb fails in mt76_tx
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
tx_queue_skb will fail only in rare corner cases, and kicking the queue
without adding extra packets is harmless.
Because of that, I think this patch is unnecessary.

- Felix

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-23 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1553204966.git.lorenzo@kernel.org>
2019-03-21 21:51 ` [PATCH] mt76: tx: check return value of tx_queue_skb in mt76_tx Lorenzo Bianconi
2019-03-23 11:36   ` Felix Fietkau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.