rpma_cq_wait(3)

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

πŸ’– rpma_cq_wait β€” bestie, it's a librpma(3) situation ✨

okay so this is rpma_cq_wait(3) from the RPMA Programmer's Manual, and it's genuinely one of my faves because it's short and it does exactly one thing. no cap. let's get into it 🫢


πŸŽ€ NAME πŸŽ€

rpma_cq_wait β€” wait for a completion and ack it

like. the name is the whole plot. she waits, she acks, she leaves. main character energy fr fr πŸ’…


✨ SYNOPSIS ✨

#include <librpma.h>

struct rpma_cq;
int rpma_cq_wait(struct rpma_cq *cq);

that's it. that's the whole vibe. struct rpma_cq gets forward-declared and then rpma_cq_wait() takes a pointer to one and hands you back an int. iconic. 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

so rpma_cq_wait() literally waits for an incoming completion event and then acks it. that's the job. she stands there at the door, the completion event shows up, she goes "noted, bestie," and acks it. done. πŸ’œ

but listen β€” the important part, the part you cannot skip, iykyk:

if rpma_cq_wait() succeeds, then all available completions should be collected using rpma_cq_get_wc(3) before the next rpma_cq_wait() call.

like, do not come back to the door before you've dealt with everyone who came through it. that's the rule. don't be that girl. πŸ™ˆ


πŸ”₯ RETURN VALUE πŸ”₯

rpma_cq_wait() returns 0 on success, or a negative error code on failure. that's it. zero means slay, negative means we're in our feelings. 😭


πŸ’€ ERRORS πŸ’€

rpma_cq_wait() can fail with the following errors:

  • RPMA_E_INVAL β€” cq is NULL. girl you passed me nothing. empty-handed. πŸ’€
  • RPMA_E_PROVIDER β€” ibv_req_notify_cq(3) failed with a provider error. the provider said no and honestly we respect her boundaries.
  • RPMA_E_NO_COMPLETION β€” no completions available. nothing in the inbox. ghost town. πŸ‘»
  • RPMA_E_SHARED_CHANNEL β€” the completion event channel is shared and cannot be handled by any particular CQ. it's giving communal living and nobody's claiming responsibility. πŸ™ˆ

🌈 SEE ALSO 🌈

the girlies in the friend group:


anyway that's the whole page, you ate it, go collect your work completions before calling rpma_cq_wait() again, periodt. πŸ’…βœ¨

this has been RPMA, version date 01 April 2024, brought to you as rpma_cq_wait(3). mwah, take care of her πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from