Lines Matching refs:buff_pool
96 struct rx_buff_pool *buff_pool; in dp_rx_buffer_pool_nbuf_free() local
102 buff_pool = &soc->rx_buff_pool[mac_id]; in dp_rx_buffer_pool_nbuf_free()
104 if (qdf_likely(qdf_nbuf_queue_head_qlen(&buff_pool->emerg_nbuf_q) >= in dp_rx_buffer_pool_nbuf_free()
106 !buff_pool->is_initialized) in dp_rx_buffer_pool_nbuf_free()
111 qdf_nbuf_queue_head_enqueue_tail(&buff_pool->emerg_nbuf_q, nbuf); in dp_rx_buffer_pool_nbuf_free()
117 struct rx_refill_buff_pool *buff_pool; in dp_rx_refill_buff_pool_enqueue() local
131 buff_pool = &soc->rx_refill_buff_pool; in dp_rx_refill_buff_pool_enqueue()
133 if (!buff_pool->is_initialized) in dp_rx_refill_buff_pool_enqueue()
136 head = buff_pool->head; in dp_rx_refill_buff_pool_enqueue()
137 tail = buff_pool->tail; in dp_rx_refill_buff_pool_enqueue()
141 total_num_refill = (buff_pool->max_bufq_len - head + in dp_rx_refill_buff_pool_enqueue()
173 buff_pool->buf_elem[head++] = nbuf; in dp_rx_refill_buff_pool_enqueue()
174 head &= (buff_pool->max_bufq_len - 1); in dp_rx_refill_buff_pool_enqueue()
179 buff_pool->head = head; in dp_rx_refill_buff_pool_enqueue()
185 DP_STATS_INC(buff_pool->dp_pdev, in dp_rx_refill_buff_pool_enqueue()
192 struct rx_refill_buff_pool *buff_pool = &soc->rx_refill_buff_pool; in dp_rx_refill_buff_pool_dequeue_nbuf() local
196 head = buff_pool->head; in dp_rx_refill_buff_pool_dequeue_nbuf()
197 tail = buff_pool->tail; in dp_rx_refill_buff_pool_dequeue_nbuf()
202 nbuf = buff_pool->buf_elem[tail++]; in dp_rx_refill_buff_pool_dequeue_nbuf()
203 tail &= (buff_pool->max_bufq_len - 1); in dp_rx_refill_buff_pool_dequeue_nbuf()
204 buff_pool->tail = tail; in dp_rx_refill_buff_pool_dequeue_nbuf()
215 struct rx_buff_pool *buff_pool; in dp_rx_buffer_pool_nbuf_alloc() local
229 buff_pool = &soc->rx_buff_pool[mac_id]; in dp_rx_buffer_pool_nbuf_alloc()
237 if (!buff_pool->is_initialized) in dp_rx_buffer_pool_nbuf_alloc()
241 buff_pool->nbuf_fail_cnt = 0; in dp_rx_buffer_pool_nbuf_alloc()
245 buff_pool->nbuf_fail_cnt++; in dp_rx_buffer_pool_nbuf_alloc()
248 if (buff_pool->nbuf_fail_cnt >= DP_RX_BUFFER_POOL_ALLOC_THRES || in dp_rx_buffer_pool_nbuf_alloc()
250 nbuf = qdf_nbuf_queue_head_dequeue(&buff_pool->emerg_nbuf_q); in dp_rx_buffer_pool_nbuf_alloc()
287 struct rx_refill_buff_pool *buff_pool = &soc->rx_refill_buff_pool; in dp_rx_refill_buff_pool_init() local
294 buff_pool->is_initialized = false; in dp_rx_refill_buff_pool_init()
298 buff_pool->max_bufq_len = in dp_rx_refill_buff_pool_init()
301 buff_pool->buf_elem = qdf_mem_malloc(buff_pool->max_bufq_len * in dp_rx_refill_buff_pool_init()
303 if (!buff_pool->buf_elem) { in dp_rx_refill_buff_pool_init()
305 buff_pool->is_initialized = false; in dp_rx_refill_buff_pool_init()
309 buff_pool->dp_pdev = dp_get_pdev_for_lmac_id(soc, 0); in dp_rx_refill_buff_pool_init()
310 buff_pool->tail = 0; in dp_rx_refill_buff_pool_init()
312 for (i = 0; i < (buff_pool->max_bufq_len - 1); i++) { in dp_rx_refill_buff_pool_init()
333 buff_pool->buf_elem[head] = nbuf; in dp_rx_refill_buff_pool_init()
337 buff_pool->head = head; in dp_rx_refill_buff_pool_init()
340 buff_pool->max_bufq_len, in dp_rx_refill_buff_pool_init()
341 buff_pool->head); in dp_rx_refill_buff_pool_init()
343 buff_pool->is_initialized = true; in dp_rx_refill_buff_pool_init()
349 struct rx_buff_pool *buff_pool = &soc->rx_buff_pool[mac_id]; in dp_rx_buffer_pool_init() local
357 buff_pool->is_initialized = false; in dp_rx_buffer_pool_init()
361 if (buff_pool->is_initialized) in dp_rx_buffer_pool_init()
364 qdf_nbuf_queue_head_init(&buff_pool->emerg_nbuf_q); in dp_rx_buffer_pool_init()
372 qdf_nbuf_queue_head_enqueue_tail(&buff_pool->emerg_nbuf_q, in dp_rx_buffer_pool_init()
378 qdf_nbuf_queue_head_qlen(&buff_pool->emerg_nbuf_q)); in dp_rx_buffer_pool_init()
380 buff_pool->is_initialized = true; in dp_rx_buffer_pool_init()
385 struct rx_refill_buff_pool *buff_pool = &soc->rx_refill_buff_pool; in dp_rx_refill_buff_pool_deinit() local
390 if (!buff_pool->is_initialized) in dp_rx_refill_buff_pool_deinit()
405 count, buff_pool->head, buff_pool->tail); in dp_rx_refill_buff_pool_deinit()
407 qdf_mem_free(buff_pool->buf_elem); in dp_rx_refill_buff_pool_deinit()
408 buff_pool->is_initialized = false; in dp_rx_refill_buff_pool_deinit()
413 struct rx_buff_pool *buff_pool = &soc->rx_buff_pool[mac_id]; in dp_rx_buffer_pool_deinit() local
418 if (!buff_pool->is_initialized) in dp_rx_buffer_pool_deinit()
422 qdf_nbuf_queue_head_qlen(&buff_pool->emerg_nbuf_q)); in dp_rx_buffer_pool_deinit()
424 while ((nbuf = qdf_nbuf_queue_head_dequeue(&buff_pool->emerg_nbuf_q))) in dp_rx_buffer_pool_deinit()
427 buff_pool->is_initialized = false; in dp_rx_buffer_pool_deinit()