From dd67f457f8cae3bb2716746abd9879d5ced320d0 Mon Sep 17 00:00:00 2001 From: Bharat Kumar M Date: Mon, 17 Jul 2017 22:37:56 +0530 Subject: [PATCH] qcacmn: decrease the size of tx comp ring for nss NSS requires the ring size to be power of 2. The tx comp ring size is reduced to 4096 when nss is enabled. Change-Id: Ied70faefdfe68eb2b7929ff6af4bed5a9e75068e --- wlan_cfg/wlan_cfg.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index f2fe7672c1..732f15de2d 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -64,6 +64,7 @@ #define WLAN_CFG_NUM_TX_DESC (16 << 10) #define WLAN_CFG_NUM_TX_EXT_DESC (8 << 10) + /* Interrupt Mitigation - Batch threshold in terms of number of frames */ #define WLAN_CFG_INT_BATCH_THRESHOLD_TX 256 #define WLAN_CFG_INT_BATCH_THRESHOLD_RX 128 @@ -86,6 +87,14 @@ #define WLAN_CFG_TX_COMP_RING_SIZE (8 << 10) #endif +/* + * The max allowed size for tx comp ring is 8191. + * This is limitted by h/w ring max size. + * As this is not a power of 2 it does not work with nss offload so the + * nearest available size which is power of 2 is 4096 choosen for nss + */ +#define NSS_TX_COMP_RING_SIZE (4 << 10) + #define WLAN_CFG_INT_NUM_CONTEXTS 4 #define RXDMA_BUF_RING_SIZE 2048 @@ -647,6 +656,8 @@ int wlan_cfg_get_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg) void wlan_cfg_set_dp_soc_nss_cfg(struct wlan_cfg_dp_soc_ctxt *cfg, int nss_cfg) { cfg->nss_cfg = nss_cfg; + if (cfg->nss_cfg) + cfg->tx_comp_ring_size = NSS_TX_COMP_RING_SIZE; } int wlan_cfg_get_int_batch_threshold_tx(struct wlan_cfg_dp_soc_ctxt *cfg)