Lines Matching refs:pool

45 #define LPFC_MBUF_POOL_SIZE     64      /* max elements in MBUF safety pool */
46 #define LPFC_MEM_POOL_SIZE 64 /* max elem in non-DMA safety pool */
47 #define LPFC_DEVICE_DATA_POOL_SIZE 64 /* max elements in device data pool */
48 #define LPFC_RRQ_POOL_SIZE 256 /* max elements in non-DMA pool */
49 #define LPFC_MBX_POOL_SIZE 256 /* max elements in MBX non-DMA pool */
88 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool;
98 pool->elements = kmalloc_array(LPFC_MBUF_POOL_SIZE,
101 if (!pool->elements)
104 pool->max_count = 0;
105 pool->current_count = 0;
107 pool->elements[i].virt = dma_pool_alloc(phba->lpfc_mbuf_pool,
108 GFP_KERNEL, &pool->elements[i].phys);
109 if (!pool->elements[i].virt)
111 pool->max_count++;
112 pool->current_count++;
180 dma_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt,
181 pool->elements[i].phys);
182 kfree(pool->elements);
218 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool;
238 /* Free NLP memory pool */
246 /* Free mbox memory pool */
250 /* Free MBUF memory pool */
251 for (i = 0; i < pool->current_count; i++)
252 dma_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt,
253 pool->elements[i].phys);
254 kfree(pool->elements);
259 /* Free Device Data memory pool */
261 /* Ensure all objects have been returned to the pool */
293 /* Free memory used in mailbox queue back to mailbox memory pool */
303 /* Free memory used in mailbox cmpl list back to mailbox memory pool */
313 /* Free the active mailbox command back to the mailbox memory pool */
331 /* Free DMA buffer memory pool */
362 * lpfc_mbuf_alloc - Allocate an mbuf from the lpfc_mbuf_pool PCI pool
363 * @phba: HBA which owns the pool to allocate from
367 * Description: Allocates a DMA-mapped buffer from the lpfc_mbuf_pool PCI pool.
370 * HBA's pool.
382 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool;
389 if (!ret && (mem_flags & MEM_PRI) && pool->current_count) {
390 pool->current_count--;
391 ret = pool->elements[pool->current_count].virt;
392 *handle = pool->elements[pool->current_count].phys;
399 * __lpfc_mbuf_free - Free an mbuf from the lpfc_mbuf_pool PCI pool (locked)
400 * @phba: HBA which owns the pool to return to
415 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool;
417 if (pool->current_count < pool->max_count) {
418 pool->elements[pool->current_count].virt = virt;
419 pool->elements[pool->current_count].phys = dma;
420 pool->current_count++;
428 * lpfc_mbuf_free - Free an mbuf from the lpfc_mbuf_pool PCI pool (unlocked)
429 * @phba: HBA which owns the pool to return to
453 * lpfc_sg_dma_buf_pool PCI pool
454 * @phba: HBA which owns the pool to allocate from
459 * PCI pool. Allocates from generic dma_pool_alloc function.
476 * PCI pool
477 * @phba: HBA which owns the pool to return to
494 * pool along a non-DMA-mapped container for it.
546 * pool along a non-DMA-mapped container for it.
606 * pool along a non-DMA-mapped container for it.