ib_drain_sq(9)
π 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:
__ib_alloc_pd(9)ib_dealloc_pd_user(9)rdma_copy_ah_attr(9)rdma_replace_ah_attr(9)rdma_move_ah_attr(9)rdma_create_ah(9)rdma_create_user_ah(9)rdma_move_grh_sgid_attr(9)rdma_destroy_ah_attr(9)ib_create_srq_user(9)ib_create_qp_user(9)ib_resolve_eth_dmac(9)ib_modify_qp_with_udata(9)ib_alloc_mr(9)ib_alloc_mr_integrity(9)ib_alloc_xrcd_user(9)ib_dealloc_xrcd_user(9)ib_create_wq(9)ib_destroy_wq_user(9)ib_map_mr_sg_pi(9)ib_map_mr_sg(9)ib_sg_to_pages(9)ib_drain_rq(9)ib_drain_qp(9)rdma_alloc_hw_stats_struct(9)rdma_free_hw_stats_struct(9)
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
- 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