qcacmn: Allocate multi page memory for dp_rx_desc_pool_alloc
Allocate memory in multiple smaller chunks for dp_rx_desc_pool_alloc, and link the pages instead of allocating one big contiguous memory to avoid memory allocation failures. Change-Id: Id81de10727555c4ca78963a6f01ed3b992ce9924 CRs-Fixed: 2443999
This commit is contained in:

committed by
nshrivas

parent
1514e796b6
commit
a7c21dc7f3
@@ -80,6 +80,46 @@ QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc,
|
||||
return __dp_ipa_handle_buf_smmu_mapping(soc, nbuf, create);
|
||||
}
|
||||
|
||||
#ifdef RX_DESC_MULTI_PAGE_ALLOC
|
||||
static QDF_STATUS dp_ipa_handle_rx_buf_pool_smmu_mapping(struct dp_soc *soc,
|
||||
struct dp_pdev *pdev,
|
||||
bool create)
|
||||
{
|
||||
struct rx_desc_pool *rx_pool;
|
||||
uint8_t pdev_id;
|
||||
uint32_t num_desc, page_id, offset, i;
|
||||
uint16_t num_desc_per_page;
|
||||
union dp_rx_desc_list_elem_t *rx_desc_elem;
|
||||
struct dp_rx_desc *rx_desc;
|
||||
qdf_nbuf_t nbuf;
|
||||
|
||||
if (!qdf_mem_smmu_s1_enabled(soc->osdev))
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
||||
pdev_id = pdev->pdev_id;
|
||||
rx_pool = &soc->rx_desc_buf[pdev_id];
|
||||
|
||||
qdf_spin_lock_bh(&rx_pool->lock);
|
||||
num_desc = rx_pool->pool_size;
|
||||
num_desc_per_page = rx_pool->desc_pages.num_element_per_page;
|
||||
for (i = 0; i < num_desc; i++) {
|
||||
page_id = i / num_desc_per_page;
|
||||
offset = i % num_desc_per_page;
|
||||
if (qdf_unlikely(!(rx_pool->desc_pages.cacheable_pages)))
|
||||
break;
|
||||
rx_desc_elem = dp_rx_desc_find(page_id, offset, rx_pool);
|
||||
rx_desc = &rx_desc_elem->rx_desc;
|
||||
if ((!(rx_desc->in_use)) || rx_desc->unmapped)
|
||||
continue;
|
||||
nbuf = rx_desc->nbuf;
|
||||
|
||||
__dp_ipa_handle_buf_smmu_mapping(soc, nbuf, create);
|
||||
}
|
||||
qdf_spin_unlock_bh(&rx_pool->lock);
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#else
|
||||
static QDF_STATUS dp_ipa_handle_rx_buf_pool_smmu_mapping(struct dp_soc *soc,
|
||||
struct dp_pdev *pdev,
|
||||
bool create)
|
||||
@@ -109,6 +149,7 @@ static QDF_STATUS dp_ipa_handle_rx_buf_pool_smmu_mapping(struct dp_soc *soc,
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* RX_DESC_MULTI_PAGE_ALLOC */
|
||||
|
||||
/**
|
||||
* dp_tx_ipa_uc_detach - Free autonomy TX resources
|
||||
|
Reference in New Issue
Block a user