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

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: default avatarEnrico <Mioso@gmail.com>
Tested-by: default avatarEnrico Mioso <mrkiko.rs@gmail.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent b713bbf1
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -152,16 +152,6 @@ void rt2x00mac_tx(struct ieee80211_hw *hw,
	if (unlikely(rt2x00queue_write_tx_frame(queue, skb, control->sta, false)))
		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;

 exit_fail:
+8 −0
Original line number Diff line number Diff line
@@ -715,6 +715,14 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
	rt2x00queue_kick_tx_queue(queue, &txdesc);

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);
	return ret;
}