rdma_rw_ctx_init_bvec(9)
π NAME π
rdma_rw_ctx_init_bvec β bestie, this is the one that initializes a RDMA READ/WRITE context straight from a bio_vec. π
Quick vibe check: we're in the Kernel API Manual, section 9, so likeβ¦ kernel-internals territory. Buckle up, it's giving low-level but make it cute. β¨
β¨ SYNOPSIS β¨
int rdma_rw_ctx_init_bvec (struct rdma_rw_ctx *ctx , struct ib_qp *qp ,
u32 port_num , const struct bio_vec *bvecs , u32 nr_bvec , struct
bvec_iter iter , u64 remote_addr , u32 rkey , enum dma_data_direction
dir );
No cap, that's a whole lot of arguments. Let's break each one down so you're not just nodding along π
πΈ ARGUMENTS πΈ
ctxβ the context you're initializing. This is the main character of the whole operation, honestly. πqpβ the queue pair you're operating on. The literal connection vessel, iykyk.port_numβ the port number that this connection is bound to. π«Άbvecsβ thebio_vecarray you're gonna READ from / WRITE to. The data's in there.nr_bvecβ how many entries live inbvecs. Just the count, nothing spicy.iterβ abveciterator that describes the offset and the length. It's the little map telling everyone where the good stuff is πΊοΈremote_addrβ the remote address to read/write, and yes it's relative torkey(important, don't forget that part).rkeyβ the remote key you're operating on. πdirβ the direction, and this one's specific:DMA_TO_DEVICEfor an RDMA WRITE,DMA_FROM_DEVICEfor an RDMA READ. Getting this backwards is not it, bestie π
π¦ DESCRIPTION π¦
Okay so here's the slay: this thing maps the bio_vec array directly, which means it skips the intermediate scatterlist conversion entirely. No middleman, no extra steps, we love efficiency. β‘
It also supports MR registration for iWARP devices and for force_mr mode. π
On success it returns the number of WQEs that will be needed on the workqueue. On failure it hands you back a negative error code:
-EINVALβ eithernr_bvecis zero, oriter.bi_sizeis zero. (i.e. you gave it nothing to work with π)-ENOMEMβ DMA mapping or memory allocation failed. Memory said "no" π
Heads up bestie: those two error codes are the only ones documented here. Don't go inventing new ones, fr fr.
π SEE ALSO π
Kernel file ./drivers/infiniband/core/rw.c and its whole friend group:
rdma_rw_ctx_init(9)rdma_rw_ctx_signature_init(9)rdma_rw_ctx_wrs(9)rdma_rw_ctx_post(9)rdma_rw_ctx_destroy(9)rdma_rw_ctx_destroy_bvec(9)rdma_rw_ctx_destroy_signature(9)rdma_rw_mr_factor(9)rdma_rw_max_send_wr(9)
And that's the whole page, bestie β go init some contexts responsibly π«Άβ¨
Sign-off time π: this one lives in ./drivers/infiniband/core, it's dated October 2026, and the page itself is rdma_rw_ctx_init_bvec(9). Periodt. π
π¦ 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