rdma_rw_ctx_init(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ rdma_rw_ctx_init(9) ✨

okay so bestie, this is a page from the Kernel API Manual and it's genuinely about setting up an RDMA READ/WRITE context β€” like, the whole "get your ducks in a row before you yeet work at the queue" moment πŸ¦‹


🌸 NAME 🌸

rdma_rw_ctx_init β€” initialize a RDMA READ/WRITE context πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int rdma_rw_ctx_init (struct rdma_rw_ctx *ctx , struct ib_qp *qp , u32
port_num , struct scatterlist *sg , u32 sg_cnt , u32 sg_offset , u64
remote_addr , u32 rkey , enum dma_data_direction dir );

🫢 ARGUMENTS 🫢

like, one by one, no skipping, periodt:

  • ctx β€” the context you're initializing. this is the glow-up victim, bestie ✨
  • qp β€” the queue pair we're operating on πŸ‘‘
  • port_num β€” the port num that this connection is bound to πŸŽ€
  • sg β€” the scatterlist we're gonna READ from / WRITE to 🌸
  • sg_cnt β€” how many entries live in sg, like headcount for the party πŸŽ‰
  • sg_offset β€” the current byte offset into sg. yes, bytes, not vibes πŸ”₯
  • remote_addr β€” the remote address to read/write, and it's relative to rkey (iykyk) 🌈
  • rkey β€” the remote key we're operating on πŸ”‘
  • dir β€” DMA_TO_DEVICE for RDMA WRITE, DMA_FROM_DEVICE for RDMA READ. literally pick the right one or it's giving chaos 😭

πŸ’€ DESCRIPTION πŸ’€

okay so here's the tea: it returns the number of WQEs that will be needed on the workqueue if it succeeds 🫢 β€” or a negative error code if it doesn't. that's it, that's the whole vibe check πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/infiniband/core/rw.c β€” and the whole friend group:


mwah πŸ’– that's the whole page, go be iconic with your queue pairs β€” shipped out of ./drivers/infiniband/core in October 2026, no cap πŸ“βœ¨

πŸ“¦ where this page comes from