ibv_alloc_dmah(3)
β¨ ibv_alloc_dmah(3) β alloc & dealloc a dma handle β¨
okay so this is from the Libibverbs Programmer's Manual, bestie, and it's literally the whole glow-up guide to ibv_alloc_dmah and its partner-in-crime ibv_dealloc_dmah. two functions, one page, let's go π
πΈ NAME πΈ
ibv_alloc_dmahβ allocate a dma handleibv_dealloc_dmahβ deallocate a dma handle
π¦ SYNOPSIS π¦
#include <infiniband/verbs.h>
struct ibv_dmah *ibv_alloc_dmah(struct ibv_context *context, struct ibv_dmah_init_attr *attr);
int ibv_dealloc_dmah(struct ibv_dmah *dmah);
π DESCRIPTION π
so ibv_alloc_dmah() allocates an ibv_dmah object, and that object is associated with the context you hand it plus the attr parameter you pass in. no cap, that's the whole vibe check π«Ά
the allocated handle can later be used for optimizing DMA and RDMA operations associated with a registered memory region. it's giving performance main character energy β¨
once the ibv_dmah usage has ended, you should call ibv_dealloc_dmah(). periodt β don't just leave it hanging π
that call releases the resources that were earlier allocated using the ibv_alloc_dmah() API. clean up after yourself, icon behavior π
π ARGUMENTS π
attr
okay this is the big one, so let's look at the actual definitions, verbatim, no edits bestie:
enum ibv_tph_mem_type {
IBV_TPH_MEM_TYPE_VM, /* volatile memory */
IBV_TPH_MEM_TYPE_PM, /* persistent memory */
};
enum ibv_dmah_init_attr_mask {
IBV_DMAH_INIT_ATTR_MASK_CPU_ID = 1 << 0,
IBV_DMAH_INIT_ATTR_MASK_PH = 1 << 1,
IBV_DMAH_INIT_ATTR_MASK_TPH_MEM_TYPE = 1 << 2,
};
struct ibv_dmah_init_attr {
uint32_t comp_mask; /* From ibv_dmah_init_attr_mask */
uint32_t cpu_id;
uint8_t ph;
uint8_t tph_mem_type; /* From enum ibv_tph_mem_type */
};
comp_maskβ the bitmask that specifies which fields in the structure are actually valid. like, which ones are showing up to the party πcpu_idβ the cpu id that the dma handle refers tophβ processing hints, used to aid in optimizing the handling of transactions over PCIe π₯tph_mem_typeβ the target memory type, one amongenum ibv_tph_mem_type
β RETURN VALUE β
ibv_alloc_dmah()returns a pointer to the allocated dma handle object, orNULLif the request fails πibv_dealloc_dmah()returns0upon success, otherwise theerrnovalue
π SEE ALSO π
ibv_reg_mr_ex(3) β go read that one too, iykyk π§
π AUTHOR π
Yishai Hadas yishaih@nvidia.com
and that's the page, bestie! signed, sealed, and delivered by libibverbs, dated 2025-5-8 β see you in the next man page ππ
π¦ where this page comes from
- 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
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms