Browse Source

qcacmn: Add INI support for SWLM

Add support to enable or disable the
Software latency manager via INI

Change-Id: I4acde4d5d2b9813de8f64f336d4b3b8c25e67b63
CRs-Fixed: 2769029
Rakesh Pillai 4 years ago
parent
commit
02723d3bc2
4 changed files with 49 additions and 3 deletions
  1. 3 1
      dp/wifi3.0/dp_types.h
  2. 21 1
      wlan_cfg/cfg_dp.h
  3. 13 0
      wlan_cfg/wlan_cfg.c
  4. 12 1
      wlan_cfg/wlan_cfg.h

+ 3 - 1
dp/wifi3.0/dp_types.h

@@ -1233,13 +1233,15 @@ struct dp_swlm_params {
  * struct dp_swlm - Software latency manager context
  * @ops: SWLM ops pointers
  * @is_enabled: SWLM enabled/disabled
+ * @is_init: SWLM module initialized
  * @stats: SWLM stats
  * @params: SWLM SRNG params
  * @tcl_flush_timer: flush timer for TCL register writes
  */
 struct dp_swlm {
 	struct dp_swlm_ops *ops;
-	uint8_t is_enabled;
+	uint8_t is_enabled:1,
+		is_init:1;
 	struct dp_swlm_stats stats;
 	struct dp_swlm_params params;
 };

+ 21 - 1
wlan_cfg/cfg_dp.h

@@ -969,6 +969,25 @@
 		CFG_INI_BOOL("dp_poll_mode_enable", false, \
 		"Enable/Disable Polling mode for data path")
 
+/*
+ * <ini>
+ * gEnableSWLM - Control DP Software latency manager
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enable DP Software latency Manager
+ *
+ * Supported Feature: STA,P2P and SAP IPA disabled terminating
+ *
+ * Usage: Internal
+ *
+ * </ini>
+ */
+#define CFG_DP_SWLM_ENABLE \
+	CFG_INI_BOOL("gEnableSWLM", false, \
+		     "Enable/Disable DP SWLM")
+
 #define CFG_DP \
 		CFG(CFG_DP_HTT_PACKET_TYPE) \
 		CFG(CFG_DP_INT_BATCH_THRESHOLD_OTHER) \
@@ -1052,5 +1071,6 @@
 		CFG(CFG_DP_RX_PENDING_HL_THRESHOLD) \
 		CFG(CFG_DP_RX_PENDING_LO_THRESHOLD) \
 		CFG(CFG_DP_LEGACY_MODE_CSUM_DISABLE) \
-		CFG(CFG_DP_POLL_MODE_ENABLE)
+		CFG(CFG_DP_POLL_MODE_ENABLE) \
+		CFG(CFG_DP_SWLM_ENABLE)
 #endif /* _CFG_DP_H_ */

+ 13 - 0
wlan_cfg/wlan_cfg.c

@@ -620,6 +620,7 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc)
 			cfg_get(psoc, CFG_DP_RX_PENDING_LO_THRESHOLD);
 	wlan_cfg_ctx->is_poll_mode_enabled =
 			cfg_get(psoc, CFG_DP_POLL_MODE_ENABLE);
+	wlan_cfg_ctx->is_swlm_enabled = cfg_get(psoc, CFG_DP_SWLM_ENABLE);
 	return wlan_cfg_ctx;
 }
 
@@ -1424,3 +1425,15 @@ bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
 	return false;
 }
 #endif /* WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL */
+
+#ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR
+bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+	return (bool)(cfg->is_swlm_enabled);
+}
+#else
+bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg)
+{
+	return false;
+}
+#endif

+ 12 - 1
wlan_cfg/wlan_cfg.h

@@ -189,6 +189,7 @@ struct wlan_srng_cfg {
  *                           pool support
  * @rx_pending_high_threshold: threshold of starting pkt drop
  * @rx_pending_low_threshold: threshold of stopping pkt drop
+ * @is_swlm_enabled: flag to enable/disable SWLM
  */
 struct wlan_cfg_dp_soc_ctxt {
 	int num_int_ctxts;
@@ -298,6 +299,7 @@ struct wlan_cfg_dp_soc_ctxt {
 	uint32_t rx_pending_high_threshold;
 	uint32_t rx_pending_low_threshold;
 	bool is_poll_mode_enabled;
+	uint8_t is_swlm_enabled;
 };
 
 /**
@@ -1382,7 +1384,6 @@ bool wlan_cfg_is_rx_fisa_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  * Return: true if enabled, false otherwise.
  */
 bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
-#endif
 
 void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg,
 					bool val);
@@ -1431,3 +1432,13 @@ wlan_cfg_is_peer_ext_stats_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
  */
 
 bool wlan_cfg_is_poll_mode_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
+
+/**
+ * wlan_cfg_is_swlm_enabled() - Get SWLMenabled flag
+ * @cfg: soc configuration context
+ *
+ * Return: true if enabled, false otherwise.
+ */
+bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg);
+
+#endif