qcacmn: Add Cached Descriptor support for DP SRNGs

Add support to configure any HAL SRNG descriptor to
be allocated from cached memory area. This is to
optimize of CPU cycles spent on uncached
memory accesses. Also added prefetch of cached
descriptors

Change-Id: I2544e8596d48e2f5549bf687a764c16d73397545
CRs-fixed: 2267945
This commit is contained in:
Chaithanya Garrepalli 2019-05-28 12:10:49 +05:30 • committed by Nitesh Shrivastav
commit ab234e56f6
10 changed files with 214 additions and 96 deletions

View file

@ -310,6 +310,7 @@ void *qdf_aligned_mem_alloc_consistent_fl(
void **vaddr_unaligned, qdf_dma_addr_t *paddr_unaligned,
qdf_dma_addr_t *paddr_aligned, uint32_t ring_base_align,
const char *func, uint32_t line);
#define qdf_mem_virt_to_phys(vaddr) virt_to_phys(vaddr)
void qdf_mem_set_io(void *ptr, uint32_t num_bytes, uint32_t value);
@ -414,6 +415,14 @@ static inline uint32_t qdf_mem_map_nbytes_single(qdf_device_t osdev, void *buf,
#endif
}
static inline void qdf_mem_dma_cache_sync(qdf_device_t osdev,
qdf_dma_addr_t buf,
qdf_dma_dir_t dir,
int nbytes)
{
__qdf_mem_dma_cache_sync(osdev, buf, dir, nbytes);
}
/**
* qdf_mem_unmap_nbytes_single() - un_map memory for DMA
* @osdev: pomter OS device context

View file

@ -551,6 +551,13 @@ static inline uint8_t *qdf_get_u32(uint8_t *ptr, uint32_t *value)
*/
#define qdf_ffz(mask) __qdf_ffz(mask)
/**
* qdf_prefetch - prefetches the cacheline for read
*
* @x: address to be prefetched
*/
#define qdf_prefetch(x) __qdf_prefetch(x)
/**
* qdf_get_pwr2() - get next power of 2 integer from input value
* @value: input value to find next power of 2 integer

View file

@ -149,6 +149,25 @@ static inline uint32_t __qdf_mem_map_nbytes_single(qdf_device_t osdev,
QDF_STATUS_E_FAILURE : QDF_STATUS_SUCCESS;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
static inline void __qdf_mem_dma_cache_sync(qdf_device_t osdev,
qdf_dma_addr_t buf,
qdf_dma_dir_t dir,
int nbytes)
{
dma_cache_sync(osdev->dev, buf, nbytes, __qdf_dma_dir_to_os(dir));
}
#else
static inline void __qdf_mem_dma_cache_sync(qdf_device_t osdev,
qdf_dma_addr_t buf,
qdf_dma_dir_t dir,
int nbytes)
{
dma_sync_single_for_cpu(osdev->dev, buf, nbytes,
__qdf_dma_dir_to_os(dir));
}
#endif
/**
* __qdf_mem_unmap_nbytes_single() - un_map memory for DMA
*

View file

@ -279,6 +279,8 @@ static inline bool __qdf_is_macaddr_equal(struct qdf_mac_addr *mac_addr1,
ewma_rx_rssi_read(rx_rssi)
#endif
#define __qdf_prefetch(x) prefetch(x)
#ifdef QCA_CONFIG_SMP
/**
* __qdf_get_cpu() - get cpu_index