rdma_rw_ctx_destroy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, iykyk
  • sg β€” the scatterlist that was used for the READ/WRITE. same list as before, no cap πŸ”₯
  • sg_cnt β€” how many entries are chilling in sg. 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: get dir right. 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:

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