RDMA_CREATE_QP(3)

πŸ’… RDMA_CREATE_QP(3) β€” the librdmacm programmer's manual, but make it cute ✨

okay bestie, sit down, hydrate, because we're allocating a Queue Pair and it's actually not that deep once you get the vibe πŸ¦‹


✨ NAME ✨

rdma_create_qp β€” Allocate a QP. that's it. that's the whole job. iconic behavior honestly πŸ’–


🌸 SYNOPSIS 🌸

#include <rdma/rdma_cma.h>

int rdma_create_qp (struct rdma_cm_id *id, struct ibv_pd *pd, struct
ibv_qp_init_attr *qp_init_attr);

look at her. three args. she's lowkey slaying 🌈


πŸŽ€ ARGUMENTS πŸŽ€

  • id β€” the RDMA identifier. your main character. πŸ’«
  • pd β€” optional protection domain for the QP. optional!! she can be NULL, we'll get to that 🫢
  • qp_init_attr β€” the initial QP attributes. the lewk, if you will ✨

πŸ’– DESCRIPTION πŸ’–

So what we're doing here is allocating a QP that's associated with the specified rdma_cm_id, and then transitioning it so it's ready for sending and receiving. that's the whole plot. no cap πŸ’…


⭐ RETURN VALUE ⭐

Returns 0 on success, or -1 on error. and if an error happens, errno gets set to tell you why, which is genuinely so thoughtful of her 😭


🧚 NOTES 🧚

  • The rdma_cm_id must be bound to a local RDMA device before you call this function. and the protection domain has to be for that same device. periodt. πŸ™ˆ
  • QPs allocated to an rdma_cm_id get automatically transitioned by the librdmacm through their states β€” you don't have to babysit them, she's self-sufficient πŸ’œ
  • After being allocated, the QP will be ready to handle posting of receives. and if the QP is unconnected, it'll be ready to post sends too. go off πŸ”₯
  • If a protection domain is not given β€” like, the pd parameter is NULL β€” then the rdma_cm_id will be created using a default protection domain. and here's the tea: one default protection domain is allocated per RDMA device. one. per device. πŸ“
  • The initial QP attributes are specified by the qp_init_attr parameter. the send_cq and recv_cq fields in the ibv_qp_init_attr are optional β€” if you don't specify a send or receive completion queue, then a CQ will be allocated by the rdma_cm for the QP, along with corresponding completion channels. and those completion channels and CQ data created by the rdma_cm? they get exposed to the user through the rdma_cm_id structure. it's giving generous. it's giving sharing. πŸ’
  • The actual capabilities and properties of the created QP will be returned to you through the qp_init_attr parameter. so check it after, bestie, she updates it in place ✨
  • An rdma_cm_id may only be associated with a single QP. one. monogamy. no sharing, no side quests. πŸ‘‘

πŸ‘‘ SEE ALSO πŸ‘‘

the whole friend group. go read them too 🫢


that's the page, babe. now go bind your id and allocate responsibly. mwah πŸ’‹

this has been librdmacm, dated 2007-05-15 β€” yes she's vintage, yes she still eats. RDMA_CREATE_QP(3) out. πŸ’…βœ¨

πŸ“¦ where this page comes from