qcacmn: Replace kzalloc/kfree with vmalloc/vfree

At continuous physical address limited telematics platform,
in order to avoid occasional memory alloc failure with big
kzalloc size, it's better to use virtual memory allocation
API instead. And below items will be refined to replace
malloc with valloc if CONFIG_ENABLE_VALLOC_REPLACE_MALLOC=y.

1 x 30488 = 30488B @dp_soc_attach:15189
1 x 52096 = 52096B @hal_attach:1104
4096 x 64 = 262144B @dp_rx_desc_pool_alloc:337

Change-Id: I57a6f78f690b5be1838de954933ae36129cea234
CRs-Fixed: 3426935
This commit is contained in:
Chaoli Zhou
2023-03-07 17:52:19 +08:00
committed by Madan Koyyalamudi
parent a3a4e67eed
commit ddabd3eda4
3 changed files with 9 additions and 9 deletions

View File

@@ -1091,7 +1091,7 @@ void *hal_attach(struct hif_opaque_softc *hif_handle, qdf_device_t qdf_dev)
struct hal_soc *hal;
int i;
hal = qdf_mem_malloc(sizeof(*hal));
hal = qdf_mem_common_alloc(sizeof(*hal));
if (!hal) {
QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
@@ -1177,7 +1177,7 @@ fail2:
sizeof(*(hal->shadow_rdptr_mem_vaddr)) * HAL_SRNG_ID_MAX,
hal->shadow_rdptr_mem_vaddr, hal->shadow_rdptr_mem_paddr, 0);
fail1:
qdf_mem_free(hal);
qdf_mem_common_free(hal);
fail0:
return NULL;
}
@@ -1215,7 +1215,7 @@ void hal_detach(void *hal_soc)
qdf_mem_free_consistent(hal->qdf_dev, hal->qdf_dev->dev,
sizeof(*(hal->shadow_wrptr_mem_vaddr)) * HAL_MAX_LMAC_RINGS,
hal->shadow_wrptr_mem_vaddr, hal->shadow_wrptr_mem_paddr, 0);
qdf_mem_free(hal);
qdf_mem_common_free(hal);
return;
}