ib_drain_sq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

ib_drain_sq β€” bestie, this one blocks until all SQ CQEs have been consumed by the application. That's it, that's the vibe. No cap. ✨

(also hi, you're reading a page from the Kernel API Manual, section 9, mwah 🫢)


🌸 SYNOPSIS 🌸

void ib_drain_sq (struct ib_qp *qp );

πŸŽ€ ARGUMENTS πŸŽ€

  • qp β€” the queue pair you're draining, queen. That's the whole job. 🫑

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” if the device has a provider-specific drain function, then literally just call that one. Easy. Slay.

Otherwise? You call the generic drain function __ib_drain_sq. That's the fallback bestie, it's giving "if you don't have a custom one, we gotchu."

But listen β€” the caller (that's you πŸ‘€) must do these things, no skipping:

  • ensure there is room in the CQ and SQ for the drain work request and completion. Like, make space. It's not gonna fit itself. 🧚
  • allocate the CQ using ib_alloc_cq. Non-negotiable, periodt.
  • ensure that there are no other contexts that are posting WRs concurrently. Otherwise the drain is not guaranteed. πŸ’€
fr fr, that last one is serious β€” concurrent WR posters = your drain is a vibe check that might fail. Don't do it. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./drivers/infiniband/core/verbs.c β€” the whole squad lives here:


okay that's the whole page, mwah πŸ’œ β€” this lil icon of a manpage comes from ./drivers/infiniband/core and it's dated October 2026. go drain that SQ bestie, you're gonna ate πŸ’…βœ¨

πŸ“¦ where this page comes from