.\" Automatically generated by Pandoc 2.9.2.1
.\"
.TH "IBV_REREG_MR" "3" "2016-03-13" "libibverbs" "Libibverbs Programmer\[cq]s Manual"
.hy
.SH NAME
.PP
ibv_rereg_mr - re-register a memory region (MR)
.SH SYNOPSIS
.IP
.nf
\f[C]
#include <infiniband/verbs.h>

int ibv_rereg_mr(struct ibv_mr *mr,
                 int flags,
                 struct ibv_pd *pd,
                 void *addr,
                 size_t length,
                 int access);
\f[R]
.fi
.SH DESCRIPTION
.PP
\f[B]ibv_rereg_mr()\f[R] Modifies the attributes of an existing memory
region (MR) \f[I]mr\f[R].
Conceptually, this call performs the functions deregister memory region
followed by register memory region.
Where possible, resources are reused instead of deallocated and
reallocated.
.PP
\f[I]flags\f[R] is a bit-mask used to indicate which of the following
properties of the memory region are being modified.
Flags should be a combination (bit field) of:
.TP
\f[B]IBV_REREG_MR_CHANGE_TRANSLATION \f[R]
Change translation (location and length)
.TP
\f[B]IBV_REREG_MR_CHANGE_PD \f[R]
Change protection domain
.TP
\f[B]IBV_REREG_MR_CHANGE_ACCESS \f[R]
Change access flags
.PP
When \f[B]IBV_REREG_MR_CHANGE_PD\f[R] is used, \f[I]pd\f[R] represents
the new PD this MR should be registered to.
.PP
When \f[B]IBV_REREG_MR_CHANGE_TRANSLATION\f[R] is used, \f[I]addr\f[R].
represents the virtual address (user-space pointer) of the new MR, while
\f[I]length\f[R] represents its length.
.PP
The access and other flags are represented in the field
\f[I]access\f[R].
This field describes the desired memory protection attributes; it is
either 0 or the bitwise OR of one or more of ibv_access_flags.
.SH RETURN VALUE
.PP
\f[B]ibv_rereg_mr()\f[R] returns 0 on success, otherwise an error has
occurred, \f[I]enum ibv_rereg_mr_err_code\f[R] represents the error as
of below.
.PP
IBV_REREG_MR_ERR_INPUT - Old MR is valid, an input error was detected by
libibverbs.
.PP
IBV_REREG_MR_ERR_DONT_FORK_NEW - Old MR is valid, failed via don\[cq]t
fork on new address range.
.PP
IBV_REREG_MR_ERR_DO_FORK_OLD - New MR is valid, failed via do fork on
old address range.
.PP
IBV_REREG_MR_ERR_CMD - MR shouldn\[cq]t be used, command error.
.PP
IBV_REREG_MR_ERR_CMD_AND_DO_FORK_NEW - MR shouldn\[cq]t be used, command
error, invalid fork state on new address range.
.SH NOTES
.PP
Even on a failure, the user still needs to call ibv_dereg_mr on this MR.
.SH SEE ALSO
.PP
\f[B]ibv_dereg_mr\f[R](3), \f[B]ibv_reg_mr\f[R](3)
.SH AUTHORS
.PP
Matan Barak <matanb@mellanox.com>, Yishai Hadas <yishaih@mellanox.com>
