lpfc_cq_create_set(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… lpfc_cq_create_set โ€” or, how to birth a whole squad of Completion Queues (kernel API manual, section 9, bestie)

okay so this is lpfc_cq_create_set(9) from the kernel API manual and yes the name is a mouthful but it's literally the function that spins up an entire set of Completion Queues on the HBA so MRQ can do its thing. sit down, hydrate, and let's go ๐Ÿซถ


โœจ SYNOPSIS โœจ

int lpfc_cq_create_set (struct lpfc_hba *phba , struct lpfc_queue **cqp
, struct lpfc_sli4_hdw_queue *hdwq , uint32_t type , uint32_t subtype );

like look at that signature. five whole arguments. she's doing the most and honestly? she's serving ๐Ÿ’…


๐ŸŽ€ ARGUMENTS ๐ŸŽ€

  • phba โ€” the HBA structure; this is the vibe-setter, it tells us which port we're creating a queue on.
  • cqp โ€” the array of queue structs you're gonna use to actually create those completion queues. think of it as the guest list ๐Ÿ’–
  • hdwq โ€” the hardware queue array that has the EQ you're binding these completion queues to. the plus-one, the link-up, the "you two are together now" ๐ŸŒธ
  • type โ€” what kind of queue this is (EQ, GCQ, MCQ, WCQ, etc). no cap, the etc is doing heavy lifting.
  • subtype โ€” the functional purpose of the queue, aka its whole personality: MBOX, IO, ELS, NVMET, etc โœจ

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so basically ๐Ÿ’€ this function creates a set of completion queues to support MRQ, exactly as detailed in cqp, on a port described by phba โ€” and it does it by sending a CREATE_CQ_SET mailbox command to the HBA. that's the whole plot.

here's the breakdown, bestie, so you don't get lost:

  • the phba struct is the one used to send the mailbox command to the HBA. it's the messenger and the message.
  • the cq struct is used to get the entry count and entry size โ€” the two numbers you need to figure out how many pages to allocate and use for this queue. math, but make it iconic ๐Ÿงฎ
  • the eq is used to indicate which event queue to bind this completion queue to. that's the situationship. ๐Ÿค

this function will send the CREATE_CQ_SET mailbox command to the HBA to set up the completion queue. also? this function is asynchronous and it will wait for the mailbox command to finish before continuing. yes both of those things at once. she contains multitudes ๐Ÿ˜ญ

๐Ÿ’ก lowkey the return values matter, so memorize these: - on success she gives you a zero. slay. โœจ - if she can't allocate enough memory โ†’ -ENOMEM ๐Ÿ˜ญ - if the queue create mailbox command fails โ†’ -ENXIO ๐Ÿ’€

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

okay this section is not a drill. it's the whole extended universe โ€” the kernel file plus three hundred sibling functions, all listed (9) like a very serious group chat roster. i'm not skipping a single one of these queens because each of them ate ๐Ÿ‘‘

kernel file ./drivers/scsi/lpfc/lpfc_sli.c, plus:

๐Ÿซถ and that's the whole friend group. three hundred entries. i counted so you don't have to. iykyk.

๐Ÿงš signing off ๐Ÿงš

this lil page lives in ./drivers/scsi/lpfc, it's dated October 2026, and it answers to the name lpfc_cq_create_set(9). go forth and create your completion queue set, bestie โ€” no cap, you're gonna slay ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from