ibv_alloc_dmah(3) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | ARGUMENTS | RETURN VALUE | SEE ALSO | AUTHOR | COLOPHON

ibv_alloc_dmah(3)     Libibverbs Programmer’s Manual    ibv_alloc_dmah(3)

NAME         top

       ibv_alloc_dmah - allocate a dma handle

       int ibv_dealloc_dmah - deallocate a dma handle

SYNOPSIS         top

              #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         top

       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         top

   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         top

       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         top

       ibv_reg_mr_ex(3)

AUTHOR         top

       Yishai Hadas ⟨yishaih@nvidia.com⟩

COLOPHON         top

       This page is part of the rdma-core (RDMA Core Userspace Libraries
       and Daemons) project.  Information about the project can be found
       at ⟨https://github.com/linux-rdma/rdma-core⟩.  If you have a bug
       report for this manual page, send it to
       linux-rdma@vger.kernel.org.  This page was obtained from the
       project's upstream Git repository
       ⟨https://github.com/linux-rdma/rdma-core.git⟩ on 2025-08-11.  (At
       that time, the date of the most recent commit that was found in
       the repository was 2025-08-04.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there is
       a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to
       man-pages@man7.org

libibverbs                       2025-5-8               ibv_alloc_dmah(3)