rpma_srq_recv(3)
π rpma_srq_recv(3) π
okay bestie, welcome to the RPMA Programmer's Manual β today's episode: rpma_srq_recv, aka the girl who kicks off the receive operation on a shared RQ. yes queen, let's get into it π«Ά
β¨ NAME β¨
rpma_srq_recv β initiate the receive operation in shared RQ
πΈ SYNOPSIS πΈ
#include <librpma.h>
struct rpma_srq;
struct rpma_mr_local;
int rpma_srq_recv(struct rpma_srq *srq, struct rpma_mr_local *dst, size_t offset,
size_t len, const void *op_context);
π¦ DESCRIPTION π¦
so here's the tea π β if multiple local connections are sharing one RQ, rpma_srq_recv() is the one that initiates the receive operation, which preps a buffer for a message that's gonna be sent from the other side of those connections. go peek at rpma_send(3) for the full lore, iykyk.
every single buffer you prep via rpma_srq_recv(3) gets thrown into an unordered set. no line, no queue, no structure β just vibes. when a message finally arrives, it lands in one of the buffers that's been sitting there waiting, and boom π₯ a completion for the receive operation gets generated.
and listen β a buffer for an incoming message has to be prepared beforehand. no prep, no receive. periodt.
the order of buffers in that set? it does NOT affect the order of completions of the receive operations you get via rpma_cq_get_wc(3). don't come for me, that's just how it is.
op_context gets returned in the wr_id field of the completion (struct ibv_wc). cute, right? it comes back to you like a little boomerang π
π NOTE π
in the RDMA standard, receive requests form an ordered queue. the librpma library does NOT inherit this guarantee. not me delivering the chaos π it's giving "we don't do queues here." know that before you build your whole life around ordering, bestie.
π RETURN VALUE π
rpma_srq_recv() returns 0 on success, or a negative error code on failure. slay when it's 0, cry when it's negative, that's the whole deal β¨
π ERRORS π
rpma_srq_recv() can fail with the following errors:
RPMA_E_INVALβsrq == NULLπRPMA_E_INVALβdst == NULL && (offset != 0 || len != 0)RPMA_E_PROVIDERβibv_post_srq_recv(3)failed π
π SEE ALSO π
rpma_mr_reg(3), rpma_srq_new(3), librpma(7) and https://pmem.io/rpma/
and that's the whole page, no crumbs left behind π§
this lil masterpiece is from the RPMA crew, dated 01 April 2024 β rpma_srq_recv(3), out π
π¦ where this page comes from
- ubuntu noble: librpma-dev 1.3.0-2build2 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms