lpfc_mbuf_free(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 the lpfc_mbuf_pool that'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:


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