rdma_rw_ctx_destroy(9)
π rdma_rw_ctx_destroy β the kernel API manual, bestie edition β¨
okay so real talk, this one's from the kernel API manual, section 9, and it's literally the cleanup bestie for rdma_rw_ctx_init. Think of it as the "ok we're done here, everybody out of the pool" function π«Ά
πΈ NAME πΈ
rdma_rw_ctx_destroy β releases all the resources that rdma_rw_ctx_init allocated. that's it, that's the whole vibe. it's the undo button, the cleanup crew, the "thanks for coming to my ted talk" π
β¨ SYNOPSIS β¨
void rdma_rw_ctx_destroy(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
u32 port_num, struct scatterlist *sg,
u32 sg_cnt, enum dma_data_direction dir);
no return value, because it's a void and it's got nothing to prove π
π¦ ARGUMENTS π¦
ctxβ the context you're releasing. this is the main character of the whole operation, the thing that's getting freed πqpβ the queue pair we're operating on. yes bestie, the actual QP πport_numβ the port number that the connection is bound to. gotta know which port we're on, iykyksgβ the scatterlist that was used for the READ/WRITE. same list as before, no cap π₯sg_cntβ how many entries are chilling insg. literally just the count πdirβ the direction, and it's very much a two-flavor situation:DMA_TO_DEVICEβ use this for RDMA WRITE βοΈDMA_FROM_DEVICEβ use this for RDMA READ π
β οΈ heads up: getdirright.DMA_TO_DEVICE= RDMA WRITE,DMA_FROM_DEVICE= RDMA READ. don't mix them up, it's giving chaos energy π
π SEE ALSO π
the kernel file lives at ./drivers/infiniband/core/rw.c β go read it, it's iconic, it ate π
and the whole friend group of related calls, all here so you never have to go looking:
rdma_rw_ctx_init(9)rdma_rw_ctx_init_bvec(9)rdma_rw_ctx_signature_init(9)rdma_rw_ctx_wrs(9)rdma_rw_ctx_post(9)rdma_rw_ctx_destroy_bvec(9)rdma_rw_ctx_destroy_signature(9)rdma_rw_mr_factor(9)rdma_rw_max_send_wr(9)
like yes, rdma_rw_ctx_destroy_bvec(9) and rdma_rw_ctx_destroy_signature(9) are the siblings, they're all doing the same cleanup-era thing in slightly different fits π§
sign-off era: this lil page is sourced from ./drivers/infiniband/core and it's dated October 2026 π go free those resources bestie, you got this ππ¦
π¦ 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