Эх сурвалжийг харах

qcacmn: Add tx device limit

Add tx device limit configurable from INI.
This is used to limit the overall tx descriptors used in the device

Change-Id: I51e9611ca14bdc146de914317b38b98329130c9f
Prathyusha Guduri 5 жил өмнө
parent
commit
aed67e197c

+ 2 - 0
dp/wifi3.0/dp_stats.c

@@ -4487,6 +4487,8 @@ void dp_print_soc_cfg_params(struct dp_soc *soc)
 		       soc_cfg_ctx->tx_desc_limit_1);
 	DP_PRINT_STATS("TX_desc limit_2: %u ",
 		       soc_cfg_ctx->tx_desc_limit_2);
+	DP_PRINT_STATS("TX device limit: %u ",
+		       soc_cfg_ctx->tx_device_limit);
 	DP_PRINT_STATS("RXDMA err dst ring: %u ",
 		       soc_cfg_ctx->rxdma_err_dst_ring);
 }

+ 12 - 0
wlan_cfg/cfg_dp.h

@@ -249,6 +249,10 @@
 #define WLAN_CFG_TX_DESC_LIMIT_2_MIN 4096
 #define WLAN_CFG_TX_DESC_LIMIT_2_MAX 32768
 
+#define WLAN_CFG_TX_DEVICE_LIMIT 65536
+#define WLAN_CFG_TX_DEVICE_LIMIT_MIN 16384
+#define WLAN_CFG_TX_DEVICE_LIMIT_MAX 65536
+
 #define WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE 4096
 #define WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE_MIN 16
 #define WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE_MAX 8192
@@ -583,6 +587,13 @@
 		WLAN_CFG_TX_DESC_LIMIT_2, \
 		CFG_VALUE_OR_DEFAULT, "DP TX DESC limit 2")
 
+#define CFG_DP_TX_DEVICE_LIMIT \
+		CFG_INI_UINT("dp_tx_device_limit", \
+		WLAN_CFG_TX_DEVICE_LIMIT_MIN, \
+		WLAN_CFG_TX_DEVICE_LIMIT_MAX, \
+		WLAN_CFG_TX_DEVICE_LIMIT, \
+		CFG_VALUE_OR_DEFAULT, "DP TX DEVICE limit")
+
 #define CFG_DP_RXDMA_MONITOR_BUF_RING \
 		CFG_INI_UINT("dp_rxdma_monitor_buf_ring", \
 		WLAN_CFG_RXDMA_MONITOR_BUF_RING_SIZE_MIN, \
@@ -710,6 +721,7 @@
 		CFG(CFG_DP_TX_DESC_LIMIT_0) \
 		CFG(CFG_DP_TX_DESC_LIMIT_1) \
 		CFG(CFG_DP_TX_DESC_LIMIT_2) \
+		CFG(CFG_DP_TX_DEVICE_LIMIT) \
 		CFG(CFG_DP_RXDMA_MONITOR_BUF_RING) \
 		CFG(CFG_DP_RXDMA_MONITOR_DST_RING) \
 		CFG(CFG_DP_RXDMA_MONITOR_STATUS_RING) \

+ 8 - 0
wlan_cfg/wlan_cfg.c

@@ -406,6 +406,8 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
 						CFG_DP_TX_DESC_LIMIT_1);
 	wlan_cfg_ctx->tx_desc_limit_2 = cfg_get(psoc,
 						CFG_DP_TX_DESC_LIMIT_2);
+	wlan_cfg_ctx->tx_device_limit = cfg_get(psoc,
+						CFG_DP_TX_DEVICE_LIMIT);
 	wlan_cfg_ctx->rxdma_err_dst_ring = cfg_get(psoc,
 						   CFG_DP_RXDMA_ERR_DST_RING);
 	wlan_cfg_ctx->enable_data_stall_detection =
@@ -956,6 +958,12 @@ wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg)
 	return cfg->tx_desc_limit_2;
 }
 
+int
+wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+	return cfg->tx_device_limit;
+}
+
 int
 wlan_cfg_get_dp_soc_rxdma_err_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
 {

+ 11 - 0
wlan_cfg/wlan_cfg.h

@@ -150,6 +150,7 @@ struct wlan_srng_cfg {
  * @tx_desc_limit_0: tx_desc limit for 5G H
  * @tx_desc_limit_1: tx_desc limit for 2G
  * @tx_desc_limit_2: tx_desc limit for 5G L
+ * @tx_device_limit: tx device limit
  * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
@@ -234,6 +235,7 @@ struct wlan_cfg_dp_soc_ctxt {
 	int tx_desc_limit_0;
 	int tx_desc_limit_1;
 	int tx_desc_limit_2;
+	int tx_device_limit;
 #ifdef WLAN_FEATURE_RX_SOFTIRQ_TIME_LIMIT
 	uint32_t tx_comp_loop_pkt_limit;
 	uint32_t rx_reap_loop_pkt_limit;
@@ -1024,6 +1026,15 @@ wlan_cfg_get_dp_soc_tx_desc_limit_1(struct wlan_cfg_dp_soc_ctxt *cfg);
 int
 wlan_cfg_get_dp_soc_tx_desc_limit_2(struct wlan_cfg_dp_soc_ctxt *cfg);
 
+/*
+ * wlan_cfg_get_dp_soc_tx_device_limit - Get tx device limit
+ * @wlan_cfg_soc_ctx
+ *
+ * Return: tx device limit
+ */
+int
+wlan_cfg_get_dp_soc_tx_device_limit(struct wlan_cfg_dp_soc_ctxt *cfg);
+
 /*
  * wlan_cfg_get_dp_soc_rxdma_refill_ring_size - Get rxdma refill ring size
  * @wlan_cfg_soc_ctx