diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index 0ae9e8651f..aa29592761 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -26,6 +26,8 @@ #define DP_PEER_WDS_COUNT_INVALID UINT_MAX +#define DP_BLOCKMEM_SIZE 4096 + /* Alignment for consistent memory for DP rings*/ #define DP_RING_BASE_ALIGN 32 diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index feb7d50c63..d4c77e845d 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -2779,24 +2779,24 @@ dp_pdev_rx_buffers_attach(struct dp_soc *dp_soc, uint32_t mac_id, * have been allocated to fit in one page across each * iteration to index into the nbuf. */ - total_pages = (nr_descs * sizeof(*nf_info)) / PAGE_SIZE; + total_pages = (nr_descs * sizeof(*nf_info)) / DP_BLOCKMEM_SIZE; /* * Add an extra page to store the remainder if any */ - if ((nr_descs * sizeof(*nf_info)) % PAGE_SIZE) + if ((nr_descs * sizeof(*nf_info)) % DP_BLOCKMEM_SIZE) total_pages++; - nf_info = qdf_mem_malloc(PAGE_SIZE); + nf_info = qdf_mem_malloc(DP_BLOCKMEM_SIZE); if (!nf_info) { dp_err("failed to allocate nbuf array"); DP_STATS_INC(dp_pdev, replenish.rxdma_err, num_req_buffers); QDF_BUG(0); return QDF_STATUS_E_NOMEM; } - nbuf_ptrs_per_page = PAGE_SIZE / sizeof(*nf_info); + nbuf_ptrs_per_page = DP_BLOCKMEM_SIZE / sizeof(*nf_info); for (page_idx = 0; page_idx < total_pages; page_idx++) { - qdf_mem_zero(nf_info, PAGE_SIZE); + qdf_mem_zero(nf_info, DP_BLOCKMEM_SIZE); for (nr_nbuf = 0; nr_nbuf < nbuf_ptrs_per_page; nr_nbuf++) { /* diff --git a/dp/wifi3.0/dp_rx_desc.c b/dp/wifi3.0/dp_rx_desc.c index 94ed0174c8..6225161010 100644 --- a/dp/wifi3.0/dp_rx_desc.c +++ b/dp/wifi3.0/dp_rx_desc.c @@ -24,8 +24,9 @@ #ifdef RX_DESC_MULTI_PAGE_ALLOC A_COMPILE_TIME_ASSERT(cookie_size_check, - PAGE_SIZE / sizeof(union dp_rx_desc_list_elem_t) <= - 1 << DP_RX_DESC_PAGE_ID_SHIFT); + (DP_BLOCKMEM_SIZE / + sizeof(union dp_rx_desc_list_elem_t)) + <= (1 << DP_RX_DESC_PAGE_ID_SHIFT)); /* * dp_rx_desc_pool_is_allocated() - check if memory is allocated for the @@ -68,7 +69,7 @@ QDF_STATUS dp_rx_desc_pool_alloc(struct dp_soc *soc, desc_size = sizeof(*rx_desc_elem); rx_desc_pool->elem_size = desc_size; - + rx_desc_pool->desc_pages.page_size = DP_BLOCKMEM_SIZE; dp_desc_multi_pages_mem_alloc(soc, rx_desc_pool->desc_type, &rx_desc_pool->desc_pages, desc_size, num_elem, 0, true); diff --git a/dp/wifi3.0/dp_tx_desc.c b/dp/wifi3.0/dp_tx_desc.c index a68753a1f3..9dc6b2e563 100644 --- a/dp/wifi3.0/dp_tx_desc.c +++ b/dp/wifi3.0/dp_tx_desc.c @@ -99,6 +99,7 @@ QDF_STATUS dp_tx_desc_pool_alloc(struct dp_soc *soc, uint8_t pool_id, desc_size = DP_TX_DESC_SIZE(sizeof(struct dp_tx_desc_s)); tx_desc_pool = &((soc)->tx_desc[(pool_id)]); + tx_desc_pool->desc_pages.page_size = DP_BLOCKMEM_SIZE; dp_desc_multi_pages_mem_alloc(soc, DP_TX_DESC_TYPE, &tx_desc_pool->desc_pages, desc_size, num_elem, diff --git a/dp/wifi3.0/dp_tx_desc.h b/dp/wifi3.0/dp_tx_desc.h index 5c4c12c837..d184e06dd1 100644 --- a/dp/wifi3.0/dp_tx_desc.h +++ b/dp/wifi3.0/dp_tx_desc.h @@ -49,9 +49,10 @@ */ QDF_COMPILE_TIME_ASSERT(dp_tx_desc_size, ((sizeof(struct dp_tx_desc_s)) <= - (PAGE_SIZE >> DP_TX_DESC_ID_PAGE_OS)) && + (DP_BLOCKMEM_SIZE >> DP_TX_DESC_ID_PAGE_OS)) && ((sizeof(struct dp_tx_desc_s)) > - (PAGE_SIZE >> (DP_TX_DESC_ID_PAGE_OS + 1)))); + (DP_BLOCKMEM_SIZE >> (DP_TX_DESC_ID_PAGE_OS + 1))) + ); #ifdef QCA_LL_TX_FLOW_CONTROL_V2 #define TX_DESC_LOCK_CREATE(lock)