---
name: "ibv_import_mr"
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_mr"
---

# ibv\_import\_mr(3)

import an MR from a given ibv\_pd ibv\_unimport\_mr - unimport an MR

## NAME

ibv\_import\_mr - import an MR from a given ibv\_pd

ibv\_unimport\_mr - unimport an MR

## SYNOPSIS

-

  ```
  #include <infiniband/verbs.h>
  struct ibv_mr *ibv_import_mr(struct ibv_pd *pd, uint32_t mr_handle);
  void ibv_unimport_mr(struct ibv_mr *mr)
  ```

## DESCRIPTION

**ibv\_import\_mr()** returns a Memory region (MR) that is associated with the given *mr\_handle* in the RDMA context that assosicated with the given *pd*.

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

**ibv\_unimport\_mr()** un import the MR. Once the MR usage has been ended ibv\_dereg\_mr() or ibv\_unimport\_mr() 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 MR. 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\_mr()** returns a pointer to the allocated MR, or NULL if the request fails, and errno is set to indicate the reason.

## NOTES

The *addr* field in the imported MR is not applicable, NULL value is expected.

## SEE ALSO

[**ibv\_reg\_mr**(3)](/ibv_reg_mr/3.md), [**ibv\_reg\_dm\_mr**(3)](/ibv_reg_dm_mr/3.md), **ibv\_reg\_mr\_iova**(3), **ibv\_reg\_mr\_iova2**(3), [**ibv\_dereg\_mr**(3)](/ibv_dereg_mr/3.md),

## AUTHOR

Yishai Hadas ⟨yishaih@mellanox.com⟩\\c
