rdma_rw_max_send_wr(9)
π rdma_rw_max_send_wr β the vibe check on yo ur Send WR math π
okay so bestie, this is rdma_rw_max_send_wr(9) from the Kernel API Manual, and honestly? it's a little gift. it does one thing and it does it well: it tells you how many Send WRs you're gonna need for your RDMA read/write contexts before you even build the QP. no cap, it's the "how many snacks do I buy" of kernel RDMA. π
β¨ SYNOPSIS β¨
unsigned int rdma_rw_max_send_wr (struct ib_device *dev , u32 port_num ,
unsigned int max_rdma_ctxs , u32 create_flags );
like... that's the whole signature, and yes the spacing is exactly like that, i don't make the rules π
π«Ά ARGUMENTS π«Ά
devβ the RDMA device. your fave. your main character. πport_numβ the port number. which port, bestie? this one. β¨max_rdma_ctxsβ the number ofrdma_rw_ctxstructures you're working with. this is literally the number everything gets computed from, so pls count correctly πcreate_flagsβ QP create flags. and the important note here: passIB_QP_CREATE_INTEGRITY_ENif data integrity will be enabled on the QP. that's a "don't forget" fr fr, because it changes the math. π
π₯ DESCRIPTION π₯
so it returns the total number of Send Queue entries needed for max_rdma_ctxs. that's the whole errand. π
and the result accounts for memory registration and invalidation work requests when the device requires them β like, it's not just naive multiplication, it knows your device might need extra WRs for that stuff. the way it just... handles that for you. iconic. π
ULPs use this to size Send Queues and Send CQs before creating a Queue Pair. so you call this first, you size your SQ and your CQ off the answer, and then you make the QP. order matters, bestie, that's the entire point. β
ngl if you skip this and just vibe-guess your queue sizes, that's on you. the function is right there. π«Ά
π SEE ALSO π
- Kernel file
./drivers/infiniband/core/rw.cβ the source of truth 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(9)rdma_rw_ctx_destroy_bvec(9)rdma_rw_ctx_destroy_signature(9)rdma_rw_mr_factor(9)
the whole squad, honestly. go read them, they're all friends π¦
and that's the page, babes β¨ β brought to you by the fine folks at ./drivers/infiniband/core, dated October 2026. mwah, stan the kernel, drink water, size your queues correctly πππ
π¦ 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