ibv_alloc_dmah - Man Page

Name

ibv_alloc_dmah — allocate a dma handle

int ibv_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

ibv_alloc_dmah() allocates an ibv_dmah object that is associated with the given context and the input attr parameter.

The allocated handle can be later used for optimizing DMA and RDMA operations associated with a registered memory region.

Once the ibv_dmah usage has been ended ibv_dealloc_dmah() should be called.

This call will release resources that were earlier allocated using the ibv_alloc_dmah() API.

Arguments

attr

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

Bitmask specifying what fields in the structure are valid.

cpu_id

The cpu id that the dma handle refers to.

ph

Processing hints, used to aid in optimizing the handling of transactions over PCIe.

tph_mem_type

The target memory type, one among enum ibv_tph_mem_type.

Return Value

ibv_alloc_dmah() returns a pointer to the allocated dma handle object, or NULL if the request fails.

ibv_dealloc_dmah() returns 0 upon success, otherwise the errno value.

See Also

ibv_reg_mr_ex(3)

Author

Yishai Hadas yishaih@nvidia.com\c

Referenced By

The man page ibv_dealloc_dmah(3) is an alias of ibv_alloc_dmah(3).

2025-5-8 Libibverbs Programmer’s Manual