Lines Matching refs:phba

52 lpfc_mem_alloc_active_rrq_pool_s4(struct lpfc_hba *phba) {  in lpfc_mem_alloc_active_rrq_pool_s4()  argument
54 int max_xri = phba->sli4_hba.max_cfg_param.max_xri; in lpfc_mem_alloc_active_rrq_pool_s4()
60 phba->cfg_rrq_xri_bitmap_sz = bytes; in lpfc_mem_alloc_active_rrq_pool_s4()
61 phba->active_rrq_pool = mempool_create_kmalloc_pool(LPFC_MEM_POOL_SIZE, in lpfc_mem_alloc_active_rrq_pool_s4()
63 if (!phba->active_rrq_pool) in lpfc_mem_alloc_active_rrq_pool_s4()
86 lpfc_mem_alloc(struct lpfc_hba *phba, int align) in lpfc_mem_alloc() argument
88 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool; in lpfc_mem_alloc()
92 phba->lpfc_mbuf_pool = dma_pool_create("lpfc_mbuf_pool", &phba->pcidev->dev, in lpfc_mem_alloc()
95 if (!phba->lpfc_mbuf_pool) in lpfc_mem_alloc()
107 pool->elements[i].virt = dma_pool_alloc(phba->lpfc_mbuf_pool, in lpfc_mem_alloc()
115 phba->mbox_mem_pool = mempool_create_kmalloc_pool(LPFC_MBX_POOL_SIZE, in lpfc_mem_alloc()
117 if (!phba->mbox_mem_pool) in lpfc_mem_alloc()
120 phba->nlp_mem_pool = mempool_create_kmalloc_pool(LPFC_MEM_POOL_SIZE, in lpfc_mem_alloc()
122 if (!phba->nlp_mem_pool) in lpfc_mem_alloc()
125 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_mem_alloc()
126 phba->rrq_pool = in lpfc_mem_alloc()
129 if (!phba->rrq_pool) in lpfc_mem_alloc()
131 phba->lpfc_hrb_pool = dma_pool_create("lpfc_hrb_pool", in lpfc_mem_alloc()
132 &phba->pcidev->dev, in lpfc_mem_alloc()
134 if (!phba->lpfc_hrb_pool) in lpfc_mem_alloc()
137 phba->lpfc_drb_pool = dma_pool_create("lpfc_drb_pool", in lpfc_mem_alloc()
138 &phba->pcidev->dev, in lpfc_mem_alloc()
140 if (!phba->lpfc_drb_pool) in lpfc_mem_alloc()
142 phba->lpfc_hbq_pool = NULL; in lpfc_mem_alloc()
144 phba->lpfc_hbq_pool = dma_pool_create("lpfc_hbq_pool", in lpfc_mem_alloc()
145 &phba->pcidev->dev, LPFC_BPL_SIZE, align, 0); in lpfc_mem_alloc()
146 if (!phba->lpfc_hbq_pool) in lpfc_mem_alloc()
148 phba->lpfc_hrb_pool = NULL; in lpfc_mem_alloc()
149 phba->lpfc_drb_pool = NULL; in lpfc_mem_alloc()
152 if (phba->cfg_EnableXLane) { in lpfc_mem_alloc()
153 phba->device_data_mem_pool = mempool_create_kmalloc_pool( in lpfc_mem_alloc()
156 if (!phba->device_data_mem_pool) in lpfc_mem_alloc()
159 phba->device_data_mem_pool = NULL; in lpfc_mem_alloc()
164 dma_pool_destroy(phba->lpfc_drb_pool); in lpfc_mem_alloc()
165 phba->lpfc_drb_pool = NULL; in lpfc_mem_alloc()
167 dma_pool_destroy(phba->lpfc_hrb_pool); in lpfc_mem_alloc()
168 phba->lpfc_hrb_pool = NULL; in lpfc_mem_alloc()
170 mempool_destroy(phba->rrq_pool); in lpfc_mem_alloc()
171 phba->rrq_pool = NULL; in lpfc_mem_alloc()
173 mempool_destroy(phba->nlp_mem_pool); in lpfc_mem_alloc()
174 phba->nlp_mem_pool = NULL; in lpfc_mem_alloc()
176 mempool_destroy(phba->mbox_mem_pool); in lpfc_mem_alloc()
177 phba->mbox_mem_pool = NULL; in lpfc_mem_alloc()
180 dma_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt, in lpfc_mem_alloc()
184 dma_pool_destroy(phba->lpfc_mbuf_pool); in lpfc_mem_alloc()
185 phba->lpfc_mbuf_pool = NULL; in lpfc_mem_alloc()
191 lpfc_nvmet_mem_alloc(struct lpfc_hba *phba) in lpfc_nvmet_mem_alloc() argument
193 phba->lpfc_nvmet_drb_pool = in lpfc_nvmet_mem_alloc()
195 &phba->pcidev->dev, LPFC_NVMET_DATA_BUF_SIZE, in lpfc_nvmet_mem_alloc()
197 if (!phba->lpfc_nvmet_drb_pool) { in lpfc_nvmet_mem_alloc()
198 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, in lpfc_nvmet_mem_alloc()
215 lpfc_mem_free(struct lpfc_hba *phba) in lpfc_mem_free() argument
218 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool; in lpfc_mem_free()
222 lpfc_sli_hbqbuf_free_all(phba); in lpfc_mem_free()
223 dma_pool_destroy(phba->lpfc_nvmet_drb_pool); in lpfc_mem_free()
224 phba->lpfc_nvmet_drb_pool = NULL; in lpfc_mem_free()
226 dma_pool_destroy(phba->lpfc_drb_pool); in lpfc_mem_free()
227 phba->lpfc_drb_pool = NULL; in lpfc_mem_free()
229 dma_pool_destroy(phba->lpfc_hrb_pool); in lpfc_mem_free()
230 phba->lpfc_hrb_pool = NULL; in lpfc_mem_free()
232 dma_pool_destroy(phba->lpfc_hbq_pool); in lpfc_mem_free()
233 phba->lpfc_hbq_pool = NULL; in lpfc_mem_free()
235 mempool_destroy(phba->rrq_pool); in lpfc_mem_free()
236 phba->rrq_pool = NULL; in lpfc_mem_free()
239 mempool_destroy(phba->nlp_mem_pool); in lpfc_mem_free()
240 phba->nlp_mem_pool = NULL; in lpfc_mem_free()
241 if (phba->sli_rev == LPFC_SLI_REV4 && phba->active_rrq_pool) { in lpfc_mem_free()
242 mempool_destroy(phba->active_rrq_pool); in lpfc_mem_free()
243 phba->active_rrq_pool = NULL; in lpfc_mem_free()
247 mempool_destroy(phba->mbox_mem_pool); in lpfc_mem_free()
248 phba->mbox_mem_pool = NULL; in lpfc_mem_free()
252 dma_pool_free(phba->lpfc_mbuf_pool, pool->elements[i].virt, in lpfc_mem_free()
256 dma_pool_destroy(phba->lpfc_mbuf_pool); in lpfc_mem_free()
257 phba->lpfc_mbuf_pool = NULL; in lpfc_mem_free()
260 if (phba->device_data_mem_pool) { in lpfc_mem_free()
262 while (!list_empty(&phba->luns)) { in lpfc_mem_free()
263 device_data = list_first_entry(&phba->luns, in lpfc_mem_free()
267 mempool_free(device_data, phba->device_data_mem_pool); in lpfc_mem_free()
269 mempool_destroy(phba->device_data_mem_pool); in lpfc_mem_free()
271 phba->device_data_mem_pool = NULL; in lpfc_mem_free()
287 lpfc_mem_free_all(struct lpfc_hba *phba) in lpfc_mem_free_all() argument
289 struct lpfc_sli *psli = &phba->sli; in lpfc_mem_free_all()
297 lpfc_mbuf_free(phba, mp->virt, mp->phys); in lpfc_mem_free_all()
301 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_mem_free_all()
307 lpfc_mbuf_free(phba, mp->virt, mp->phys); in lpfc_mem_free_all()
311 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_mem_free_all()
314 spin_lock_irq(&phba->hbalock); in lpfc_mem_free_all()
316 spin_unlock_irq(&phba->hbalock); in lpfc_mem_free_all()
321 lpfc_mbuf_free(phba, mp->virt, mp->phys); in lpfc_mem_free_all()
324 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_mem_free_all()
329 lpfc_mem_free(phba); in lpfc_mem_free_all()
332 dma_pool_destroy(phba->lpfc_sg_dma_buf_pool); in lpfc_mem_free_all()
333 phba->lpfc_sg_dma_buf_pool = NULL; in lpfc_mem_free_all()
335 dma_pool_destroy(phba->lpfc_cmd_rsp_buf_pool); in lpfc_mem_free_all()
336 phba->lpfc_cmd_rsp_buf_pool = NULL; in lpfc_mem_free_all()
339 if (phba->cgn_i) { in lpfc_mem_free_all()
340 dma_free_coherent(&phba->pcidev->dev, in lpfc_mem_free_all()
342 phba->cgn_i->virt, phba->cgn_i->phys); in lpfc_mem_free_all()
343 kfree(phba->cgn_i); in lpfc_mem_free_all()
344 phba->cgn_i = NULL; in lpfc_mem_free_all()
348 if (phba->rx_monitor) { in lpfc_mem_free_all()
349 lpfc_rx_monitor_destroy_ring(phba->rx_monitor); in lpfc_mem_free_all()
350 kfree(phba->rx_monitor); in lpfc_mem_free_all()
351 phba->rx_monitor = NULL; in lpfc_mem_free_all()
380 lpfc_mbuf_alloc(struct lpfc_hba *phba, int mem_flags, dma_addr_t *handle) in lpfc_mbuf_alloc() argument
382 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool; in lpfc_mbuf_alloc()
386 ret = dma_pool_alloc(phba->lpfc_mbuf_pool, GFP_KERNEL, handle); in lpfc_mbuf_alloc()
388 spin_lock_irqsave(&phba->hbalock, iflags); in lpfc_mbuf_alloc()
394 spin_unlock_irqrestore(&phba->hbalock, iflags); in lpfc_mbuf_alloc()
413 __lpfc_mbuf_free(struct lpfc_hba * phba, void *virt, dma_addr_t dma) in __lpfc_mbuf_free() argument
415 struct lpfc_dma_pool *pool = &phba->lpfc_mbuf_safety_pool; in __lpfc_mbuf_free()
422 dma_pool_free(phba->lpfc_mbuf_pool, virt, dma); in __lpfc_mbuf_free()
441 lpfc_mbuf_free(struct lpfc_hba * phba, void *virt, dma_addr_t dma) in lpfc_mbuf_free() argument
445 spin_lock_irqsave(&phba->hbalock, iflags); in lpfc_mbuf_free()
446 __lpfc_mbuf_free(phba, virt, dma); in lpfc_mbuf_free()
447 spin_unlock_irqrestore(&phba->hbalock, iflags); in lpfc_mbuf_free()
466 lpfc_nvmet_buf_alloc(struct lpfc_hba *phba, int mem_flags, dma_addr_t *handle) in lpfc_nvmet_buf_alloc() argument
470 ret = dma_pool_alloc(phba->lpfc_sg_dma_buf_pool, GFP_KERNEL, handle); in lpfc_nvmet_buf_alloc()
484 lpfc_nvmet_buf_free(struct lpfc_hba *phba, void *virt, dma_addr_t dma) in lpfc_nvmet_buf_free() argument
486 dma_pool_free(phba->lpfc_sg_dma_buf_pool, virt, dma); in lpfc_nvmet_buf_free()
503 lpfc_els_hbq_alloc(struct lpfc_hba *phba) in lpfc_els_hbq_alloc() argument
511 hbqbp->dbuf.virt = dma_pool_alloc(phba->lpfc_hbq_pool, GFP_KERNEL, in lpfc_els_hbq_alloc()
534 lpfc_els_hbq_free(struct lpfc_hba *phba, struct hbq_dmabuf *hbqbp) in lpfc_els_hbq_free() argument
536 dma_pool_free(phba->lpfc_hbq_pool, hbqbp->dbuf.virt, hbqbp->dbuf.phys); in lpfc_els_hbq_free()
555 lpfc_sli4_rb_alloc(struct lpfc_hba *phba) in lpfc_sli4_rb_alloc() argument
563 dma_buf->hbuf.virt = dma_pool_alloc(phba->lpfc_hrb_pool, GFP_KERNEL, in lpfc_sli4_rb_alloc()
569 dma_buf->dbuf.virt = dma_pool_alloc(phba->lpfc_drb_pool, GFP_KERNEL, in lpfc_sli4_rb_alloc()
572 dma_pool_free(phba->lpfc_hrb_pool, dma_buf->hbuf.virt, in lpfc_sli4_rb_alloc()
594 lpfc_sli4_rb_free(struct lpfc_hba *phba, struct hbq_dmabuf *dmab) in lpfc_sli4_rb_free() argument
596 dma_pool_free(phba->lpfc_hrb_pool, dmab->hbuf.virt, dmab->hbuf.phys); in lpfc_sli4_rb_free()
597 dma_pool_free(phba->lpfc_drb_pool, dmab->dbuf.virt, dmab->dbuf.phys); in lpfc_sli4_rb_free()
613 lpfc_sli4_nvmet_alloc(struct lpfc_hba *phba) in lpfc_sli4_nvmet_alloc() argument
621 dma_buf->hbuf.virt = dma_pool_alloc(phba->lpfc_hrb_pool, GFP_KERNEL, in lpfc_sli4_nvmet_alloc()
627 dma_buf->dbuf.virt = dma_pool_alloc(phba->lpfc_nvmet_drb_pool, in lpfc_sli4_nvmet_alloc()
630 dma_pool_free(phba->lpfc_hrb_pool, dma_buf->hbuf.virt, in lpfc_sli4_nvmet_alloc()
652 lpfc_sli4_nvmet_free(struct lpfc_hba *phba, struct rqb_dmabuf *dmab) in lpfc_sli4_nvmet_free() argument
654 dma_pool_free(phba->lpfc_hrb_pool, dmab->hbuf.virt, dmab->hbuf.phys); in lpfc_sli4_nvmet_free()
655 dma_pool_free(phba->lpfc_nvmet_drb_pool, in lpfc_sli4_nvmet_free()
673 lpfc_in_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp) in lpfc_in_buf_free() argument
681 if (phba->sli3_options & LPFC_SLI3_HBQ_ENABLED) { in lpfc_in_buf_free()
684 spin_lock_irqsave(&phba->hbalock, flags); in lpfc_in_buf_free()
685 if (!phba->hbq_in_use) { in lpfc_in_buf_free()
686 spin_unlock_irqrestore(&phba->hbalock, flags); in lpfc_in_buf_free()
691 (phba->hbqs[LPFC_ELS_HBQ].hbq_free_buffer) in lpfc_in_buf_free()
692 (phba, hbq_entry); in lpfc_in_buf_free()
694 lpfc_sli_free_hbq(phba, hbq_entry); in lpfc_in_buf_free()
696 spin_unlock_irqrestore(&phba->hbalock, flags); in lpfc_in_buf_free()
698 lpfc_mbuf_free(phba, mp->virt, mp->phys); in lpfc_in_buf_free()
717 lpfc_rq_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp) in lpfc_rq_buf_free() argument
732 spin_lock_irqsave(&phba->hbalock, flags); in lpfc_rq_buf_free()
740 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, in lpfc_rq_buf_free()
749 (rqbp->rqb_free_buffer)(phba, rqb_entry); in lpfc_rq_buf_free()
755 spin_unlock_irqrestore(&phba->hbalock, flags); in lpfc_rq_buf_free()