qcacmn: Support none 4k page size kernel
DP uses multi page allocation for tx/rx descriptor. ID and offset mask of decriptor is based on 4096 which couples with Kernel's MMU PAGE_SIZE. This cause trouble when deploy driver on none-4K page size kernel. Set qdf_dp_blockmem_size to 4096 so that DP won't depend on kernel page size. Change-Id: I17f5c10b394e8709e6b4b153f3dd094cf792787f CRs-Fixed: 3235246
This commit is contained in:

committed by
Madan Koyyalamudi

parent
1705770b9f
commit
53537c67e1
@@ -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++) {
|
||||
/*
|
||||
|
Reference in New Issue
Block a user