qcacmn: Fix large RX desc pool memory allocation

During dp_rx_pdev_attach and dp_rx_pdev_mon_buf_attach we are allocating
three times as many rx descriptors as there are entries in the ring for
AP usecase. This is not needed for MCL and may need to kmalloc
failures for allocating that much contiguous memory

Allocate only as many RX descriptors as there are ring entries for MCL
usecase.

Change-Id: I8b559a85c3899bcbdc520e71ba5da409314db160
CRs-Fixed: 2342957
This commit is contained in:
Mohit Khanna
2018-11-12 18:39:03 -08:00
committad av nshrivas
förälder 96e3633874
incheckning 705149946b
5 ändrade filer med 69 tillägg och 75 borttagningar

Visa fil

@@ -32,9 +32,25 @@
#ifdef QCA_HOST2FW_RXBUF_RING
#define DP_WBM2SW_RBM HAL_RX_BUF_RBM_SW1_BM
/**
* For MCL cases, allocate as many RX descriptors as buffers in the SW2RXDMA
* ring. This value may need to be tuned later.
*/
#define DP_RX_DESC_ALLOC_MULTIPLIER 1
#else
#define DP_WBM2SW_RBM HAL_RX_BUF_RBM_SW3_BM
#endif
/**
* AP use cases need to allocate more RX Descriptors than the number of
* entries avaialable in the SW2RXDMA buffer replenish ring. This is to account
* for frames sitting in REO queues, HW-HW DMA rings etc. Hence using a
* multiplication factor of 3, to allocate three times as many RX descriptors
* as RX buffers.
*/
#define DP_RX_DESC_ALLOC_MULTIPLIER 3
#endif /* QCA_HOST2FW_RXBUF_RING */
#define RX_BUFFER_SIZE 2048
#define RX_BUFFER_RESERVATION 0