qcacmn: support more dp srng with memory pre-allocation

add more ring type's size to wlan_dp_prealloc_cfg structure,
add DP_MON_PDEV_TYPE memory pre-allocation support.

Change-Id: I23aebaf7e7e78206ac49ebf02719f6b4dee99875
CRs-Fixed: 3314209
This commit is contained in:
Jinwei Chen
2022-10-17 00:23:27 -07:00
committed by Madan Koyyalamudi
parent 61db6e2df1
commit 2a6561273c
4 changed files with 15 additions and 3 deletions

View File

@@ -2011,7 +2011,7 @@ void *dp_context_alloc_mem(struct dp_soc *soc, enum dp_ctxt_type ctxt_type,
goto end; goto end;
dynamic_alloc: dynamic_alloc:
dp_info("Pre-alloc type %d, size %zu failed, need dynamic-alloc", dp_info("switch to dynamic-alloc for type %d, size %zu",
ctxt_type, ctxt_size); ctxt_type, ctxt_size);
ctxt_mem = qdf_mem_malloc(ctxt_size); ctxt_mem = qdf_mem_malloc(ctxt_size);
end: end:

View File

@@ -5078,7 +5078,7 @@ fail2:
mon_ops->mon_pdev_free(pdev); mon_ops->mon_pdev_free(pdev);
fail1: fail1:
pdev->monitor_pdev = NULL; pdev->monitor_pdev = NULL;
qdf_mem_free(mon_pdev); dp_context_free_mem(soc, DP_MON_PDEV_TYPE, mon_pdev);
fail0: fail0:
return QDF_STATUS_E_NOMEM; return QDF_STATUS_E_NOMEM;
} }
@@ -5114,7 +5114,7 @@ QDF_STATUS dp_mon_pdev_detach(struct dp_pdev *pdev)
if (mon_ops->mon_pdev_free) if (mon_ops->mon_pdev_free)
mon_ops->mon_pdev_free(pdev); mon_ops->mon_pdev_free(pdev);
qdf_mem_free(mon_pdev); dp_context_free_mem(pdev->soc, DP_MON_PDEV_TYPE, mon_pdev);
pdev->monitor_pdev = NULL; pdev->monitor_pdev = NULL;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

View File

@@ -4013,6 +4013,12 @@ wlan_cfg_get_prealloc_cfg(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC); cfg->num_tx_ext_desc = cfg_get(ctrl_psoc, CFG_DP_TX_EXT_DESC);
cfg->num_rxdma_buf_ring_entries = cfg_get(ctrl_psoc, cfg->num_rxdma_buf_ring_entries = cfg_get(ctrl_psoc,
CFG_DP_RXDMA_BUF_RING); CFG_DP_RXDMA_BUF_RING);
cfg->num_rxdma_refill_ring_entries = cfg_get(ctrl_psoc,
CFG_DP_RXDMA_REFILL_RING);
cfg->num_reo_status_ring_entries = cfg_get(ctrl_psoc,
CFG_DP_REO_STATUS_RING);
cfg->num_mon_status_ring_entries = cfg_get(ctrl_psoc,
CFG_DP_RXDMA_MONITOR_STATUS_RING);
} }
#ifdef WLAN_FEATURE_PKT_CAPTURE_V2 #ifdef WLAN_FEATURE_PKT_CAPTURE_V2

View File

@@ -483,6 +483,9 @@ struct wlan_cfg_dp_pdev_ctxt {
* @num_tx_ext_desc: num of tx ext descriptors * @num_tx_ext_desc: num of tx ext descriptors
* @num_reo_dst_ring_entries: Number of entries in REO destination ring * @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_buf_ring_entries: Number of entries in rxdma buf ring
* @num_rxdma_refill_ring_entries: Number of entries in rxdma refill ring
* @num_reo_status_ring_entries: Number of entries in REO status ring
* @num_mon_status_ring_entries: Number of entries in monitor status ring
*/ */
struct wlan_dp_prealloc_cfg { struct wlan_dp_prealloc_cfg {
int num_tx_ring_entries; int num_tx_ring_entries;
@@ -494,6 +497,9 @@ struct wlan_dp_prealloc_cfg {
int num_tx_ext_desc; int num_tx_ext_desc;
int num_reo_dst_ring_entries; int num_reo_dst_ring_entries;
int num_rxdma_buf_ring_entries; int num_rxdma_buf_ring_entries;
int num_rxdma_refill_ring_entries;
int num_reo_status_ring_entries;
int num_mon_status_ring_entries;
}; };
/** /**