Commit 3d8f162c authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Kalle Valo

rt2x00: pause almost full queue early

Do not drop &queue->tx_lock and acquire it again to pause queue when
available entries are below the threshold.

Patch should mitigate problem of frequently printed errors:
"Error - Dropping frame due to full tx queue"
Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Tested-by: Enrico Mioso@gmail.com
Tested-by: default avatarEnrico Mioso <mrkiko.rs@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent b713bbf1
...@@ -152,16 +152,6 @@ void rt2x00mac_tx(struct ieee80211_hw *hw, ...@@ -152,16 +152,6 @@ void rt2x00mac_tx(struct ieee80211_hw *hw,
if (unlikely(rt2x00queue_write_tx_frame(queue, skb, control->sta, false))) if (unlikely(rt2x00queue_write_tx_frame(queue, skb, control->sta, false)))
goto exit_fail; goto exit_fail;
/*
* Pausing queue has to be serialized with rt2x00lib_txdone(). Note
* we should not use spin_lock_bh variant as bottom halve was already
* disabled before ieee80211_xmit() call.
*/
spin_lock(&queue->tx_lock);
if (rt2x00queue_threshold(queue))
rt2x00queue_pause_queue(queue);
spin_unlock(&queue->tx_lock);
return; return;
exit_fail: exit_fail:
......
...@@ -715,6 +715,14 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb, ...@@ -715,6 +715,14 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
rt2x00queue_kick_tx_queue(queue, &txdesc); rt2x00queue_kick_tx_queue(queue, &txdesc);
out: out:
/*
* Pausing queue has to be serialized with rt2x00lib_txdone(), so we
* do this under queue->tx_lock. Bottom halve was already disabled
* before ieee80211_xmit() call.
*/
if (rt2x00queue_threshold(queue))
rt2x00queue_pause_queue(queue);
spin_unlock(&queue->tx_lock); spin_unlock(&queue->tx_lock);
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