IBV_REREG_MR(3)
πΈ NAME πΈ
ibv_rereg_mr β re-register a memory region (MR). This is from the Libibverbs Programmerβs Manual, bestie, and yes, ibv_rereg_mr(3) is literally the glow-up page for MRs π
β¨ SYNOPSIS β¨
#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);
π DESCRIPTION π
okay so ibv_rereg_mr() modifies the attributes of an existing memory region (MR), mr. Conceptually, this call performs the functions deregister memory region followed by register memory region β itβs giving makeover arc β¨ Where possible, resources are reused instead of deallocated and reallocated, which is highkey iconic.
flags 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:
IBV_REREG_MR_CHANGE_TRANSLATIONβ Change translation (location and length)IBV_REREG_MR_CHANGE_PDβ Change protection domainIBV_REREG_MR_CHANGE_ACCESSβ Change access flags
When IBV_REREG_MR_CHANGE_PD is used, pd represents the new PD this MR should be registered to.
When IBV_REREG_MR_CHANGE_TRANSLATION is used, addr represents the virtual address (user-space pointer) of the new MR, while length represents its length.
The access and other flags are represented in the field access. This field describes the desired memory protection attributes; it is either 0 or the bitwise OR of one or more of ibv_access_flags.
π«Ά RETURN VALUE π«Ά
ibv_rereg_mr() returns 0 on success, otherwise an error has occurred, and enum ibv_rereg_mr_err_code represents the error as of below. vibe check time π
IBV_REREG_MR_ERR_INPUTβ Old MR is valid, an input error was detected by libibverbs.IBV_REREG_MR_ERR_DONT_FORK_NEWβ Old MR is valid, failed via donβt fork on new address range.IBV_REREG_MR_ERR_DO_FORK_OLDβ New MR is valid, failed via do fork on old address range.IBV_REREG_MR_ERR_CMDβ MR shouldnβt be used, command error.IBV_REREG_MR_ERR_CMD_AND_DO_FORK_NEWβ MR shouldnβt be used, command error, invalid fork state on new address range.
π NOTES π
Even on a failure, the user still needs to call ibv_dereg_mr on this MR. not me forgetting the cleanup bestie π
π SEE ALSO π
ibv_dereg_mr(3), ibv_reg_mr(3) β go read these too, iykyk π¦
π AUTHORS π
Matan Barak <matanb@mellanox.com>, Yishai Hadas <yishaih@mellanox.com>
xoxo, source/version + date: libibverbs, 2016-03-13 β mwah πβ¨
π¦ where this page comes from
- alpine 3.24: rdma-core-doc 61.0-r0 Β· GPL-2.0-only OR BSD-2-Clause
- centos-stream 10: rdma-core-devel 62.0-3.el10 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- centos-stream 9: rdma-core-devel 61.0-3.el9 Β· GPLv2 or BSD
- ubuntu jammy: libibverbs-dev 39.0-1 Β· BSD-MIT OR GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms