| 1 | --- |
| 2 | date: 2016-03-13 |
| 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_REREG_MR |
| 9 | --- |
| 10 | |
| 11 | # NAME |
| 12 | |
| 13 | ibv_rereg_mr - re-register a memory region (MR) |
| 14 | |
| 15 | # SYNOPSIS |
| 16 | |
| 17 | ```c |
| 18 | #include <infiniband/verbs.h> |
| 19 | |
| 20 | int ibv_rereg_mr(struct ibv_mr *mr, |
| 21 | int flags, |
| 22 | struct ibv_pd *pd, |
| 23 | void *addr, |
| 24 | size_t length, |
| 25 | int access); |
| 26 | ``` |
| 27 | |
| 28 | # DESCRIPTION |
| 29 | |
| 30 | **ibv_rereg_mr()** Modifies the attributes of an existing memory region (MR) |
| 31 | *mr*. Conceptually, this call performs the functions deregister memory region |
| 32 | followed by register memory region. Where possible, resources are reused |
| 33 | instead of deallocated and reallocated. |
| 34 | |
| 35 | *flags* is a bit-mask used to indicate which of the following properties of |
| 36 | the memory region are being modified. Flags should be a combination (bit |
| 37 | field) of: |
| 38 | |
| 39 | **IBV_REREG_MR_CHANGE_TRANSLATION ** |
| 40 | : Change translation (location and length) |
| 41 | |
| 42 | **IBV_REREG_MR_CHANGE_PD ** |
| 43 | : Change protection domain |
| 44 | |
| 45 | **IBV_REREG_MR_CHANGE_ACCESS ** |
| 46 | : Change access flags |
| 47 | |
| 48 | When **IBV_REREG_MR_CHANGE_PD** is used, *pd* represents the new PD this MR |
| 49 | should be registered to. |
| 50 | |
| 51 | When **IBV_REREG_MR_CHANGE_TRANSLATION** is used, *addr*. represents the |
| 52 | virtual address (user-space pointer) of the new MR, while *length* represents |
| 53 | its length. |
| 54 | |
| 55 | The access and other flags are represented in the field *access*. This field |
| 56 | describes the desired memory protection attributes; it is either 0 or the |
| 57 | bitwise OR of one or more of ibv_access_flags. |
| 58 | |
| 59 | # RETURN VALUE |
| 60 | |
| 61 | **ibv_rereg_mr()** returns 0 on success, otherwise an error has occurred, |
| 62 | *enum ibv_rereg_mr_err_code* represents the error as of below. |
| 63 | |
| 64 | IBV_REREG_MR_ERR_INPUT - Old MR is valid, an input error was detected by |
| 65 | libibverbs. |
| 66 | |
| 67 | IBV_REREG_MR_ERR_DONT_FORK_NEW - Old MR is valid, failed via don't fork on new |
| 68 | address range. |
| 69 | |
| 70 | IBV_REREG_MR_ERR_DO_FORK_OLD - New MR is valid, failed via do fork on old |
| 71 | address range. |
| 72 | |
| 73 | IBV_REREG_MR_ERR_CMD - MR shouldn't be used, command error. |
| 74 | |
| 75 | IBV_REREG_MR_ERR_CMD_AND_DO_FORK_NEW - MR shouldn't be used, command error, |
| 76 | invalid fork state on new address range. |
| 77 | |
| 78 | |
| 79 | # NOTES |
| 80 | |
| 81 | Even on a failure, the user still needs to call ibv_dereg_mr on this MR. |
| 82 | |
| 83 | # SEE ALSO |
| 84 | |
| 85 | **ibv_dereg_mr**(3), |
| 86 | **ibv_reg_mr**(3) |
| 87 | |
| 88 | # AUTHORS |
| 89 | |
| 90 | Matan Barak <[email protected]>, |
| 91 | Yishai Hadas <[email protected]> |