]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/ofed/libibverbs/man/ibv_reg_mr.3
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / ofed / libibverbs / man / ibv_reg_mr.3
1 .\" -*- nroff -*-
2 .\"
3 .TH IBV_REG_MR 3 2006-10-31 libibverbs "Libibverbs Programmer's Manual"
4 .SH "NAME"
5 ibv_reg_mr, ibv_dereg_mr \- register or deregister a memory region (MR)
6 .SH "SYNOPSIS"
7 .nf
8 .B #include <infiniband/verbs.h>
9 .sp
10 .BI "struct ibv_mr *ibv_reg_mr(struct ibv_pd " "*pd" ", void " "*addr" ,
11 .BI "                          size_t " "length" ", int " "access" );
12 .sp
13 .BI "int ibv_dereg_mr(struct ibv_mr " "*mr" );
14 .fi
15 .SH "DESCRIPTION"
16 .B ibv_reg_mr()
17 registers a memory region (MR) associated with the protection domain
18 .I pd\fR.
19 The MR's starting address is
20 .I addr
21 and its size is
22 .I length\fR.
23 The argument
24 .I access
25 describes the desired memory protection attributes; it is either 0 or the bitwise OR of one or more of the following flags:
26 .PP
27 .TP
28 .B IBV_ACCESS_LOCAL_WRITE \fR  Enable Local Write Access
29 .TP
30 .B IBV_ACCESS_REMOTE_WRITE \fR Enable Remote Write Access
31 .TP
32 .B IBV_ACCESS_REMOTE_READ\fR   Enable Remote Read Access
33 .TP
34 .B IBV_ACCESS_REMOTE_ATOMIC\fR Enable Remote Atomic Operation Access (if supported)
35 .TP
36 .B IBV_ACCESS_MW_BIND\fR       Enable Memory Window Binding
37 .PP
38 If
39 .B IBV_ACCESS_REMOTE_WRITE
40 or
41 .B IBV_ACCESS_REMOTE_ATOMIC
42 is set, then
43 .B IBV_ACCESS_LOCAL_WRITE
44 must be set too.
45 .PP
46 Local read access is always enabled for the MR.
47 .PP
48 .B ibv_dereg_mr()
49 deregisters the MR
50 .I mr\fR.
51 .SH "RETURN VALUE"
52 .B ibv_reg_mr()
53 returns a pointer to the registered MR, or NULL if the request fails.
54 The local key (\fBL_Key\fR) field
55 .B lkey
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)
58 field
59 .B rkey
60 is used by remote processes to perform Atomic and RDMA operations.  The remote process places this
61 .B rkey
62 as the rkey field of struct ibv_send_wr passed to the ibv_post_send function.
63 .PP
64 .B ibv_dereg_mr()
65 returns 0 on success, or the value of errno on failure (which indicates the failure reason).
66 .SH "NOTES"
67 .B ibv_dereg_mr()
68 fails if any memory window is still bound to this MR.
69 .SH "SEE ALSO"
70 .BR ibv_alloc_pd (3),
71 .BR ibv_post_send (3),
72 .BR ibv_post_recv (3),
73 .BR ibv_post_srq_recv (3)
74 .SH "AUTHORS"
75 .TP
76 Dotan Barak <dotanb@mellanox.co.il>