.\" Automatically generated by Pandoc 1.19.2.4
.\"
.TH "IBV_REREG_MR" "3" "2016\-03\-13" "libibverbs" "Libibverbs Programmer\[aq]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[]
.fi
.SH DESCRIPTION
.PP
\f[B]ibv_rereg_mr()\f[] Modifies the attributes of an existing memory
region (MR) \f[I]mr\f[].
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[] 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
.B \f[B]IBV_REREG_MR_CHANGE_TRANSLATION \f[]
Change translation (location and length)
.RS
.RE
.TP
.B \f[B]IBV_REREG_MR_CHANGE_PD \f[]
Change protection domain
.RS
.RE
.TP
.B \f[B]IBV_REREG_MR_CHANGE_ACCESS \f[]
Change access flags
.RS
.RE
.PP
When \f[B]IBV_REREG_MR_CHANGE_PD\f[] is used, \f[I]pd\f[] represents the
new PD this MR should be registered to.
.PP
When \f[B]IBV_REREG_MR_CHANGE_TRANSLATION\f[] is used, \f[I]addr\f[].
represents the virtual address (user\-space pointer) of the new MR,
while \f[I]length\f[] represents its length.
.PP
The access and other flags are represented in the field \f[I]access\f[].
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[] returns 0 on success, otherwise an error has
occurred, \f[I]enum ibv_rereg_mr_err_code\f[] 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\[aq]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\[aq]t be used, command error.
.PP
IBV_REREG_MR_ERR_CMD_AND_DO_FORK_NEW \- MR shouldn\[aq]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[](3), \f[B]ibv_reg_mr\f[](3)
.SH AUTHORS
.PP
Matan Barak <matanb@mellanox.com>, Yishai Hadas <yishaih@mellanox.com>
