ib_drain_rq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ib_drain_rq(9) β€” a Kernel API Manual moment ✨

okay so bestie, welcome to the Kernel API Manual page for ib_drain_rq(9) πŸŽ€ this one's short and sweet, and it's lowkey a little diva about the conditions you have to meet before it'll work for you. let's get into it πŸ¦‹


✨ NAME ✨

ib_drain_rq β€” block until all RQ CQEs have been consumed by the application πŸ’– like, it literally just sits there and waits. no cap. it's giving "i'm not leaving until every last completion is handled" energy.


🌸 SYNOPSIS 🌸

void ib_drain_rq (struct ib_qp *qp );

that's it. that's the whole function. one void, one qp, zero drama (mostly). πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • qp β€” the queue pair to drain. this is the QP whose RQ you're waiting on, bestie. that's the whole argument. icon behavior honestly 🫢

πŸ’œ DESCRIPTION πŸ’œ

so here's the vibe check: if the device has a provider-specific drain function, then call that. otherwise, call the generic drain function __ib_drain_rq. that's the fork in the road, iykyk 🌈

but before any of that, the caller must do their homework. and by "homework" i mean all of the following, no skipping, fr fr 😭

  • ensure there is room in the CQ and RQ for the drain work request and completion. like, please make sure there's space?? don't set yourself up for failure πŸ’€
  • allocate the CQ using ib_alloc_cq. non-negotiable, bestie 🌸
  • ensure that there are no other contexts that are posting WRs concurrently. Otherwise the drain is not guaranteed. so like... do not have other contexts posting WRs at the same time. that's the whole rule. if you do, the drain isn't guaranteed and that's not a vibe πŸ™ˆ
⚠️ real talk: that last one is a genuine caveat, not just me being dramatic. concurrent WR posting from other contexts = the drain is not guaranteed. periodt πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/infiniband/core/verbs.c β€” and here's the full squad of sibling functions, all of them, in order, no cap ✨

like, that's a whole friend group right there πŸ’– go say hi to ib_drain_sq(9) and ib_drain_qp(9), they're literally cousins 🧚


and that's the page!! πŸŽ‰ sign-off time: this iconic little number lives over in ./drivers/infiniband/core, and it's dated October 2026 β€” yes, the future, she's booked and busy ⭐ mwah, thanks for reading, go drain responsibly πŸ“πŸ’œ

πŸ“¦ where this page comes from