diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index d4dc38ac3d64..fd5ade9e0f06 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -3368,13 +3368,15 @@ bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap1, uint32_t *remap2) * * @tx_ring_num: Tx ring number * @tx_ipa_ring_sz: Return param only updated for IPA. + * @soc_cfg_ctx: dp soc cfg context * * Return: None */ -static void dp_ipa_get_tx_ring_size(int tx_ring_num, int *tx_ipa_ring_sz) +static void dp_ipa_get_tx_ring_size(int tx_ring_num, int *tx_ipa_ring_sz, + struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx) { if (tx_ring_num == IPA_TCL_DATA_RING_IDX) - *tx_ipa_ring_sz = WLAN_CFG_IPA_TX_RING_SIZE; + *tx_ipa_ring_sz = wlan_cfg_ipa_tx_ring_size(soc_cfg_ctx); } /** @@ -3382,14 +3384,17 @@ static void dp_ipa_get_tx_ring_size(int tx_ring_num, int *tx_ipa_ring_sz) * * @tx_comp_ring_num: Tx comp ring number * @tx_comp_ipa_ring_sz: Return param only updated for IPA. + * @soc_cfg_ctx: dp soc cfg context * * Return: None */ static void dp_ipa_get_tx_comp_ring_size(int tx_comp_ring_num, - int *tx_comp_ipa_ring_sz) + int *tx_comp_ipa_ring_sz, + struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx) { if (tx_comp_ring_num == IPA_TCL_DATA_RING_IDX) - *tx_comp_ipa_ring_sz = WLAN_CFG_IPA_TX_COMP_RING_SIZE; + *tx_comp_ipa_ring_sz = + wlan_cfg_ipa_tx_comp_ring_size(soc_cfg_ctx); } #else static uint8_t dp_reo_ring_selection(uint32_t value, uint32_t *ring) @@ -3523,12 +3528,14 @@ static bool dp_reo_remap_config(struct dp_soc *soc, return true; } -static void dp_ipa_get_tx_ring_size(int ring_num, int *tx_ipa_ring_sz) +static void dp_ipa_get_tx_ring_size(int ring_num, int *tx_ipa_ring_sz, + struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx) { } static void dp_ipa_get_tx_comp_ring_size(int tx_comp_ring_num, - int *tx_comp_ipa_ring_sz) + int *tx_comp_ipa_ring_sz, + struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx) { } #endif /* IPA_OFFLOAD */ @@ -3661,7 +3668,7 @@ static QDF_STATUS dp_alloc_tx_ring_pair_by_index(struct dp_soc *soc, int cached = 0; tx_ring_size = wlan_cfg_tx_ring_size(soc_cfg_ctx); - dp_ipa_get_tx_ring_size(index, &tx_ring_size); + dp_ipa_get_tx_ring_size(index, &tx_ring_size, soc_cfg_ctx); if (dp_srng_alloc(soc, &soc->tcl_data_ring[index], TCL_DATA, tx_ring_size, cached)) { @@ -3670,7 +3677,7 @@ static QDF_STATUS dp_alloc_tx_ring_pair_by_index(struct dp_soc *soc, } tx_comp_ring_size = wlan_cfg_tx_comp_ring_size(soc_cfg_ctx); - dp_ipa_get_tx_comp_ring_size(index, &tx_comp_ring_size); + dp_ipa_get_tx_comp_ring_size(index, &tx_comp_ring_size, soc_cfg_ctx); /* Enable cached TCL desc if NSS offload is disabled */ if (!wlan_cfg_get_dp_soc_nss_cfg(soc_cfg_ctx)) cached = WLAN_CFG_DST_RING_CACHED_DESC; diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index f375f5344d30..30011c1ad811 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -63,8 +63,13 @@ #define WLAN_CFG_TX_RING_SIZE 1024 #endif +#define WLAN_CFG_IPA_TX_RING_SIZE_MIN 1024 #define WLAN_CFG_IPA_TX_RING_SIZE 1024 +#define WLAN_CFG_IPA_TX_RING_SIZE_MAX 8096 + +#define WLAN_CFG_IPA_TX_COMP_RING_SIZE_MIN 1024 #define WLAN_CFG_IPA_TX_COMP_RING_SIZE 1024 +#define WLAN_CFG_IPA_TX_COMP_RING_SIZE_MAX 8096 #define WLAN_CFG_PER_PDEV_TX_RING 0 #define WLAN_CFG_IPA_UC_TX_BUF_SIZE 2048 @@ -1048,6 +1053,63 @@ CFG_INI_BOOL("gForceRX64BA", \ false, "Enable/Disable force 64 blockack in RX side") +#ifdef IPA_OFFLOAD +/* + * + * dp_ipa_tx_ring_size - Set tcl ring size for IPA + * @Min: 1024 + * @Max: 8096 + * @Default: 1024 + * + * This ini sets the tcl ring size for IPA + * + * Related: N/A + * + * Supported Feature: IPA + * + * Usage: Internal + * + * + */ +#define CFG_DP_IPA_TX_RING_SIZE \ + CFG_INI_UINT("dp_ipa_tx_ring_size", \ + WLAN_CFG_IPA_TX_RING_SIZE_MIN, \ + WLAN_CFG_IPA_TX_RING_SIZE_MAX, \ + WLAN_CFG_IPA_TX_RING_SIZE, \ + CFG_VALUE_OR_DEFAULT, "IPA TCL ring size") + +/* + * + * dp_ipa_tx_comp_ring_size - Set tx comp ring size for IPA + * @Min: 1024 + * @Max: 8096 + * @Default: 1024 + * + * This ini sets the tx comp ring size for IPA + * + * Related: N/A + * + * Supported Feature: IPA + * + * Usage: Internal + * + * + */ +#define CFG_DP_IPA_TX_COMP_RING_SIZE \ + CFG_INI_UINT("dp_ipa_tx_comp_ring_size", \ + WLAN_CFG_IPA_TX_COMP_RING_SIZE_MIN, \ + WLAN_CFG_IPA_TX_COMP_RING_SIZE_MAX, \ + WLAN_CFG_IPA_TX_COMP_RING_SIZE, \ + CFG_VALUE_OR_DEFAULT, "IPA tx comp ring size") + +#define CFG_DP_IPA_TX_RING_CFG \ + CFG(CFG_DP_IPA_TX_RING_SIZE) \ + CFG(CFG_DP_IPA_TX_COMP_RING_SIZE) +#else +#define CFG_DP_IPA_TX_RING_CFG +#endif + + #define CFG_DP \ CFG(CFG_DP_HTT_PACKET_TYPE) \ CFG(CFG_DP_INT_BATCH_THRESHOLD_OTHER) \ @@ -1137,5 +1199,6 @@ CFG(CFG_DP_TX_PER_PKT_VDEV_ID_CHECK) \ CFG(CFG_DP_RX_FST_IN_CMEM) \ CFG(CFG_DP_WOW_CHECK_RX_PENDING) \ - CFG(CFG_FORCE_RX_64_BA) + CFG(CFG_FORCE_RX_64_BA) \ + CFG_DP_IPA_TX_RING_CFG #endif /* _CFG_DP_H_ */ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 31dac3543901..b0a56e24881f 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -466,6 +466,32 @@ void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, } } +#ifdef IPA_OFFLOAD +/** + * wlan_soc_ipa_cfg_attach() - Update ipa config in dp soc + * cfg context + * @psoc - Object manager psoc + * @wlan_cfg_ctx - dp soc cfg ctx + * + * Return: None + */ +static void +wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) +{ + wlan_cfg_ctx->ipa_tx_ring_size = + cfg_get(psoc, CFG_DP_IPA_TX_RING_SIZE); + wlan_cfg_ctx->ipa_tx_comp_ring_size = + cfg_get(psoc, CFG_DP_IPA_TX_COMP_RING_SIZE); +} +#else +static inline void +wlan_soc_ipa_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) +{ +} +#endif + /** * wlan_cfg_soc_attach() - Allocate and prepare SoC configuration * @psoc - Object manager psoc @@ -630,6 +656,7 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) cfg_get(psoc, CFG_DP_TX_PER_PKT_VDEV_ID_CHECK); wlan_cfg_ctx->wow_check_rx_pending_enable = cfg_get(psoc, CFG_DP_WOW_CHECK_RX_PENDING); + wlan_soc_ipa_cfg_attach(psoc, wlan_cfg_ctx); return wlan_cfg_ctx; } @@ -1481,3 +1508,15 @@ bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg) { return cfg->enable_force_rx_64_ba; } + +#ifdef IPA_OFFLOAD +uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return cfg->ipa_tx_ring_size; +} + +uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return cfg->ipa_tx_comp_ring_size; +} +#endif diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 4484db52b7b9..5c1bf9b090ba 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -195,6 +195,8 @@ struct wlan_srng_cfg { * @is_swlm_enabled: flag to enable/disable SWLM * @tx_per_pkt_vdev_id_check: Enable tx perpkt vdev id check * @wow_check_rx_pending_enable: Enable RX frame pending check in WoW + * @ipa_tx_ring_size: IPA tx ring size + * @ipa_tx_comp_ring_size: IPA tx completion ring size */ struct wlan_cfg_dp_soc_ctxt { int num_int_ctxts; @@ -310,6 +312,10 @@ struct wlan_cfg_dp_soc_ctxt { bool fst_in_cmem; bool tx_per_pkt_vdev_id_check; bool wow_check_rx_pending_enable; +#ifdef IPA_OFFLOAD + uint32_t ipa_tx_ring_size; + uint32_t ipa_tx_comp_ring_size; +#endif }; /** @@ -1499,4 +1505,34 @@ bool wlan_cfg_is_swlm_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); * Return: force use 64 BA flag */ bool wlan_cfg_is_dp_force_rx_64_ba(struct wlan_cfg_dp_soc_ctxt *cfg); + +#ifdef IPA_OFFLOAD +/* + * wlan_cfg_ipa_tx_ring_size - Get Tx DMA ring size (TCL Data Ring) + * @wlan_cfg_soc_ctx: dp cfg context + * + * Return: IPA Tx Ring Size + */ +uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); + +/* + * wlan_cfg_ipa_tx_comp_ring_size - Get Tx completion ring size (WBM Ring) + * @wlan_cfg_soc_ctx: dp cfg context + * + * Return: IPA Tx Completion ring size + */ +uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); +#else +static inline +uint32_t wlan_cfg_ipa_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return 0; +} + +static inline +uint32_t wlan_cfg_ipa_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return 0; +} +#endif #endif