From fb80921508acc182f64a3a6dd7643481fa12cc93 Mon Sep 17 00:00:00 2001 From: Karthik Kantamneni Date: Tue, 2 May 2023 13:58:36 +0530 Subject: [PATCH] qcacmn: Sync DP soc/pdev cfg with profile Sync DP soc/pdev config items with profile selected. Change-Id: If7fd67117ac512b57934b2d30c00ce8422130970 CRs-Fixed: 3504105 --- dp/wifi3.0/dp_internal.h | 7 +++++++ dp/wifi3.0/dp_main.c | 25 +++++++++++++++++-------- wlan_cfg/wlan_cfg.c | 1 + wlan_cfg/wlan_cfg.h | 2 ++ 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index c76a230e0f..167d3ef06c 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -4320,6 +4320,13 @@ static inline QDF_STATUS dp_soc_swlm_detach(struct dp_soc *soc) } #endif /* !WLAN_DP_FEATURE_SW_LATENCY_MGR */ +#ifndef WLAN_DP_PROFILE_SUPPORT +static inline void wlan_dp_soc_cfg_sync_profile(struct cdp_soc_t *cdp_soc) {} + +static inline void wlan_dp_pdev_cfg_sync_profile(struct cdp_soc_t *cdp_soc, + uint8_t pdev_id) {} +#endif + /** * dp_get_peer_id(): function to get peer id by mac * @soc: Datapath soc handle diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 222a4f914a..9aa3f397df 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -97,6 +97,9 @@ cdp_dump_flow_pool_info(struct cdp_soc_t *soc) #ifdef WLAN_DP_FEATURE_SW_LATENCY_MGR #include #endif +#ifdef WLAN_DP_PROFILE_SUPPORT +#include +#endif #ifdef CONFIG_SAWF_DEF_QUEUES #include "dp_sawf.h" #endif @@ -2563,13 +2566,6 @@ QDF_STATUS dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc, goto fail1; } - /* - * set nss pdev config based on soc config - */ - nss_cfg = wlan_cfg_get_dp_soc_nss_cfg(soc_cfg_ctx); - wlan_cfg_set_dp_pdev_nss_enabled(pdev->wlan_cfg_ctx, - (nss_cfg & (1 << pdev_id))); - pdev->soc = soc; pdev->pdev_id = pdev_id; soc->pdev_list[pdev_id] = pdev; @@ -2577,6 +2573,16 @@ QDF_STATUS dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc, pdev->lmac_id = wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx, pdev_id); soc->pdev_count++; + /*sync DP pdev cfg items with profile support after cfg_pdev_attach*/ + wlan_dp_pdev_cfg_sync_profile((struct cdp_soc_t *)soc, pdev_id); + + /* + * set nss pdev config based on soc config + */ + nss_cfg = wlan_cfg_get_dp_soc_nss_cfg(soc_cfg_ctx); + wlan_cfg_set_dp_pdev_nss_enabled(pdev->wlan_cfg_ctx, + (nss_cfg & (1 << pdev_id))); + /* Allocate memory for pdev srng rings */ if (dp_pdev_srng_alloc(pdev)) { dp_init_err("%pK: dp_pdev_srng_alloc failed", soc); @@ -7908,8 +7914,8 @@ static QDF_STATUS dp_get_psoc_param(struct cdp_soc_t *cdp_soc, case CDP_CFG_RX_REFILL_POOL_NUM: val->cdp_rx_refill_buf_pool_size = wlan_cfg_get_rx_refill_buf_pool_size(wlan_cfg_ctx); -#endif break; +#endif default: dp_warn("Invalid param: %u", param); break; @@ -12163,6 +12169,9 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, goto fail2; } + /*sync DP soc cfg items with profile support after cfg_soc_attach*/ + wlan_dp_soc_cfg_sync_profile((struct cdp_soc_t *)soc); + soc->arch_ops.soc_cfg_attach(soc); if (dp_hw_link_desc_pool_banks_alloc(soc, WLAN_INVALID_PDEV_ID)) { diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index d45261756d..bde5e80439 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -5547,6 +5547,7 @@ wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, CFG_DP_REO_EXCEPTION_RING); cfg->num_tx_desc = cfg_get(ctrl_psoc, CFG_DP_TX_DESC); cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC); + cfg->num_rx_sw_desc = cfg_get(ctrl_psoc, CFG_DP_RX_SW_DESC_NUM); cfg->num_rxdma_buf_ring_entries = cfg_get(ctrl_psoc, CFG_DP_RXDMA_BUF_RING); cfg->num_rxdma_refill_ring_entries = cfg_get(ctrl_psoc, diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 71ef4f31f8..11d52277fc 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -584,6 +584,7 @@ struct wlan_cfg_dp_pdev_ctxt { * @num_reo_exception_ring_entries: num of rx exception ring entries * @num_tx_desc: num of tx descriptors * @num_tx_ext_desc: num of tx ext descriptors + * @num_rx_sw_desc: number of rx sw descriptors * @num_reo_dst_ring_entries: Number of entries in REO destination ring * @num_rxdma_buf_ring_entries: Number of entries in rxdma buf ring * @num_rxdma_refill_ring_entries: Number of entries in rxdma refill ring @@ -601,6 +602,7 @@ struct wlan_dp_prealloc_cfg { int num_reo_exception_ring_entries; int num_tx_desc; int num_tx_ext_desc; + int num_rx_sw_desc; int num_reo_dst_ring_entries; int num_rxdma_buf_ring_entries; int num_rxdma_refill_ring_entries;