lpfc_mbuf_alloc(9)
π lpfc_mbuf_alloc(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β yes we're in kernel-land today, and no, it's not scary, i promise π«Ά this one's from <rainbow>lpfc_mbuf_alloc(9)</rainbow> and it's literally just "gimme a buffer, pls" energy.
β¨ NAME β¨
lpfc_mbuf_alloc β allocate an mbuf from the lpfc_mbuf_pool PCI pool π
πΈ SYNOPSIS πΈ
void * lpfc_mbuf_alloc (struct lpfc_hba *phba , int mem_flags ,
dma_addr_t *handle );
like, that's the whole vibe. three args, one pointer back. slay. π
π¦ ARGUMENTS π¦
phbaβ the HBA that owns the pool we're allocating from. it's giving "whose house are we raiding" energy πmem_flagsβ tells you if this is a priority (MEM_PRI) allocation. fancy mode, basically β¨handleβ used to return the DMA-mapped address of the mbuf back to you. it's the little messenger that brings the address home π
π DESCRIPTION π
so what does it actually do? it allocates a DMA-mapped buffer from the lpfc_mbuf_pool PCI pool. periodt. π«Ά
here's the tea tho β the order of operations matters, iykyk: it allocates from the generic dma_pool_alloc function first, and if that fails and mem_flags has MEM_PRI set (which is, btw, the only defined flag π), then it returns an mbuf from the HBA's pool instead.
so it's like: try the normal spot, and if that's a flop and you flagged priority, fall back to the HBA's own stash. backup plan is iconic, honestly π
π NOTES π
bestie pls read this part, it's important π
- Not interrupt-safe. like, do not come at this from interrupt context, fr fr π
- Must be called with no locks held. none. zero. zip. π
- Takes
phba->hbalock. yes, it takes it β that's why you don't. the way that it handles its own lockingβ¦ main character energy tbh π
β RETURN β
- pointer to the allocated mbuf on success π
NULLon failure π
π SEE ALSO π
kernel file ./drivers/scsi/lpfc/lpfc_mem.c plus the whole friend group π«Ά:
lpfc_mem_alloc(9)lpfc_mem_free(9)lpfc_mem_free_all(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 page, bestie π§π this lil gem lives under ./drivers/scsi/lpfc and it's dated October 2026 β so like, future vibes only πΈβ go forth and allocate responsibly, mwah π
π¦ 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