mwifiex: adjust high/low water marks for tx_pending queue
authorMarc Yang <yangyang@marvell.com>
Tue, 17 May 2011 02:17:53 +0000 (19:17 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 19 May 2011 17:53:57 +0000 (13:53 -0400)
This is to fix an issue that the throughput of the higher priority
stream gets dropped when a lower priority stream is present.

Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/main.h
drivers/net/wireless/mwifiex/txrx.c

index 3154b0a31ea6da220e6b655d8747631546901f67..8316b3cd92cdf421975c96ffd9955cc62ae49483 100644 (file)
@@ -69,7 +69,8 @@ struct mwifiex_drv_mode {
 #define MWIFIEX_TIMER_10S                      10000
 #define MWIFIEX_TIMER_1S                       1000
 
-#define MAX_TX_PENDING      60
+#define MAX_TX_PENDING      100
+#define LOW_TX_PENDING      80
 
 #define MWIFIEX_UPLD_SIZE               (2312)
 
index 210120889dfe446c86b000d8f66e5d6e528a6847..aaa50c0741965c4bd7f3f39748a6ba856b1afb07 100644 (file)
@@ -140,7 +140,9 @@ int mwifiex_write_data_complete(struct mwifiex_adapter *adapter,
        } else {
                priv->stats.tx_errors++;
        }
-       atomic_dec(&adapter->tx_pending);
+
+       if (atomic_dec_return(&adapter->tx_pending) >= LOW_TX_PENDING)
+               goto done;
 
        for (i = 0; i < adapter->priv_num; i++) {