IBV_ALLOC_TD(3)
π ibv_alloc_td β the Libibverbs Programmer's Manual, but make it cute π¦
okay bestie, welcome to the ibv_alloc_td(3) page from the libibverbs programmer's manual. we're talking thread domains today and honestly? they're lowkey iconic. let's get into it β¨
πΈ NAME πΈ
ibv_alloc_td(), ibv_dealloc_td() β allocate and deallocate a thread domain object π§
β SYNOPSIS β
#include <infiniband/verbs.h>
struct ibv_td *ibv_alloc_td(struct ibv_context *context,
struct ibv_td_init_attr *init_attr);
int ibv_dealloc_td(struct ibv_td *td);
like, copy that include exactly, no cap π«Ά
π DESCRIPTION π
so ibv_alloc_td() allocates a thread domain object for the RDMA device context context. that's the whole vibe.
and what even is a thread domain, you ask? bestie. the thread domain object defines how the verbs libraries and the provider will use locks and additional hardware capabilities to achieve best performance for handling multi-thread or single-thread protection. it's giving β¨performance optimizationβ¨. an application assigns verbs resources to a thread domain when it creates a verbs object. periodt.
here's the tea though π β if the ibv_td object is specified, then any objects created under this thread domain will disable internal locking designed to protect against concurrent access to that object from multiple user threads. so yeah, you're turning off the safety rails, no biggie, just be aware fr fr.
but wait, don't panic: by default all verbs objects are safe for multi-threaded access, whether or not a thread domain is specified. so if you do nothing, you're fine π .
also a struct ibv_td can be added to a parent domain via ibv_alloc_parent_domain(), and then the parent domain can be used to create verbs objects. nesting!! we love to see it π
now ibv_dealloc_td() will deallocate the thread domain td.
β οΈ okay important bestie: all resources created with thetdshould be destroyed prior to deallocating thetd. clean up your room before you move out, okay? π§Ήβ¨
π₯ RETURN VALUE π₯
ibv_alloc_td()returns a pointer to the allocatedstruct ibv_tdobject, orNULLif the request fails (and setserrnoto indicate the failure reason). so if you getNULL, checkerrno, she's telling you what went wrong πibv_dealloc_td()returns0on success, or the value oferrnoon failure (which indicates the failure reason). zero is the slay, anything else is a vibe check fail π
π SEE ALSO π
π AUTHORS π
- Alex Rosenbaum
<alexr@mellanox.com> - Yishai Hadas
<yishaih@mellanox.com>
and that's the whole page, bestie! this masterpiece came out of libibverbs, dated 2017-11-06, and it's been serving ever since π thanks for reading, now go destroy your resources before you dealloc your td, mwah π«Άβ¨π
π¦ 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: 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
- 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: 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