UMAD_RECV(3)

πŸ“¦
version 65.0 Β· 2 versions
  • 65.0 Β· alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.3.10.2 Β· nixos 26.05, nixpkgs unstable
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’Œ UMAD_RECV(3) β€” the OpenIB Programmer's Manual girlies know

okay so bestie, welcome to umad_recv(3) 🫢 this is the one where you literally just wait for a MAD message to show up at your port. it's giving patient main character energy. no cap.


✨ NAME ✨

umad_recv β€” receive umad πŸ’–


🌸 SYNOPSIS 🌸

#include <infiniband/umad.h>

int umad_recv(int portid, void *umad, int *length, int timeout_ms);

πŸŽ€ DESCRIPTION πŸŽ€

umad_recv() sits there and waits up to timeout_ms milliseconds for an incoming MAD message to be received from the port that portid points at. it's literally just vibing until the mail arrives. πŸ’…

a MAD "message" is either a single MAD packet or a coalesced multipacket RMPP transmission. in the RMPP case, the header of the first RMPP packet gets returned as the header of the buffer, and the buffer data holds the coalesced data section of every subsequent RMPP MAD packet in that transmission. so basically all the RMPP headers except the first one do NOT get copied to user space from the kernel β€” ngl, that's just how it is. πŸ‘‘

the message gets copied into the umad buffer if there's enough room, and the received length is indicated. if the buffer is not big enough, then the size of the umad buffer you actually need is returned in length instead. 😭

  • a negative timeout_ms makes the function block until a packet is received (commitment issues? not this function. it'll wait forever for you πŸ’œ)
  • a timeout_ms of zero means a non blocking read πŸ¦‹
note bestie: length is a pointer to the length of the data portion of the umad buffer. that means umad must point to a buffer at least umad_size() + *length bytes long. do the math, slay. ✨
also note: *length must be >= 256 bytes. this length allows for at least a single MAD packet to be returned. periodt. πŸ’…

πŸ’€ RETURN VALUE πŸ’€

umad_recv() on success returns the agentid. on error, errno is set and a negative value is returned as follows:

  • -EINVAL β€” invalid port handle or agentid, or *length is less than the minimum supported πŸ™ˆ
  • -EIO β€” receive operation failed πŸ’€
  • -EWOULDBLOCK β€” non blocking read can't be fulfilled, it's giving "no thoughts, head empty" 😭
  • -ENOSPC β€” the provided buffer is not long enough for the complete message. it's giving too small, bestie πŸ“

πŸ”₯ SEE ALSO πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

Hal Rosenstock <halr@voltaire.com>


and that's the whole page fr fr 🌈 this was the OpenIB era, dated May 11, 2007 β€” iconic, historic, we stan a legacy manpage πŸ’–βœ¨πŸŽ€ bye bestie, go receive some MADs πŸ¦‹

πŸ“¦ where this page comes from