qcacmn: support multiple pages prealloc for descriptor

Support multiple pages prealloc for DP descriptor

Change-Id: I66d4cef3acf69acf4b6fc8e5a6d01c3d67921dca
CRs-Fixed: 2751338
This commit is contained in:
Jinwei Chen
2020-08-17 01:20:57 -07:00
committed by snandini
orang tua 21d6fd0ac6
melakukan 18989f8ede
9 mengubah file dengan 225 tambahan dan 49 penghapusan

Melihat File

@@ -2516,4 +2516,76 @@ QDF_STATUS dp_wds_ext_set_peer_rx(ol_txrx_soc_handle soc,
ol_osif_peer_handle osif_peer);
#endif /* QCA_SUPPORT_WDS_EXTENDED */
#ifdef DP_MEM_PRE_ALLOC
/**
* dp_desc_multi_pages_mem_alloc() - alloc memory over multiple pages
* @soc: datapath soc handle
* @desc_type: memory request source type
* @pages: multi page information storage
* @element_size: each element size
* @element_num: total number of elements should be allocated
* @memctxt: memory context
* @cacheable: coherent memory or cacheable memory
*
* This function is a wrapper for memory allocation over multiple
* pages, if dp prealloc method is registered, then will try prealloc
* firstly. if prealloc failed, fall back to regular way over
* qdf_mem_multi_pages_alloc().
*
* Return: None
*/
void dp_desc_multi_pages_mem_alloc(struct dp_soc *soc,
enum dp_desc_type desc_type,
struct qdf_mem_multi_page_t *pages,
size_t element_size,
uint16_t element_num,
qdf_dma_context_t memctxt,
bool cacheable);
/**
* dp_desc_multi_pages_mem_free() - free multiple pages memory
* @soc: datapath soc handle
* @desc_type: memory request source type
* @pages: multi page information storage
* @memctxt: memory context
* @cacheable: coherent memory or cacheable memory
*
* This function is a wrapper for multiple pages memory free,
* if memory is got from prealloc pool, put it back to pool.
* otherwise free by qdf_mem_multi_pages_free().
*
* Return: None
*/
void dp_desc_multi_pages_mem_free(struct dp_soc *soc,
enum dp_desc_type desc_type,
struct qdf_mem_multi_page_t *pages,
qdf_dma_context_t memctxt,
bool cacheable);
#else
static inline
void dp_desc_multi_pages_mem_alloc(struct dp_soc *soc,
enum dp_desc_type desc_type,
struct qdf_mem_multi_page_t *pages,
size_t element_size,
uint16_t element_num,
qdf_dma_context_t memctxt,
bool cacheable)
{
qdf_mem_multi_pages_alloc(soc->osdev, pages, element_size,
element_num, memctxt, cacheable);
}
static inline
void dp_desc_multi_pages_mem_free(struct dp_soc *soc,
enum dp_desc_type desc_type,
struct qdf_mem_multi_page_t *pages,
qdf_dma_context_t memctxt,
bool cacheable)
{
qdf_mem_multi_pages_free(soc->osdev, pages,
memctxt, cacheable);
}
#endif
#endif /* #ifndef _DP_INTERNAL_H_ */