2 .\" This manual page is derived from the DAT/uDAPL 1.2 specification.
3 .\" Portions Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved.
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH DAT_LMR_CREATE 3DAT "Jan 28, 2009"
9 dat_lmr_create \- register a memory region with an IA
13 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-ldat\fR [ \fIlibrary\fR\&.\|.\|. ]
14 #include <\fBdat/udat.h\fR>
18 IN DAT_IA_HANDLE ia_handle,
19 IN DAT_MEM_TYPE mem_type,
20 IN DAT_REGION_DESCRIPTION region_description,
22 IN DAT_PZ_HANDLE pz_handle,
23 IN DAT_MEM_PRIV_FLAGS mem_privileges,
24 OUT DAT_LMR_HANDLE *lmr_handle,
25 OUT DAT_LMR_CONTEXT *lmr_context,
26 OUT DAT_RMR_CONTEXT *rmr_context,
27 OUT DAT_VLEN *registered_size,
28 OUT DAT_VADDR *registered_address
40 Handle for an open instance of the IA.
50 Type of memory to be registered. The following list outlines the memory type
55 \fB\fBDAT_MEM_TYPE_VIRTUAL\fR\fR
59 Consumer virtual memory.
61 Region description: A pointer to a contiguous user virtual range.
63 Length: Length of the Memory Region.
69 \fB\fBDAT_MEM_TYPE_SO_VIRTUAL\fR\fR
73 Consumer virtual memory with strong memory ordering. This type is a Solaris
74 specific addition. If the \fIia_handle\fR was opened without \fBRO_AWARE_\fR
75 (see \fBdat_ia_open\fR(3DAT)), then type \fBDAT_MEM_TYPE_VIRTUAL\fR is
76 implicitly converted to this type.
78 Region description: A pointer to a contiguous user virtual range.
80 Length: Length of the Memory Region.
86 \fB\fBDAT_MEM_TYPE_LMR\fR\fR
92 Region description: An LMR_handle.
94 Length: Length parameter is ignored.
100 \fB\fBDAT_MEM_TYPE_SHARED_VIRTUAL\fR\fR
104 Shared memory region. All DAT Consumers of the same uDAPL Provider specify the
105 same Consumer cookie to indicate who is sharing the shared memory region. This
106 supports a peer-to-peer model of shared memory. All DAT Consumers of the shared
107 memory must allocate the memory region as shared memory using Platform-specific
110 Region description: A structure with 2 elements, where the first one is of type
111 \fBDAT_LMR_COOKIE\fR and is a unique identifier of the shared memory region,
112 and the second one is a pointer to a contiguous user virtual range.
114 Length: Length of the Memory Region
122 \fB\fIregion_description\fR\fR
126 Pointer to type-specific data describing the memory in the region to be
127 registered. The type is derived from the \fImem_type\fR parameter.
137 Length parameter accompanying the region_description.
143 \fB\fIpz_handle\fR\fR
147 Handle for an instance of the Protection Zone.
153 \fB\fImem_privileges:\fR\fR
157 Consumer-requested memory access privileges for the registered local memory
158 region. The Default value is \fBDAT_MEM_PRIV_NONE_FLAG\fR. The constant value
159 \fBDAT_MEM_PRIV_ALL_FLAG\fR = 0x33, which specifies both Read and Write
160 privileges, is also defined. Memory privilege definitions are as follows:
167 \fBDAT_MEM_PRIV_LOCAL_READ_FLAG\fR
174 Local read access requested.
185 \fBDAT_MEM_PRIV_LOCAL_WRITE_FLAG\fR
192 Local write access requested.
203 \fBDAT_MEM_PRIV_REMOTE_READ_FLAG\fR
210 Remote read access requested.
221 \fBDAT_MEM_PRIV_REMOTE_WRITE_FLAG\fR
228 Remote write access requested.
238 \fB\fIlmr_handle\fR\fR
242 Handle for the created instance of the LMR.
248 \fB\fIlmr_context\fR\fR
252 Context for the created instance of the LMR to use for DTO local buffers.
258 \fB\fIregistered_size\fR\fR
262 Actual memory size registered by the Provider.
268 \fB\fIregistered_address\fR\fR
272 Actual base address of the memory registered by the Provider.
278 The \fBdat_lmr_create()\fR function registers a memory region with an IA. The
279 specified buffer must have been previously allocated and pinned by the uDAPL
280 Consumer on the platform. The Provider must do memory pinning if needed, which
281 includes whatever OS-dependent steps are required to ensure that the memory is
282 available on demand for the Interface Adapter. uDAPL does not require that the
283 memory never be swapped out; just that neither the hardware nor the Consumer
284 ever has to deal with it not being there. The created \fIlmr_context\fR can be
285 used for local buffers of DTOs and for binding RMRs, and \fIlmr_handle\fR can
286 be used for creating other LMRs. For uDAPL the scope of the \fIlmr_context\fR
287 is the address space of the DAT Consumer.
290 The return values of \fIregistered_size\fR and \fIregistered_address\fR
291 indicate to the Consumer how much the contiguous region of Consumer virtual
292 memory was registered by the Provider and where the region starts in the
293 Consumer virtual address.
296 The \fImem_type\fR parameter indicates to the Provider the kind of memory to be
297 registered, and can take on any of the values defined in the table in the
301 The \fIpz_handle\fR parameter allows Consumers to restrict local accesses to
302 the registered LMR by DTOs.
305 \fBDAT_LMR_COOKIE\fR is a pointer to a unique identifier of the shared memory
306 region of the \fBDAT_MEM_TYPE_SHARED_VIRTUAL\fR DAT memory type. The identifier
307 is an array of 40 bytes allocated by the Consumer. The Provider must check the
308 entire 40 bytes and shall not interpret it as a null-terminated string.
311 The return value of \fIrmr_context\fR can be transferred by the local Consumer
312 to a Consumer on a remote host to be used for an RDMA DTO.
315 If \fImem_privileges\fR does not specify remote Read and Write privileges,
316 \fIrmr_context\fR is not generated and \fINULL\fR is returned. No remote
317 privileges are given for Memory Region unless explicitly asked for by the
323 \fB\fBDAT_SUCCESS\fR\fR
326 The operation was successful.
332 \fB\fBDAT_UNSUFFICIENT_RESOURCES\fR\fR
335 The operation failed due to resource limitations.
341 \fB\fBDAT_INVALID_PARAMETER\fR\fR
350 \fB\fBDAT_INVALID_HANDLE\fR\fR
359 \fB\fBDAT_INVALID_STATE\fR\fR
362 Parameter in an invalid state. For example, shared virtual buffer was not
363 created shared by the platform.
369 \fB\fBDAT_MODEL_NOT_SUPPORTED\fR\fR
372 The requested Model was not supported by the Provider. For example, requested
373 Memory Type was not supported by the Provider.
379 Consumers can create an LMR over the existing LMR memory with different
380 Protection Zones and privileges using previously created IA translation table
384 The Consumer should use \fIrmr_context\fR with caution. Once advertised to a
385 remote peer, the \fIrmr_context\fR of the LMR cannot be invalidated. The only
386 way to invalidate it is to destroy the LMR with \fBdat_lmr_free\fR(3DAT).
390 See \fBattributes\fR(5) for descriptions of the following attributes:
398 ATTRIBUTE TYPE ATTRIBUTE VALUE
400 Interface Stability Committed
405 uDAPL, 1.1, 1.2 (except \fBDAT_MEM_TYPE_SO_VIRTUAL\fR)
412 \fBdat_lmr_free\fR(3DAT), \fBlibdat\fR(3LIB), \fBattributes\fR(5)