UMAD_SET_GRH(3)
π UMAD_SET_GRH β the "bestie, please fill in my GRH" function π
okay so this is umad_set_grh from the OpenIB Programmer's Manual, section 3 (library calls, iykyk) π¦
β¨ NAME β¨
umad_set_grh β set GRH fields within umad buffer using host ordering π
β¨ SYNOPSIS β¨
#include <infiniband/umad.h>
int umad_set_grh(void *umad, void *mad_addr);
β¨ DESCRIPTION β¨
okay so here's the vibe πΈ β umad_set_grh() sets the GRH fields (grh_present, gid, hop_limit, traffic_class, flow_label) inside the umad buffer you hand it, and it figures all of that out from the mad_addr you supply. literally just "here's my address struct, go do the thing" β¨
and bestie, important: the fields you put in mad_addr are expected to be in host order. not network order. host order. write that down π
if the mad_addr pointer you pass is NULL, then no GRH gets set at all. nothing. zero. the GRH stays un-GRH'd π
so mad_addr is a pointer to an ib_mad_addr_t struct β it's specified in <infiniband/umad.h>, and umad is a pointer to an ib_user_mad_t struct, also specified in <infiniband/umad.h>. here's what they look like, exactly, no cap:
typedef struct ib_mad_addr {
uint32_t qpn;
uint32_t qkey;
uint16_t lid;
uint8_t sl;
uint8_t path_bits;
uint8_t grh_present;
uint8_t gid_index;
uint8_t hop_limit;
uint8_t traffic_class;
uint8_t gid[16];
uint32_t flow_label;
} ib_mad_addr_t;
typedef struct ib_user_mad {
uint32_t agent_id;
uint32_t status;
uint32_t timeout_ms;
uint32_t retries;
uint32_t length;
ib_mad_addr_t addr;
uint8_t data[0];
} ib_user_mad_t;
β¨ RETURN VALUE β¨
umad_set_grh() returns 0 on success π and a negative value on errors.
and likeβ¦ currently? there are no errors indicated. so basically it's always slaying. iconic behaviour honestly π
β¨ SEE ALSO β¨
umad_set_grh_net(3)π
β¨ AUTHOR β¨
Hal Rosenstock <halr@voltaire.com> β thank u for ur service π«‘π
ngl, if you were looking for the network-order twin, that's umad_set_grh_net(3). this one is the host-order one. don't mix them up bestie, that's a vibe check you do NOT want to fail π
and that's the whole page, fr fr π this one came out of the OpenIB crew and it's dated May 24, 2007 β so it's lowkey vintage, highkey still iconic. mwah, go set some GRHs π πΈβ¨
π¦ 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