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