qcacmn: get HP of RXDMA ring without incrementing
get the HP of the RXDMA ring without incrementing This will ensure in case of nbuf failures the ring HP remains unchanged Change-Id: I69ec9207a44a4c50484933797326e962ad2d4a5c CRs-Fixed: 3309394
This commit is contained in:

committed by
Madan Koyyalamudi

parent
efff4ec854
commit
4c45f8a2ed
@@ -420,8 +420,8 @@ __dp_rx_buffers_no_map_replenish(struct dp_soc *soc, uint32_t mac_id,
|
||||
next = (*desc_list)->next;
|
||||
qdf_prefetch(next);
|
||||
rxdma_ring_entry = (struct dp_buffer_addr_info *)
|
||||
hal_srng_src_get_next(soc->hal_soc, rxdma_srng);
|
||||
if (!rxdma_ring_entry)
|
||||
hal_srng_src_peek(soc->hal_soc, rxdma_srng);
|
||||
if (qdf_unlikely(!rxdma_ring_entry))
|
||||
break;
|
||||
|
||||
nbuf = dp_rx_nbuf_alloc(soc, rx_desc_pool);
|
||||
@@ -449,6 +449,7 @@ __dp_rx_buffers_no_map_replenish(struct dp_soc *soc, uint32_t mac_id,
|
||||
rx_desc_pool->owner);
|
||||
|
||||
*desc_list = next;
|
||||
hal_srng_src_get_next(soc->hal_soc, rxdma_srng);
|
||||
}
|
||||
qdf_dsb();
|
||||
hal_srng_access_end(soc->hal_soc, rxdma_srng);
|
||||
|
@@ -1975,6 +1975,29 @@ void *hal_srng_src_get_next_consumed(void *hal_soc,
|
||||
}
|
||||
#endif /* CLEAR_SW2TCL_CONSUMED_DESC */
|
||||
|
||||
/**
|
||||
* hal_srng_src_peek - get the HP of the SRC ring
|
||||
* @hal_soc: Opaque HAL SOC handle
|
||||
* @hal_ring_hdl: Source ring pointer
|
||||
*
|
||||
* get the head pointer in the src ring but do not increment it
|
||||
*/
|
||||
static inline
|
||||
void *hal_srng_src_peek(void *hal_soc, hal_ring_handle_t hal_ring_hdl)
|
||||
{
|
||||
struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
|
||||
uint32_t *desc;
|
||||
uint32_t next_hp = (srng->u.src_ring.hp + srng->entry_size) %
|
||||
srng->ring_size;
|
||||
|
||||
if (next_hp != srng->u.src_ring.cached_tp) {
|
||||
desc = &(srng->ring_base_vaddr[srng->u.src_ring.hp]);
|
||||
return (void *)desc;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* hal_srng_src_get_next - Get next entry from a source ring and move cached tail pointer
|
||||
*
|
||||
|
Reference in New Issue
Block a user