UMAD_SEND(3)
π UMAD_SEND(3) β the OpenIB Programmer's Manual, bestie edition β¨
okay so like. this is umad_send, from the OpenIB Programmer's Manual, and it's genuinely one of the most useful little functions in the whole infiniband/umad.h cinematic universe. sit down, hydrate, let's get into it π«Ά
πΈ NAME πΈ
umad_send β send umad π
β¨ SYNOPSIS β¨
#include <infiniband/umad.h>
int umad_send(int portid, int agentid, void *umad, int length, int timeout_ms, int retries);
like. that's it. that's the whole signature. iconic of her tbh π
π¦ DESCRIPTION π¦
So what does umad_send() actually do, you ask? She sends length bytes from the umad buffer you handed her π β out of the port that portid points at, and using the agent that agentid says. that's the whole vibe. port, agent, bytes, go.
Now here's the tea β β that buffer can hold an RMPP transmission, which is bigger than a single MAD packet. when does that happen? when agentid specifies a class that utilizes RMPP and the header flags indicate RMPP is active. both things. not one. both. π
NOTE: right now, only RMPPFlags.Active is actually meaningful in the header in user space. every other RMPP field? ignored. not looked at. not even a little. π
But the glow-up is real: the data section of your buffer gets sent in multiple RMPP MAD packets, and the headers get built for you. you don't build them. she builds them. you're welcome π§
Now, timeout_ms β this one controls the solicited MADs behavior, and it's lowkey doing three different jobs depending on what you feed it:
- zero value β not solicited. that's it, that's the whole meaning.
- positive value β makes the kernel indicate a timeout in milliseconds. if the reply isn't received within the value you specified, the original buffer comes back at you in the read channel with the status field set (to non zero). so like, you will know. π
- negative
timeout_msβ makes the kernel wait forever for the reply. no timeout. no escape. she's patient. π°οΈ
And retries? that's the number of times the MAD will be retried before giving up. simple as. π₯
π RETURN VALUE π
umad_send() returns 0 on success π β and on error, errno gets set and a negative value comes back, like so:
-EINVALβ invalid port handle or agentid π-EIOβ send operation failed π
so like, if you get a negative number back, check errno, and if it's one of those two, you already know what went wrong. no cap.
π AUTHOR π
Hal Rosenstock <halr@voltaire.com> β the actual main character who wrote this. respect. π«Ά
and that's the page, bestie!! from the OpenIB crew, dated May 11, 2007 β yeah she's been serving since 2007 and she's still eating ββ¨ go send some MADs, you got this π¦π
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- arch rolling: rdma-core 65.0-1 Β· GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-MIT AND GPL-2.0-or-later OR LicenseRef-OpenIB.org-BSD-FreeBSD AND GPL-2.0-or-later OR LicenseRef-Intel-BSD-3-Clause AND GPL-2.0-or-later OR LicenseRef-PathScale-BSD-Patent-License AND CC0-1.0 AND MIT AND BSD-2-Clause AND CPL-1.0 OR BSD-2-Clause OR GPL-2.0-or-later
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- debian bookworm: libibumad-dev 44.0-2 Β· BSD-MIT OR GPL-2.0-only
- debian trixie: libibumad-dev 56.1-1 Β· BSD-MIT OR GPL-2.0-only
- fedora 43: rdma-core-devel 58.0-4.fc43 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 43: rdma-core-devel 58.0-4.fc43 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.0-2.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- fedora 44: rdma-core-devel 61.1^20260812git975bdaf-1.fc44 Β· GPL-2.0-only OR BSD-2-Clause AND BSD-3-Clause
- nixos 26.05: rdma-core 62.0
- nixpkgs unstable: rdma-core 65.0
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- opensuse-leap 16.0: rdma-core-devel 56.1-160000.2.2 Β· BSD-2-Clause OR GPL-2.0-only
- ubuntu jammy: libibumad-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibumad-dev 50.0-2build2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibumad-dev 50.0-2ubuntu0.2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu questing: libibumad-dev 56.1-1ubuntu1
- ubuntu resolute: libibumad-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: libibumad-dev 64.0-1ubuntu1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms