IBV_CREATE_AH(3)
π ibv_create_ah(3) β the libibverbs programmer's manual, bestie edition π
okay so this is a page from the Libibverbs Programmer's Manual, and today we're talking about ibv_create_ah(3) β that's ibv_create_ah and ibv_destroy_ah, the two functions that make and unmake an address handle, aka an AH. yes bestie, you're gonna be creating and destroying address handles and it's gonna be iconic. π¦
β¨ NAME β¨
ibv_create_ah, ibv_destroy_ah β create or destroy an address handle (AH). periodt. π
πΈ SYNOPSIS πΈ
#include <infiniband/verbs.h>
struct ibv_ah *ibv_create_ah(struct ibv_pd *pd,
struct ibv_ah_attr *attr);
int ibv_destroy_ah(struct ibv_ah *ah);
like, that's the whole vibe. two functions. one makes, one breaks. π
π DESCRIPTION π
okay so ibv_create_ah() creates an address handle (AH) that's associated with the protection domain pd. and the attr argument? it's an ibv_ah_attr struct, which is defined in <infiniband/verbs.h>. not me knowing the header by heart π
here's what ibv_ah_attr looks like, literally verbatim:
struct ibv_ah_attr {
struct ibv_global_route grh; /* Global Routing Header (GRH) attributes */
uint16_t dlid; /* Destination LID */
uint8_t sl; /* Service Level */
uint8_t src_path_bits; /* Source path bits */
uint8_t static_rate; /* Maximum static rate */
uint8_t is_global; /* GRH attributes are valid */
uint8_t port_num; /* Physical port number */
};
and the grh field is itself a struct ibv_global_route, which goes like this:
struct ibv_global_route {
union ibv_gid dgid; /* Destination GID or MGID */
uint32_t flow_label; /* Flow label */
uint8_t sgid_index; /* Source GID index */
uint8_t hop_limit; /* Hop limit */
uint8_t traffic_class; /* Traffic class */
};
and then ibv_destroy_ah() destroys the AH ah. that's it. that's the whole function. she's simple, she's efficient, she ate. π₯
β RETURN VALUE β
ibv_create_ah() returns a pointer to the created AH. π«Ά and if the request fails? she returns NULL. no AH for you bestie. π
π NOTES π
okay this part matters, don't skip it:
If port flag IBV_QPF_GRH_REQUIRED is set then ibv_create_ah() must be created with definition of 'struct ibv_ah_attr { .is_global = 1; .grh = {...}; }'.
like literally, copy that exactly, don't freestyle it..is_global = 1and.grh = {...}or it's not happening. π¨
ibv_destroy_ah() returns 0 on success, or the value of errno on failure β and that errno value tells you the failure reason. so when it's not 0, go read your errno, she's trying to tell you something. π§
π SEE ALSO π
(the holy trinity of AH-adjacent lore, iykyk β¨)
π AUTHORS π
Dotan Barak <dotanba@gmail.com> β thank you for your service king π«‘
and that's the whole page bestie!! this came out of libibverbs and it's dated 2006-10-31 β yeah she's been iconic since 2006, main character energy fr fr. go forth and create (and destroy) your address handles responsibly π ππΈ
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- 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: libibverbs-dev 44.0-2 Β· BSD-MIT OR GPL-2.0-only
- debian trixie: libibverbs-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
- 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: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibverbs-dev 50.0-2build2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu noble: libibverbs-dev 50.0-2ubuntu0.2 Β· BSD-MIT OR GPL-2.0-only
- ubuntu questing: libibverbs-dev 56.1-1ubuntu1
- ubuntu resolute: libibverbs-dev 61.0-2ubuntu3 Β· BSD-MIT OR GPL-2.0-only
- ubuntu stonking: libibverbs-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