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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
|
'\" te
.\" This manual page is derived from the DAT/uDAPL 1.2 specification.
.\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH DAT_LMR_CREATE 3DAT "Jan 28, 2009"
.SH NAME
dat_lmr_create \- register a memory region with an IA
.SH SYNOPSIS
.LP
.nf
cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-ldat\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <\fBdat/udat.h\fR>
DAT_RETURN
dat_lmr_create (
IN DAT_IA_HANDLE ia_handle,
IN DAT_MEM_TYPE mem_type,
IN DAT_REGION_DESCRIPTION region_description,
IN DAT_VLEN length,
IN DAT_PZ_HANDLE pz_handle,
IN DAT_MEM_PRIV_FLAGS mem_privileges,
OUT DAT_LMR_HANDLE *lmr_handle,
OUT DAT_LMR_CONTEXT *lmr_context,
OUT DAT_RMR_CONTEXT *rmr_context,
OUT DAT_VLEN *registered_size,
OUT DAT_VADDR *registered_address
)
.fi
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIia_handle\fR\fR
.ad
.sp .6
.RS 4n
Handle for an open instance of the IA.
.RE
.sp
.ne 2
.na
\fB\fImem_type\fR\fR
.ad
.sp .6
.RS 4n
Type of memory to be registered. The following list outlines the memory type
specifications.
.sp
.ne 2
.na
\fB\fBDAT_MEM_TYPE_VIRTUAL\fR\fR
.ad
.sp .6
.RS 4n
Consumer virtual memory.
.sp
Region description: A pointer to a contiguous user virtual range.
.sp
Length: Length of the Memory Region.
.RE
.sp
.ne 2
.na
\fB\fBDAT_MEM_TYPE_SO_VIRTUAL\fR\fR
.ad
.sp .6
.RS 4n
Consumer virtual memory with strong memory ordering. This type is a Solaris
specific addition. If the \fIia_handle\fR was opened without \fBRO_AWARE_\fR
(see \fBdat_ia_open\fR(3DAT)), then type \fBDAT_MEM_TYPE_VIRTUAL\fR is
implicitly converted to this type.
.sp
Region description: A pointer to a contiguous user virtual range.
.sp
Length: Length of the Memory Region.
.RE
.sp
.ne 2
.na
\fB\fBDAT_MEM_TYPE_LMR\fR\fR
.ad
.sp .6
.RS 4n
LMR.
.sp
Region description: An LMR_handle.
.sp
Length: Length parameter is ignored.
.RE
.sp
.ne 2
.na
\fB\fBDAT_MEM_TYPE_SHARED_VIRTUAL\fR\fR
.ad
.sp .6
.RS 4n
Shared memory region. All DAT Consumers of the same uDAPL Provider specify the
same Consumer cookie to indicate who is sharing the shared memory region. This
supports a peer-to-peer model of shared memory. All DAT Consumers of the shared
memory must allocate the memory region as shared memory using Platform-specific
primitives.
.sp
Region description: A structure with 2 elements, where the first one is of type
\fBDAT_LMR_COOKIE\fR and is a unique identifier of the shared memory region,
and the second one is a pointer to a contiguous user virtual range.
.sp
Length: Length of the Memory Region
.RE
.RE
.sp
.ne 2
.na
\fB\fIregion_description\fR\fR
.ad
.sp .6
.RS 4n
Pointer to type-specific data describing the memory in the region to be
registered. The type is derived from the \fImem_type\fR parameter.
.RE
.sp
.ne 2
.na
\fB\fIlength\fR\fR
.ad
.sp .6
.RS 4n
Length parameter accompanying the region_description.
.RE
.sp
.ne 2
.na
\fB\fIpz_handle\fR\fR
.ad
.sp .6
.RS 4n
Handle for an instance of the Protection Zone.
.RE
.sp
.ne 2
.na
\fB\fImem_privileges:\fR\fR
.ad
.sp .6
.RS 4n
Consumer-requested memory access privileges for the registered local memory
region. The Default value is \fBDAT_MEM_PRIV_NONE_FLAG\fR. The constant value
\fBDAT_MEM_PRIV_ALL_FLAG\fR = 0x33, which specifies both Read and Write
privileges, is also defined. Memory privilege definitions are as follows:
.sp
.ne 2
.na
\fBLocal Read\fR
.ad
.RS 16n
\fBDAT_MEM_PRIV_LOCAL_READ_FLAG\fR
.sp
.ne 2
.na
\fB0x01\fR
.ad
.RS 8n
Local read access requested.
.RE
.RE
.sp
.ne 2
.na
\fBLocal Write\fR
.ad
.RS 16n
\fBDAT_MEM_PRIV_LOCAL_WRITE_FLAG\fR
.sp
.ne 2
.na
\fB0x10\fR
.ad
.RS 8n
Local write access requested.
.RE
.RE
.sp
.ne 2
.na
\fBRemote Read\fR
.ad
.RS 16n
\fBDAT_MEM_PRIV_REMOTE_READ_FLAG\fR
.sp
.ne 2
.na
\fB0x02\fR
.ad
.RS 8n
Remote read access requested.
.RE
.RE
.sp
.ne 2
.na
\fBRemote Write\fR
.ad
.RS 16n
\fBDAT_MEM_PRIV_REMOTE_WRITE_FLAG\fR
.sp
.ne 2
.na
\fB0x20\fR
.ad
.RS 8n
Remote write access requested.
.RE
.RE
.RE
.sp
.ne 2
.na
\fB\fIlmr_handle\fR\fR
.ad
.sp .6
.RS 4n
Handle for the created instance of the LMR.
.RE
.sp
.ne 2
.na
\fB\fIlmr_context\fR\fR
.ad
.sp .6
.RS 4n
Context for the created instance of the LMR to use for DTO local buffers.
.RE
.sp
.ne 2
.na
\fB\fIregistered_size\fR\fR
.ad
.sp .6
.RS 4n
Actual memory size registered by the Provider.
.RE
.sp
.ne 2
.na
\fB\fIregistered_address\fR\fR
.ad
.sp .6
.RS 4n
Actual base address of the memory registered by the Provider.
.RE
.SH DESCRIPTION
.sp
.LP
The \fBdat_lmr_create()\fR function registers a memory region with an IA. The
specified buffer must have been previously allocated and pinned by the uDAPL
Consumer on the platform. The Provider must do memory pinning if needed, which
includes whatever OS-dependent steps are required to ensure that the memory is
available on demand for the Interface Adapter. uDAPL does not require that the
memory never be swapped out; just that neither the hardware nor the Consumer
ever has to deal with it not being there. The created \fIlmr_context\fR can be
used for local buffers of DTOs and for binding RMRs, and \fIlmr_handle\fR can
be used for creating other LMRs. For uDAPL the scope of the \fIlmr_context\fR
is the address space of the DAT Consumer.
.sp
.LP
The return values of \fIregistered_size\fR and \fIregistered_address\fR
indicate to the Consumer how much the contiguous region of Consumer virtual
memory was registered by the Provider and where the region starts in the
Consumer virtual address.
.sp
.LP
The \fImem_type\fR parameter indicates to the Provider the kind of memory to be
registered, and can take on any of the values defined in the table in the
PARAMETERS section.
.sp
.LP
The \fIpz_handle\fR parameter allows Consumers to restrict local accesses to
the registered LMR by DTOs.
.sp
.LP
\fBDAT_LMR_COOKIE\fR is a pointer to a unique identifier of the shared memory
region of the \fBDAT_MEM_TYPE_SHARED_VIRTUAL\fR DAT memory type. The identifier
is an array of 40 bytes allocated by the Consumer. The Provider must check the
entire 40 bytes and shall not interpret it as a null-terminated string.
.sp
.LP
The return value of \fIrmr_context\fR can be transferred by the local Consumer
to a Consumer on a remote host to be used for an RDMA DTO.
.sp
.LP
If \fImem_privileges\fR does not specify remote Read and Write privileges,
\fIrmr_context\fR is not generated and \fINULL\fR is returned. No remote
privileges are given for Memory Region unless explicitly asked for by the
Consumer.
.SH RETURN VALUES
.sp
.ne 2
.na
\fB\fBDAT_SUCCESS\fR\fR
.ad
.RS 30n
The operation was successful.
.RE
.sp
.ne 2
.na
\fB\fBDAT_UNSUFFICIENT_RESOURCES\fR\fR
.ad
.RS 30n
The operation failed due to resource limitations.
.RE
.sp
.ne 2
.na
\fB\fBDAT_INVALID_PARAMETER\fR\fR
.ad
.RS 30n
Invalid parameter.
.RE
.sp
.ne 2
.na
\fB\fBDAT_INVALID_HANDLE\fR\fR
.ad
.RS 30n
Invalid DAT handle.
.RE
.sp
.ne 2
.na
\fB\fBDAT_INVALID_STATE\fR\fR
.ad
.RS 30n
Parameter in an invalid state. For example, shared virtual buffer was not
created shared by the platform.
.RE
.sp
.ne 2
.na
\fB\fBDAT_MODEL_NOT_SUPPORTED\fR\fR
.ad
.RS 30n
The requested Model was not supported by the Provider. For example, requested
Memory Type was not supported by the Provider.
.RE
.SH USAGE
.sp
.LP
Consumers can create an LMR over the existing LMR memory with different
Protection Zones and privileges using previously created IA translation table
entries.
.sp
.LP
The Consumer should use \fIrmr_context\fR with caution. Once advertised to a
remote peer, the \fIrmr_context\fR of the LMR cannot be invalidated. The only
way to invalidate it is to destroy the LMR with \fBdat_lmr_free\fR(3DAT).
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Interface Stability Committed
_
MT-Level Safe
_
Standard T{
uDAPL, 1.1, 1.2 (except \fBDAT_MEM_TYPE_SO_VIRTUAL\fR)
T}
.TE
.SH SEE ALSO
.sp
.LP
.BR dat_lmr_free (3DAT),
.BR libdat (3LIB),
.BR attributes (7)
|