qcacmn: Avoid per packet Rx refill buffer pool lock

Avoid per packet Rx refill buff pool lock, instead
acquire/release lock for burst of nbuf's replenishment.

Change-Id: I778cb9702d31d4b8911cca4e7f06f12c50ef6df9
CRs-Fixed: 2884208
This commit is contained in:
Karthik Kantamneni
2021-02-23 16:57:44 +05:30
committed by snandini
parent 58b2f08534
commit c9cec76270
4 changed files with 41 additions and 4 deletions

View File

@@ -195,15 +195,13 @@ static inline qdf_nbuf_t dp_rx_refill_buff_pool_dequeue_nbuf(struct dp_soc *soc)
qdf_nbuf_t nbuf = NULL;
struct rx_refill_buff_pool *buff_pool = &soc->rx_refill_buff_pool;
if (!buff_pool->is_initialized || !buff_pool->bufq_len)
if (!buff_pool->in_rx_refill_lock || !buff_pool->bufq_len)
return nbuf;
qdf_spin_lock_bh(&buff_pool->bufq_lock);
nbuf = buff_pool->buf_head;
buff_pool->buf_head = qdf_nbuf_next(buff_pool->buf_head);
qdf_nbuf_set_next(nbuf, NULL);
buff_pool->bufq_len--;
qdf_spin_unlock_bh(&buff_pool->bufq_lock);
return nbuf;
}
@@ -219,7 +217,7 @@ dp_rx_buffer_pool_nbuf_alloc(struct dp_soc *soc, uint32_t mac_id,
qdf_nbuf_t nbuf;
nbuf = dp_rx_refill_buff_pool_dequeue_nbuf(soc);
if (nbuf) {
if (qdf_likely(nbuf)) {
DP_STATS_INC(dp_pdev,
rx_refill_buff_pool.num_bufs_allocated, 1);
return nbuf;