| 1 | --- |
| 2 | date: 2021-1-17 |
| 3 | footer: libibverbs |
| 4 | header: "Libibverbs Programmer's Manual" |
| 5 | layout: page |
| 6 | license: 'Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md' |
| 7 | section: 3 |
| 8 | title: ibv_import_dm ibv_unimport_dm |
| 9 | --- |
| 10 | |
| 11 | # NAME |
| 12 | |
| 13 | ibv_import_dm - import an DM from a given ibv_context |
| 14 | |
| 15 | ibv_unimport_dm - unimport an DM |
| 16 | |
| 17 | # SYNOPSIS |
| 18 | |
| 19 | ```c |
| 20 | #include <infiniband/verbs.h> |
| 21 | |
| 22 | struct ibv_dm *ibv_import_dm(struct ibv_context *context, uint32_t dm_handle); |
| 23 | void ibv_unimport_dm(struct ibv_dm *dm) |
| 24 | |
| 25 | ``` |
| 26 | |
| 27 | |
| 28 | # DESCRIPTION |
| 29 | |
| 30 | **ibv_import_dm()** returns a Device memory (DM) that is associated with the given |
| 31 | *dm_handle* in the RDMA context. |
| 32 | |
| 33 | The input *dm_handle* value must be a valid kernel handle for an DM object in the assosicated RDMA context. |
| 34 | It can be achieved from the original DM by getting its ibv_dm->handle member value. |
| 35 | |
| 36 | **ibv_unimport_dm()** un import the DM. |
| 37 | Once the DM usage has been ended ibv_free_dm() or ibv_unimport_dm() should be called. |
| 38 | The first one will go to the kernel to destroy the object once the second one way cleanup what |
| 39 | ever is needed/opposite of the import without calling the kernel. |
| 40 | |
| 41 | This is the responsibility of the application to coordinate between all ibv_context(s) that use this DM. |
| 42 | Once destroy is done no other process can touch the object except for unimport. All users of the context must |
| 43 | collaborate to ensure this. |
| 44 | |
| 45 | # RETURN VALUE |
| 46 | |
| 47 | **ibv_import_dm()** returns a pointer to the allocated DM, or NULL if the request fails and errno is set. |
| 48 | |
| 49 | # NOTES |
| 50 | |
| 51 | # SEE ALSO |
| 52 | |
| 53 | **ibv_alloc_dm**(3), |
| 54 | **ibv_free_dm**(3), |
| 55 | |
| 56 | # AUTHOR |
| 57 | |
| 58 | Maor Gottlieb <[email protected]> |
| 59 |