Linux wireless drivers development
 help / color / mirror / Atom feed
From: Nishant Sarmukadam <nishants@marvell.com>
To: linux-wireless@vger.kernel.org
Cc: buytenh@wantstofly.org, Nishant Sarmukadam <nishants@marvell.com>,
	Pradeep Nemavat <pnemavat@marvell.com>
Subject: [PATCH V2 3/4] mwl8k: Reserve buffers for tx management frames
Date: Tue, 19 Apr 2011 22:16:21 +0530	[thread overview]
Message-ID: <1303231582-17333-3-git-send-email-nishants@marvell.com> (raw)
In-Reply-To: <1303231582-17333-1-git-send-email-nishants@marvell.com>

Since queues are not stopped anymore, management frames would be
dropped if the corresponding tx queue is full.
This can cause issues say when we want to setup an ampdu stream and
action frames i.e addba requests keep getting dropped frequently.
Fix this by reserving some buffers to allow management frames to
go through in queue full conditions.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com>
---
 drivers/net/wireless/mwl8k.c |   30 ++++++++++++++++++++++--------
 1 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index aca0139..82cd725 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1818,6 +1818,7 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
 	u8 tid = 0;
 	struct mwl8k_ampdu_stream *stream = NULL;
 	bool start_ba_session = false;
+	bool mgmtframe = false;
 	struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
 
 	wh = (struct ieee80211_hdr *)skb->data;
@@ -1826,6 +1827,9 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
 	else
 		qos = 0;
 
+	if (ieee80211_is_mgmt(wh->frame_control))
+		mgmtframe = true;
+
 	if (priv->ap_fw)
 		mwl8k_encapsulate_tx_frame(skb);
 	else
@@ -1955,15 +1959,25 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
 
 	txq = priv->txq + index;
 
-	if (txq->len >= MWL8K_TX_DESCS) {
-		if (start_ba_session) {
-			spin_lock(&priv->stream_lock);
-			mwl8k_remove_stream(hw, stream);
-			spin_unlock(&priv->stream_lock);
+	/* Mgmt frames that go out frequently are probe responses.
+	 * Other mgmt frames got out relatively infrequently.
+	 * Hence reserve 2 buffers so that other mgmt frames do not get
+	 * dropped due to an already queued probe response in one of
+	 * the reserved buffers.
+	 */
+
+	if (txq->len >= (MWL8K_TX_DESCS - 2)) {
+		if ((mgmtframe == false) ||
+			(txq->len == MWL8K_TX_DESCS)) {
+			if (start_ba_session) {
+				spin_lock(&priv->stream_lock);
+				mwl8k_remove_stream(hw, stream);
+				spin_unlock(&priv->stream_lock);
+			}
+			spin_unlock_bh(&priv->tx_lock);
+			dev_kfree_skb(skb);
+			return;
 		}
-		spin_unlock_bh(&priv->tx_lock);
-		dev_kfree_skb(skb);
-		return;
 	}
 
 	BUG_ON(txq->skb[txq->tail] != NULL);
-- 
1.6.0.3


  parent reply	other threads:[~2011-04-19 17:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19 16:46 [PATCH V2 1/4] mwl8k: Do not stop tx queues Nishant Sarmukadam
2011-04-19 16:46 ` [PATCH V2 2/4] mwl8k: Add timestamp information for tx packets Nishant Sarmukadam
2011-04-21  7:42   ` Lennert Buytenhek
2011-04-21  8:15     ` Nishant Sarmukadam
2011-04-19 16:46 ` Nishant Sarmukadam [this message]
2011-04-21  7:44   ` [PATCH V2 3/4] mwl8k: Reserve buffers for tx management frames Lennert Buytenhek
2011-04-21  8:15     ` Nishant Sarmukadam
2011-04-19 16:46 ` [PATCH V2 4/4] mwl8k: Enable life time expiry for tx packets in the hardware Nishant Sarmukadam
2011-04-21  7:38 ` [PATCH V2 1/4] mwl8k: Do not stop tx queues Lennert Buytenhek

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=1303231582-17333-3-git-send-email-nishants@marvell.com \
    --to=nishants@marvell.com \
    --cc=buytenh@wantstofly.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pnemavat@marvell.com \
    /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