diff --git a/dp/wifi3.0/dp_rx_buffer_pool.c b/dp/wifi3.0/dp_rx_buffer_pool.c index 61ad7098f2..481ef24770 100644 --- a/dp/wifi3.0/dp_rx_buffer_pool.c +++ b/dp/wifi3.0/dp_rx_buffer_pool.c @@ -295,7 +295,8 @@ static void dp_rx_refill_buff_pool_init(struct dp_soc *soc, u8 mac_id) return; } - buff_pool->max_bufq_len = DP_RX_REFILL_BUFF_POOL_SIZE; + buff_pool->max_bufq_len = + wlan_cfg_get_rx_refill_buf_pool_size(soc->wlan_cfg_ctx); buff_pool->dp_pdev = dp_get_pdev_for_lmac_id(soc, 0); buff_pool->tail = 0; diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 83d26be9e1..d45261756d 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -4222,6 +4222,10 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) cfg_get(psoc, CFG_DP_RX_BUFF_POOL_ENABLE); wlan_cfg_ctx->is_rx_refill_buff_pool_enabled = cfg_get(psoc, CFG_DP_RX_REFILL_BUFF_POOL_ENABLE); +#ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL + wlan_cfg_ctx->rx_refill_buff_pool_size = + DP_RX_REFILL_BUFF_POOL_SIZE; +#endif wlan_cfg_ctx->rx_pending_high_threshold = cfg_get(psoc, CFG_DP_RX_PENDING_HL_THRESHOLD); wlan_cfg_ctx->rx_pending_low_threshold = @@ -4678,6 +4682,12 @@ int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) return cfg->tx_ring_size; } +void wlan_cfg_set_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, + int ring_size) +{ + cfg->tx_ring_size = ring_size; +} + int wlan_cfg_time_control_bp(struct wlan_cfg_dp_soc_ctxt *cfg) { return cfg->time_control_bp; @@ -4688,6 +4698,12 @@ int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) return cfg->tx_comp_ring_size; } +void wlan_cfg_set_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, + int ring_size) +{ + cfg->tx_comp_ring_size = ring_size; +} + int wlan_cfg_per_pdev_rx_ring(struct wlan_cfg_dp_soc_ctxt *cfg) { return cfg->per_pdev_rx_ring; @@ -4837,6 +4853,12 @@ int wlan_cfg_get_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg) return cfg->rx_dma_buf_ring_size; } +void wlan_cfg_set_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg, + int ring_size) +{ + cfg->rx_dma_buf_ring_size = ring_size; +} + int wlan_cfg_get_num_mac_rings(struct wlan_cfg_dp_pdev_ctxt *cfg) { return cfg->num_mac_rings; @@ -5036,6 +5058,13 @@ wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg) return cfg->rxdma_refill_ring; } +void +wlan_cfg_set_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, + int ring_size) +{ + cfg->rxdma_refill_ring = ring_size; +} + bool wlan_cfg_get_dp_soc_rxdma_refill_lt_disable(struct wlan_cfg_dp_soc_ctxt *cfg) { @@ -5098,6 +5127,13 @@ wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg) return cfg->rx_sw_desc_num; } +void +wlan_cfg_set_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg, + int desc_num) +{ + cfg->rx_sw_desc_num = desc_num; +} + uint32_t wlan_cfg_get_reo_rings_mapping(struct wlan_cfg_dp_soc_ctxt *cfg) { @@ -5332,6 +5368,17 @@ bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) { return cfg->is_rx_refill_buff_pool_enabled; } + +int wlan_cfg_get_rx_refill_buf_pool_size(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return cfg->rx_refill_buff_pool_size; +} + +void +wlan_cfg_set_rx_refill_buf_pool_size(struct wlan_cfg_dp_soc_ctxt *cfg, int size) +{ + cfg->rx_refill_buff_pool_size = size; +} #else bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg) { diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 62a49869c8..71ef4f31f8 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -288,6 +288,7 @@ struct wlan_srng_cfg { * pool support * @is_rx_refill_buff_pool_enabled: flag to enable/disable RX refill buffer * pool support + * @rx_refill_buff_pool_size: RX refill buffer pool size * @rx_pending_high_threshold: threshold of starting pkt drop * @rx_pending_low_threshold: threshold of stopping pkt drop * @is_poll_mode_enabled: @@ -473,6 +474,7 @@ struct wlan_cfg_dp_soc_ctxt { bool pext_stats_enabled; bool is_rx_buff_pool_enabled; bool is_rx_refill_buff_pool_enabled; + int rx_refill_buff_pool_size; uint32_t rx_pending_high_threshold; uint32_t rx_pending_low_threshold; bool is_poll_mode_enabled; @@ -1328,6 +1330,17 @@ wlan_cfg_get_dma_mon_desc_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg); int wlan_cfg_get_rx_dma_buf_ring_size( struct wlan_cfg_dp_pdev_ctxt *wlan_cfg_pdev_ctx); +/** + * wlan_cfg_set_rx_dma_buf_ring_size() - Set RxDMA buffer ring size + * @cfg: pdev configuration context + * @ring_size: rxdma buffer ring size to be set + * + * Return: None + */ +void +wlan_cfg_set_rx_dma_buf_ring_size(struct wlan_cfg_dp_pdev_ctxt *cfg, + int ring_size); + /** * wlan_cfg_rx_pending_hl_threshold() - Return high threshold of rx pending * @cfg: pdev configuration context @@ -1547,6 +1560,16 @@ int wlan_cfg_get_p2p_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg); */ int wlan_cfg_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); +/** + * wlan_cfg_set_tx_ring_size - Set Tx ring size + * @cfg: soc configuration context + * @ring_size: TX ring size to be set + * + * Return: None + */ +void wlan_cfg_set_tx_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, + int ring_size); + /** * wlan_cfg_time_control_bp - Get time for interval in bp prints * @cfg: soc configuration context @@ -1563,6 +1586,16 @@ int wlan_cfg_time_control_bp(struct wlan_cfg_dp_soc_ctxt *cfg); */ int wlan_cfg_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); +/** + * wlan_cfg_set_tx_comp_ring_size - Set Tx completion ring size + * @cfg: soc configuration context + * @ring_size: TX completion ring size to be set + * + * Return: None + */ +void wlan_cfg_set_tx_comp_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, + int ring_size); + /** * wlan_cfg_get_dp_soc_wbm_release_ring_size - Get wbm_release_ring size * @cfg: soc configuration context @@ -1699,6 +1732,17 @@ wlan_cfg_get_dp_soc_tx_sw_internode_queue(struct wlan_cfg_dp_soc_ctxt *cfg); int wlan_cfg_get_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg); +/** + * wlan_cfg_set_dp_soc_rxdma_refill_ring_size - Set rxdma refill ring size + * @cfg: soc configuration context + * @ring_size: rxdma refill ring size to be set + * + * Return: None + */ +void +wlan_cfg_set_dp_soc_rxdma_refill_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg, + int ring_size); + /** * wlan_cfg_get_dp_soc_rxdma_refill_lt_disable - Get RxDMA refill LT status * @cfg: soc configuration context @@ -1735,6 +1779,17 @@ wlan_cfg_get_dp_soc_rx_sw_desc_weight(struct wlan_cfg_dp_soc_ctxt *cfg); int wlan_cfg_get_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg); +/** + * wlan_cfg_set_dp_soc_rx_sw_desc_num - Set rx sw desc num + * @cfg: soc configuration context + * @desc_num: Number of Rx descriptors to be set + * + * Return: None + */ +void +wlan_cfg_set_dp_soc_rx_sw_desc_num(struct wlan_cfg_dp_soc_ctxt *cfg, + int desc_num); + /** * wlan_cfg_get_dp_caps - Get dp capabilities * @cfg: soc configuration context @@ -1946,6 +2001,28 @@ bool wlan_cfg_is_rx_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); */ bool wlan_cfg_is_rx_refill_buffer_pool_enabled(struct wlan_cfg_dp_soc_ctxt *cfg); +#ifdef WLAN_FEATURE_RX_PREALLOC_BUFFER_POOL +/** + * wlan_cfg_get_rx_refill_buf_pool_size() - Get Rx refill buf pool size + * + * @cfg: soc configuration context + * + * Return: Rx refill buffer pool size + */ +int wlan_cfg_get_rx_refill_buf_pool_size(struct wlan_cfg_dp_soc_ctxt *cfg); + +/** + * wlan_cfg_set_rx_refill_buf_pool_size() - Set Rx refill buf pool size + * + * @cfg: soc configuration context + * @size: size of the Rx buffer pool size + * + * Return: None + */ +void +wlan_cfg_set_rx_refill_buf_pool_size(struct wlan_cfg_dp_soc_ctxt *cfg, + int size); +#endif void wlan_cfg_set_tso_desc_attach_defer(struct wlan_cfg_dp_soc_ctxt *cfg, bool val);