---
name: "ibv_import_dm"
section: "3"
platform: "linux"
package: "rdma-core"
version: "65.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ibv_import_dm"
---

# ibv\_import\_dm(3)

import an DM from a given ibv\_context ibv\_unimport\_dm - unimport an DM

## NAME

ibv\_import\_dm - import an DM from a given ibv\_context

ibv\_unimport\_dm - unimport an DM

## SYNOPSIS

-

  ```
  #include <infiniband/verbs.h>
  struct ibv_dm *ibv_import_dm(struct ibv_context *context, uint32_t dm_handle);
  void ibv_unimport_dm(struct ibv_dm *dm)
  ```

## DESCRIPTION

**ibv\_import\_dm()** returns a Device memory (DM) that is associated with the given *dm\_handle* in the RDMA context.

The input *dm\_handle* value must be a valid kernel handle for an DM object in the assosicated RDMA context. It can be achieved from the original DM by getting its ibv\_dm-\>handle member value.

**ibv\_unimport\_dm()** un import the DM. Once the DM usage has been ended ibv\_free\_dm() or ibv\_unimport\_dm() should be called. The first one will go to the kernel to destroy the object once the second one way cleanup what ever is needed/opposite of the import without calling the kernel.

This is the responsibility of the application to coordinate between all ibv\_context(s) that use this DM. Once destroy is done no other process can touch the object except for unimport. All users of the context must collaborate to ensure this.

## RETURN VALUE

**ibv\_import\_dm()** returns a pointer to the allocated DM, or NULL if the request fails and errno is set.

## NOTES

## SEE ALSO

[**ibv\_alloc\_dm**(3)](/ibv_alloc_dm/3.md), [**ibv\_free\_dm**(3)](/ibv_free_dm/3.md),

## AUTHOR

Maor Gottlieb ⟨maorg@nvidia.com⟩\\c
