ibv_reg_mr
Registers or releases a memory region (MR).
Syntax
Description
- IBV_ACCESS_LOCAL_WRITE
- Enables local write access
- IBV_ACCESS_REMOTE_WRITE
- Enable remote write access
- IBV_ACCESS_REMOTE_READ
- Enable remote read access
- IBV_ACCESS_REMOTE_ATOMIC
- Enable remote atomic operation access (not supported)
- IBV_ACCESS_MW_BIND
- Enable memory window binding (not supported)
If the IBV_ACCESS_REMOTE_WRITE or IBV_ACCESS_REMOTE_ATOMIC flag is set, the IBV_ACCESS_LOCAL_WRITE flag must also be set.
The ibv_dereg_mr() function release the MR.
Parameters
Item | Descriptor |
---|---|
pd | Specifies the ibv_pd struct for the ibv_alloc_pd() function. |
addr | Specifies the memory base address. |
length | Specifies the length of memory region in bytes. |
access | Specifies the access flags. |
Return Values
The ibv_reg_mr() function returns a pointer to the registered MR on success, and NULL if the request fails. The local key (L_Key) lkey field is used by the ibv_sge struct when posting buffers with ibv_post_* verbs, and the remote key (R_Key) rkey field is used by remote processes to run the remote device memory access (RDMA) operations. The remote process places the rkey field in the ibv_send_wr struct that is sent to the ibv_post_send() function.
The ibv_dereg_mr() function returns 0 on success, and the value of errno on failure, which indicates the reason for failure.