lpfc_mem_alloc(9)
π lpfc_mem_alloc π
okay so this is a page from the Kernel API Manual, bestie β it's lpfc_mem_alloc(9) and it's literally the glow-up moment where all the PCI and memory pools get born β¨
πΈ NAME πΈ
lpfc_mem_alloc β create and allocate all PCI and memory pools π
π¦ SYNOPSIS π¦
int lpfc_mem_alloc (struct lpfc_hba *phba , int align );
π ARGUMENTS π
phbaβ the HBA you're setting up pools for. it's giving main character energy, everything hangs off this π«Άalignβ the alignment requirement for the blocks. and listen: it must be a power of two, no cap, that's just the vibe check π₯
β¨ DESCRIPTION β¨
so what does it actually do? glad you asked π
It creates and allocates the PCI pools lpfc_mbuf_pool and lpfc_hrb_pool. iconic.
Then it creates and allocates kmalloc-backed mempools for LPFC_MBOXQ_t and lpfc_nodelist β yes both of them, we're thorough here π
Oh and it also allocates the VPI bitmask. not me forgetting the bitmask π slay.
β NOTES β
π¨ real talk: this one is not interrupt-safe. so do NOT call it from interrupt context, bestie, I'm begging π
π it must be called with no locks held. like, zero locks. drop them all first, periodt.
π§ and the sweet part: if any allocation fails, it frees all successfully allocated memory before returning β so it cleans up after itself before it bounces. king behavior π
π RETURN π
0on success β¨-ENOMEMon failure (if any of the memory allocations fail) π
π SEE ALSO π
- Kernel file
./drivers/scsi/lpfc/lpfc_mem.c lpfc_mem_free(9)lpfc_mem_free_all(9)lpfc_mbuf_alloc(9)__lpfc_mbuf_free(9)lpfc_mbuf_free(9)lpfc_nvmet_buf_alloc(9)lpfc_nvmet_buf_free(9)lpfc_els_hbq_alloc(9)lpfc_els_hbq_free(9)lpfc_sli4_rb_alloc(9)lpfc_sli4_rb_free(9)lpfc_sli4_nvmet_alloc(9)lpfc_sli4_nvmet_free(9)lpfc_in_buf_free(9)lpfc_rq_buf_free(9)
and that's the whole page, bestie π this one came from the source dir ./drivers/scsi/lpfc, dated October 2026, and the page itself is lpfc_mem_alloc(9) β go forth and allocate responsibly πβ¨π¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms