RDMA_CREATE_SRQ(3)

πŸ’– RDMA_CREATE_SRQ πŸ’–

okay bestie, welcome to the rdma_create_srq page, straight out of the Librdmacm Programmer's Manual (that's the RDMA_CREATE_SRQ(3) one, section 3, iykyk). grab a strawberry πŸ“ and let's allocate a whole shared receive queue together, it's giving infrastructure era.


✨ NAME ✨

rdma_create_srq β€” allocate a shared receive queue. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 SYNOPSIS 🌸

#include <rdma/rdma_verbs.h>

int rdma_create_srq (struct rdma_cm_id *id, struct ibv_pd *pd, struct
ibv_srq_init_attr *attr);

look at her. three arguments. immaculate. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • id β€” the RDMA identifier. your main character ✨
  • pd β€” optional protection domain for the SRQ. optional!! she can show up or she can ghost 🫢
  • attr β€” the initial SRQ attributes. the starting vibe, if you will.

πŸ‘‘ DESCRIPTION πŸ‘‘

Allocate a SRQ (that's a shared receive queue, bestie, keep up πŸ’–) associated with the specified rdma_cm_id.

literally that's the whole thing. she allocates, she associates, she slays.


πŸ”₯ RETURN VALUE πŸ”₯

Returns 0 on success, or -1 on error. and if an error occurs, errno will be set to indicate the failure reason. so if things go sideways, errno is the friend who tells you what actually happened, no cap 😭


🌈 NOTES 🌈

bestie, read this part, it's important, I'm not being dramatic (I'm being a little dramatic).

The rdma_cm_id must be bound to a local RDMA device before calling this function, and the protection domain, if provided, must be for that same device. like, they have to match, they have to be a matched set, it's giving soulmates only. πŸ’ž

After being allocated, the SRQ will be ready to handle posting of receives. so she's immediately employed, immediately booked and busy ✨


πŸ’œ the pd-is-NULL situation

If a protection domain is not given β€” pd parameter is NULL β€” then the rdma_cm_id will be created using a default protection domain. One default protection domain is allocated per RDMA device. so like, the universe provides one for each device, no need to bring your own 🧚


πŸŽ€ the attr situation

The initial SRQ attributes are specified by the attr parameter. The ext.xrc.cq fields in the ibv_srq_init_attr is optional.

If a completion queue is not specified for an XRC SRQ, then a CQ will be allocated by the rdma_cm for the SRQ, along with corresponding completion channels. Completion channels and CQ data created by the rdma_cm are exposed to the user through the rdma_cm_id structure. so she handles the CQ admin herself and then shows you the receipts through rdma_cm_id πŸ“¬


⭐ the attr-comes-back situation

The actual capabilities and properties of the created SRQ will be returned to the user through the attr parameter. so attr is a two-way street, she goes in with your wishes and comes back with the truth.

🚨 and this one, bestie: an rdma_cm_id may only be associated with a single SRQ. one. uno. monogamy only, no situationships πŸ™ˆ

πŸ’€ SEE ALSO πŸ’€

go read those too, they're all part of the same friend group 🫢


librdmacm, dated 2011-06-15 β€” yeah she's an elder but she ATE and she's still iconic, periodt. πŸ’…βœ¨πŸ‘‘

πŸ“¦ where this page comes from