lpfc_mbuf_free(9)
π lpfc_mbuf_free β the kernel API manual, section 9, bestie edition π
Okay so welcome to lpfc_mbuf_free(9) from the Kernel API Manual, section 9 β literally the group chat where kernel devs learn how to hand an mbuf back to the lpfc_mbuf_pool PCI pool. Unlocked, no cap. π¦
β¨ NAME β¨
lpfc_mbuf_free β free an mbuf from the lpfc_mbuf_pool PCI pool, and yes it's the unlocked version, she does her own locking, we love a self-sufficient queen π
πΈ SYNOPSIS πΈ
void lpfc_mbuf_free (struct lpfc_hba * phba , void *virt , dma_addr_t
dma );
That's the whole thing. void, returns nothing, gives nothing back except a freed mbuf and a sense of peace. π
π§ ARGUMENTS π§
phbaβ the HBA that owns the pool we're returning to. Like, whose pool is this? Theirs. π«Άvirtβ the mbuf to free. The actual lil guy going home.dmaβ the DMA-mapped address of thelpfc_mbuf_poolthat's getting freed. Gotta be mapped, gotta be freed, periodt.
π DESCRIPTION π
So here's the vibe check: this returns an mbuf to the lpfc_mbuf_pool β wait, specifically, it returns the mbuf to the lpfc_mbuf_safety_pool if it's below its max_count, and frees the mbuf otherwise. Two paths, one function, she's flexible. β¨
Like, if there's room in the safety pool, congrats, the mbuf gets to chill there instead of being yeeted into the void. If the safety pool is already at max, wellβ¦ bye bestie, it gets freed. π
π₯ NOTES π₯
Takes phba->hbalock. Not me taking my own lock, main character energy fr fr.
Can be called with or without other locks held β so she's lowkey flexible about it. π
Ngl, the lock is its concern, not yours. She handles phba->hbalock herself, so don't go thinking you need to wrap this in something extra.
β RETURN β
None. Nothing. Nada. She's a void function, she gives you zero information back and honestly? Iconic. π
π SEE ALSO π
Go check out the kernel file ./drivers/scsi/lpfc/lpfc_mem.c β that's the home base, iykyk π β and then the whole extended family:
lpfc_mem_alloc(9)lpfc_mem_free(9)lpfc_mem_free_all(9)lpfc_mbuf_alloc(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)
Okay that's the whole page, muah π β brought to you by the fine folks over at ./drivers/scsi/lpfc, dated October 2026, which is likeβ¦ the future?? Obsessed. Take care of your mbufs, bestie, and remember: safety pool first, max_count is the limit, and the lock is already handled. π¦β¨π
π¦ 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