3 .TH IBV_REG_MR 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
5 ibv_reg_mr, ibv_dereg_mr \- register or deregister a memory region (MR)
8 .B #include <infiniband/verbs.h>
10 .BI "struct ibv_mr *ibv_reg_mr(struct ibv_pd " "*pd" ", void " "*addr" ,
11 .BI " size_t " "length" ", int " "access" );
13 .BI "int ibv_dereg_mr(struct ibv_mr " "*mr" );
17 registers a memory region (MR) associated with the protection domain
19 The MR's starting address is
25 describes the desired memory protection attributes; it is either 0 or the bitwise OR of one or more of the following flags:
28 .B IBV_ACCESS_LOCAL_WRITE \fR Enable Local Write Access
30 .B IBV_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access
32 .B IBV_ACCESS_REMOTE_READ\fR Enable Remote Read Access
34 .B IBV_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported)
36 .B IBV_ACCESS_MW_BIND\fR Enable Memory Window Binding
39 .B IBV_ACCESS_REMOTE_WRITE
41 .B IBV_ACCESS_REMOTE_ATOMIC
43 .B IBV_ACCESS_LOCAL_WRITE
46 Local read access is always enabled for the MR.
53 returns a pointer to the registered MR, or NULL if the request fails.
54 The local key (\fBL_Key\fR) field
56 is used as the lkey field of struct ibv_sge when posting buffers with
57 ibv_post_* verbs, and the the remote key (\fBR_Key\fR)
60 is used by remote processes to perform Atomic and RDMA operations. The remote process places this
62 as the rkey field of struct ibv_send_wr passed to the ibv_post_send function.
65 returns 0 on success, or the value of errno on failure (which indicates the failure reason).
68 fails if any memory window is still bound to this MR.
71 .BR ibv_post_send (3),
72 .BR ibv_post_recv (3),
73 .BR ibv_post_srq_recv (3)
76 Dotan Barak <dotanb@mellanox.co.il>