rpma_srq_recv(3)

πŸ“¦
version 1.3.0 Β· 3 versions
, in ubuntu noble

πŸ’– 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