From 02723d3bc271de479ac8764accf6f1253f9ecfb9 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Sat, 29 Aug 2020 22:12:45 -0700 Subject: [PATCH] qcacmn: Add INI support for SWLM Add support to enable or disable the Software latency manager via INI Change-Id: I4acde4d5d2b9813de8f64f336d4b3b8c25e67b63 CRs-Fixed: 2769029 --- dp/wifi3.0/dp_types.h | 4 +++- wlan_cfg/cfg_dp.h | 22 +++++++++++++++++++++- wlan_cfg/wlan_cfg.c | 13 +++++++++++++ wlan_cfg/wlan_cfg.h | 13 ++++++++++++- 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 04d4ae033b..19a168a0c0 100644 --- a/dp/wifi3.0/dp_types.h +++ b/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; }; diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index 33da38fee7..ec7aec966d 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -969,6 +969,25 @@ CFG_INI_BOOL("dp_poll_mode_enable", false, \ "Enable/Disable Polling mode for data path") +/* + * + * 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 + * + * + */ +#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_ */ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 3d96af04b0..40e2638305 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/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 diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index a431786bad..1787b1f3e0 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/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