rdma_rw_max_send_wr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ 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 of rdma_rw_ctx structures 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: pass IB_QP_CREATE_INTEGRITY_EN if 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 πŸ‘‘

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