IBV_ALLO...NT_DOMAIN(3)
β¨ IBV_ALLO...NT_DOMAIN β¨
okay bestie, so this is from the Libibverbs Programmer's Manual and it's literally all about ibv_alloc_parent_domain() and ibv_dealloc_pd() β the allocate-and-deallocate-the-parent-domain-object duo. sit down, get comfy, we're doing verbs π
πΈ NAME πΈ
ibv_alloc_parent_domain(), ibv_dealloc_pd() β allocate and deallocate the parent domain object π«Ά
π SYNOPSIS π
#include <infiniband/verbs.h>
struct ibv_pd *ibv_alloc_parent_domain(struct ibv_context *context, struct ibv_parent_domain_init_attr *attr);
π DESCRIPTION π
So ibv_alloc_parent_domain() allocates a parent domain object for the RDMA device context context. slay.
The parent domain object is like a glow-up of your normal protection domain β it extends it with extra objects, like a thread domain. it's giving β¨main characterβ¨ protection domain.
A parent domain is completely interchangeable with the struct ibv_pd used to create it, and can be used as an input argument to any function accepting a struct ibv_pd. no cap.
The behavior of each verb may be different if the verb is passed a parent domain struct ibv_pd that contains a struct ibv_td pointer. for instance the verb may choose to share resources between objects using the same thread domain. the exact behavior is provider dependent. iykyk π¦
The attr argument specifies the following:
enum ibv_parent_domain_init_attr_mask {
IBV_PARENT_DOMAIN_INIT_ATTR_ALLOCATORS = 1 << 0,
IBV_PARENT_DOMAIN_INIT_ATTR_PD_CONTEXT = 1 << 1,
};
struct ibv_parent_domain_init_attr {
struct ibv_pd *pd; /* reference to a protection domain, can't be NULL */
struct ibv_td *td; /* reference to a thread domain, or NULL */
uint32_t comp_mask;
void *(*alloc)(struct ibv_pd *pd, void *pd_context, size_t size,
size_t alignment, uint64_t resource_type);
void (*free)(struct ibv_pd *pd, void *pd_context, void *ptr,
uint64_t resource_type);
void *pd_context;
};
ibv_dealloc_pd() will deallocate the parent domain as its exposed as an ibv_pd pd. All resources created with the parent domain should be destroyed prior to deallocating the parent domain. no skipping steps bestie, clean up after yourself π
π§ ARGUMENTS π§
pdβ Reference to the protection domain that this parent domain uses.tdβ An optional thread domain that the parent domain uses.comp_maskβ Bit-mask of optional fields in theibv_parent_domain_init_attrstruct.allocβ Custom memory allocation function for this parent domain. Provider memory allocations will use this function to allocate the needed memory. The allocation function is passed the parent domainpdand the user-specified contextpd_context. In addition, the callback receives thesizeand thealignmentof the requested buffer, as well a vendor-specificresource_type, which is derived from therdma_driver_idenum (upper 32 bits) and a vendor specific resource code. The function returns the pointer to the allocated buffer, orNULLto designate an error. It may also returnIBV_ALLOCATOR_USE_DEFAULTasking the callee to allocate the buffer using the default allocator.
The callback makes sure the allocated buffer is initialized with zeros. It is also the responsibility of the callback to make sure the memory cannot be COWed, e.g. by using madvise(MADV_DONTFORK) or by allocating anonymous shared memory. that's on you, bestie π
freeβ Callback to free memory buffers that were allocated using a successfulalloc().pd_contextβ A pointer for additional user-specific data to be associated with this parent domain. The pointer is passed back to the custom allocator functions.
β RETURN VALUE β
ibv_alloc_parent_domain() returns a pointer to the allocated struct ibv_pd object, or NULL if the request fails (and sets errno to indicate the failure reason). so likeβ¦ check your returns, fr fr π
π SEE ALSO π
ibv_alloc_parent_domain(3), ibv_dealloc_pd(3), ibv_alloc_pd(3), ibv_alloc_td(3)
π AUTHORS π
- Alex Rosenbaum <alexr@mellanox.com>
- Yishai Hadas <yishaih@mellanox.com>
and that's the whole thing, babe π huge shoutout to libibverbs, dated 2017-11-06, still rocking the IBV_ALLO...NT_DOMAIN(3) name. obsessed. periodt π
π¦ 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 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 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms