2 * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
\r
3 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
\r
5 * This software is available to you under the OpenIB.org BSD license
\r
8 * Redistribution and use in source and binary forms, with or
\r
9 * without modification, are permitted provided that the following
\r
10 * conditions are met:
\r
12 * - Redistributions of source code must retain the above
\r
13 * copyright notice, this list of conditions and the following
\r
16 * - Redistributions in binary form must reproduce the above
\r
17 * copyright notice, this list of conditions and the following
\r
18 * disclaimer in the documentation and/or other materials
\r
19 * provided with the distribution.
\r
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
25 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
26 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
34 #if !defined(__IB_AL_H__)
\r
37 #include <iba/ib_types.h>
\r
38 #include <complib/cl_waitobj.h>
\r
44 #endif /* __cplusplus */
\r
46 /****h* IB Access Layer API/Overview
\r
48 * InfiniBand Access Layer
\r
50 * Copyright (c) 2003 Intel Corporation - All Rights Reserved.
\r
52 * The access layer provides transport level access to an InfiniBand fabric.
\r
53 * It supplies a foundation upon which a channel driver may be built. The
\r
54 * access layer exposes the capabilities of the InfiniBand architecture and
\r
55 * adds support for higher-level functionality required by most users of an
\r
56 * InfiniBand fabric. Users define the protocols and policies used by the
\r
57 * access layer, and the access layer implements them under the direction
\r
62 typedef struct _ib_al* __ptr64 ib_al_handle_t;
\r
63 typedef struct _al_pnp* __ptr64 ib_pnp_handle_t;
\r
64 typedef struct _al_reg_svc* __ptr64 ib_reg_svc_handle_t;
\r
65 typedef struct _al_mad_send* __ptr64 ib_mad_send_handle_t;
\r
66 typedef struct _al_mad_svc* __ptr64 ib_mad_svc_handle_t;
\r
67 typedef struct _al_query* __ptr64 ib_query_handle_t;
\r
68 typedef struct _al_sub* __ptr64 ib_sub_handle_t;
\r
69 typedef struct _al_listen* __ptr64 ib_listen_handle_t;
\r
70 typedef struct _al_ioc* __ptr64 ib_ioc_handle_t;
\r
71 typedef struct _al_svc_entry* __ptr64 ib_svc_handle_t;
\r
72 typedef struct _al_pool_key* __ptr64 ib_pool_key_t;
\r
73 typedef struct _al_pool* __ptr64 ib_pool_handle_t;
\r
76 typedef struct _ib_cm_handle
\r
78 ib_al_handle_t h_al;
\r
79 ib_qp_handle_t h_qp;
\r
85 /****s* Access Layer/ib_shmid_t
\r
90 * Shared Memory Identifier, used to uniquely identify a shared memory region.
\r
94 typedef uint8_t ib_shmid_t[64];
\r
101 /****d* Access Layer/ATS
\r
103 * DAPL Address Translation Service
\r
106 * ATS service ID, service name, and IPv4 offset for DAPL-compliant
\r
107 * ATS service records.
\r
109 #define ATS_SERVICE_ID CL_NTOH64( 0x10000CE100415453 )
\r
110 #define ATS_NAME "DAPL Address Translation Service"
\r
111 #define ATS_IPV4_OFFSET 12
\r
115 /****s* Access Layer/ib_mad_element_t
\r
120 * Information used to submit a work request to a management datagram (MAD)
\r
125 typedef struct _ib_mad_element
\r
127 struct _ib_mad_element* __ptr64 p_next;
\r
128 const void* __ptr64 context1;
\r
129 const void* __ptr64 context2;
\r
131 /* Request/completion data. */
\r
132 ib_mad_t* __ptr64 p_mad_buf;
\r
134 uint32_t immediate_data;
\r
135 ib_net32_t remote_qp;
\r
137 /* Send request information. */
\r
138 ib_av_handle_t h_av;
\r
139 ib_send_opt_t send_opt;
\r
140 ib_net32_t remote_qkey;
\r
141 boolean_t resp_expected;
\r
142 uint32_t timeout_ms;
\r
143 uint32_t retry_cnt;
\r
144 uint8_t rmpp_version;
\r
146 /* Completion information. */
\r
147 ib_wc_status_t status;
\r
148 boolean_t grh_valid;
\r
149 ib_grh_t* __ptr64 p_grh;
\r
151 /* Completed receive data or send request information if h_av is NULL. */
\r
153 ib_net16_t remote_lid;
\r
155 uint16_t pkey_index;
\r
158 /* Transaction completion data. */
\r
159 void* __ptr64 send_context1;
\r
160 void* __ptr64 send_context2;
\r
162 } ib_mad_element_t;
\r
166 * A pointer used to chain MAD elements together. This value is
\r
167 * set to NULL to mark the end of the chain.
\r
170 * User-defined context information associated with the datagram.
\r
173 * User-defined context information associated with the datagram.
\r
176 * The local data buffer contain the MAD.
\r
179 * The size of the MAD referenced by p_buffer.
\r
182 * 32-bit field sent or received as part of a datagram message.
\r
183 * This field is valid for send operations if the send_opt
\r
184 * IB_SEND_OPT_IMMEDIATE flag has been set. This field is valid
\r
185 * on received datagram completions if the recv_opt
\r
186 * IB_RECV_OPT_IMMEDIATE flag is set.
\r
189 * Identifies the destination queue pair of a datagram send operation or
\r
190 * the source queue pair of a received datagram.
\r
193 * An address vector that specifies the path information used to route
\r
194 * the outbound datagram to the destination queue pair. This handle may
\r
195 * be NULL when sending a directed route SMP or if the access layer
\r
196 * should create the address vector for the user.
\r
199 * Optional send control parameters. The following options are valid:
\r
200 * IB_SEND_OPT_IMMEDIATE and IB_SEND_OPT_SOLICITED. IB_SEND_OPT_FENCE
\r
201 * is only valid on MAD QPs.
\r
204 * The qkey for the destination queue pair.
\r
207 * This field is used to indicate that the submitted operation expects
\r
208 * a response. When set, the access layer will retry this send operation
\r
209 * until the corresponding response is successfully received, or the
\r
210 * request times out. Send operations for which a response is expected
\r
211 * will always be completed by the access layer before the corresponding
\r
212 * received response.
\r
215 * Specifies the number of milliseconds to wait for a response to
\r
216 * a request until retrying or timing out the request. This field is
\r
217 * ignored if resp_expected is set to FALSE.
\r
220 * Specifies the number of times that the request will be retried
\r
221 * before failing the request. This field is ignored if resp_expected
\r
225 * Indicates the version of the RMPP protocol to use when sending this
\r
226 * MAD. For MADs posted to MAD services of type IB_MAD_SVC_DEFAULT,
\r
227 * setting this field to 0 disables RMPP on user-defined management
\r
228 * classes or invokes the default RMPP version for well-defined management
\r
229 * classes, if appropriate. For MADs posted to MAD services of type
\r
230 * IB_MAD_SVC_RMPP, setting this field to 0 disables RMPP on the sent
\r
231 * MAD. Note that if the RMPP header exists, but the RMPP protocol is
\r
232 * not activated for this MAD, the user must ensure that the RMPP header
\r
233 * has been zeroed. This field is intended to help support backwards
\r
237 * The result of the MAD work request.
\r
240 * A flag indicating whether the p_grh reference is valid.
\r
243 * A reference to the global route header information.
\r
246 * Indicates optional fields valid as part of a work request that
\r
247 * completed on an unreliable datagram queue pair.
\r
250 * The source LID of the received datagram.
\r
253 * The service level used by the source of the received datagram.
\r
256 * This is valid only for IB_QPT_QP1 and IB_QPT_QP1_ALIAS QP types.
\r
257 * For received datagrams, this field contains the pkey index for
\r
258 * the source queue pair. For send operations, this field contains
\r
259 * the pkey index to use when posting the send work request.
\r
262 * The portion of the remote_lid that may be changed to vary the path
\r
263 * through the subnet to the remote port.
\r
266 * If this datagram was received as a response to a sent datagram, this
\r
267 * field contains the context1 value of the send operation. If this is
\r
268 * an unsolicited receive, this field will be 0.
\r
271 * If this datagram was received as a response to a sent datagram, this
\r
272 * field contains the context2 value of the send operation. If this is
\r
273 * an unsolicited receive, this field will be 0.
\r
276 * Identifies the source queue pair of a received datagram.
\r
279 * The format of data sent over the fabric is expected to be in the form
\r
280 * of a MAD. MADs are expected to match the format defined by the
\r
281 * Infiniband specification and must be in network-byte order when posted
\r
282 * to a MAD service.
\r
284 * This structure is received to notify a user that a datagram has been
\r
285 * received for a registered management class. Information of the source
\r
286 * of the data is provided, along with the data buffer.
\r
288 * The MAD element structure is defined such that a received MAD element
\r
289 * may be re-used as a sent response. In such cases, the h_av field may be
\r
290 * NULL. The address vector will be created and destroyed by the access
\r
294 * ib_get_mad, ib_put_mad, ib_send_mad, ib_local_ds_t, ib_send_opt_t,
\r
295 * ib_pfn_mad_recv_cb_t, ib_get_mad_buf
\r
299 /****f* Access Layer/ib_get_mad_buf
\r
304 * Returns a pointer to the MAD buffer associated with a MAD element.
\r
308 #pragma warning(push)
\r
309 #pragma warning(disable: 4244 )
\r
310 AL_INLINE void* AL_API
\r
312 IN const ib_mad_element_t* const p_mad_element )
\r
314 CL_ASSERT( p_mad_element );
\r
315 return( p_mad_element->p_mad_buf );
\r
317 #pragma warning (pop)
\r
321 * [in] A pointer to a MAD element.
\r
324 * Returns a pointer to the MAD buffer associated with a MAD element.
\r
331 /****f* Access Layer/ib_pfn_comp_cb_t
\r
336 * Completion callback provided by a client.
\r
341 (AL_API * __ptr64 ib_pfn_comp_cb_t)(
\r
342 IN const ib_cq_handle_t h_cq,
\r
343 IN void *cq_context );
\r
347 * [in] Handle for the completion queue on which the completion occurred.
\r
350 * [in] User-specified context for the completion queue on which the
\r
351 * completion occurred.
\r
354 * This function is invoked upon completion of a work request on a queue pair
\r
355 * associated with the completion queue. The context associated with the
\r
356 * completion queue on which the completion occurred is return to the client
\r
357 * through the callback.
\r
359 * In the kernel, this callback is usually invoked using a tasklet, dependent
\r
360 * on the implementation of the underlying verbs provider driver.
\r
364 /****d* Access Layer/ib_al_flags_t
\r
369 * Access layer flags used to direct the operation of various calls.
\r
373 typedef uint32_t ib_al_flags_t;
\r
374 #define IB_FLAGS_SYNC 0x00000001
\r
378 * Indicates that the given operation should be performed synchronously.
\r
379 * The call will block until it completes. Callbacks will still be
\r
383 * ib_cm_req_t, ib_cm_rep_t, ib_cm_dreq_t, ib_cm_lap_t,
\r
384 * ib_reg_svc_req_t, ib_mcast_req_t, ib_query_req_t, ib_sub_req_t
\r
388 /****f* Access Layer/ib_pfn_destroy_cb_t
\r
390 * ib_pfn_destroy_cb_t
\r
393 * Asynchronous callback invoked after a resource has been successfully
\r
399 (AL_API * __ptr64 ib_pfn_destroy_cb_t)(
\r
400 IN void *context );
\r
404 * [in] User-specified context associated with the resource being
\r
405 * destroyed. The context for the resource is usually set during the
\r
406 * object's creation.
\r
409 * This callback notifies a client that a resource has been successfully
\r
410 * destroyed. It is used to indicate that all pending callbacks associated
\r
411 * with the resource have completed, and no additional events will be
\r
412 * generated for that resource.
\r
414 * This callback is invoked within a system thread context in the kernel.
\r
416 * If the user specifies ib_sync_destroy as the asynchronous callback, then
\r
417 * the object being destroyed will be destroyed synchronously. This may
\r
418 * result in the calling thread blocking while outstanding callbacks complete.
\r
426 /****f* Access Layer/ib_sync_destroy
\r
431 * Access layer routine used to indicate synchronous destruction of an
\r
436 static const ib_pfn_destroy_cb_t ib_sync_destroy = (ib_pfn_destroy_cb_t)-1i64;
\r
442 * Users specify ib_sync_destroy as the ib_pfn_destroy_cb_t callback in order
\r
443 * to force synchronous object destruction. This may result in the calling
\r
444 * thread blocking while outstanding callbacks complete.
\r
447 * ib_pfn_destroy_cb_t
\r
451 /****s* Access Layer/ib_async_event_rec_t
\r
453 * ib_async_event_rec_t
\r
456 * Information returned when an asynchronous event occurs on an allocated
\r
461 typedef struct _ib_async_event_rec
\r
463 ib_async_event_t code;
\r
464 uint64_t vendor_specific;
\r
466 void* __ptr64 context;
\r
469 ib_ca_handle_t h_ca;
\r
470 ib_cq_handle_t h_cq;
\r
471 ib_qp_handle_t h_qp;
\r
475 } ib_async_event_rec_t;
\r
479 * A code that identifies the type of event being reported.
\r
482 * A field containing optional vendor specific information.
\r
485 * User-defined context information associated with the resource on
\r
486 * which the error occurred.
\r
489 * A handle to the resource for which this event record was generated.
\r
490 * This handle will match the handle returned during the creation of
\r
491 * resource. It is provided in case an event occurs before a client's
\r
492 * call to create a resource can return.
\r
495 * ib_async_event_t, ib_pfn_event_cb_t
\r
499 /****f* Access Layer/ib_pfn_event_cb_t
\r
501 * ib_pfn_event_cb_t
\r
504 * A user-specified callback that is invoked after an asynchronous event
\r
505 * has occurred on an allocated resource.
\r
510 (AL_API * __ptr64 ib_pfn_event_cb_t)(
\r
511 IN ib_async_event_rec_t *p_event_rec );
\r
515 * [in] Information returned to the user, indicating the type of
\r
516 * event and the associated user context.
\r
519 * This callback is invoked within a system thread context in the kernel.
\r
522 * ib_async_event_rec_t
\r
526 /****f* Access Layer/ib_open_ca
\r
531 * Opens a channel adapter for additional access. A channel adapter must
\r
532 * be opened before consuming resources on that adapter.
\r
536 AL_EXPORT ib_api_status_t AL_API
\r
538 IN const ib_al_handle_t h_al,
\r
539 IN const ib_net64_t ca_guid,
\r
540 IN const ib_pfn_event_cb_t pfn_ca_event_cb OPTIONAL,
\r
541 IN const void* const ca_context,
\r
542 OUT ib_ca_handle_t* const ph_ca );
\r
546 * [in] The handle to an open instance of AL.
\r
549 * [in] The GUID of the channel adapter to open.
\r
552 * [in] A user-specified callback that is invoked after an
\r
553 * asynchronous event has occurred on the channel adapter.
\r
556 * [in] A client-specified context to associate with this opened instance
\r
557 * of the channel adapter. This context is returned to the user when
\r
558 * invoking asynchronous callbacks referencing this channel adapter.
\r
561 * [out] Upon successful completion of this call, this references a
\r
562 * handle to the opened channel adapter.
\r
566 * The operation was successful.
\r
568 * IB_INVALID_AL_HANDLE
\r
569 * The access layer handle was invalid.
\r
572 * No channel adapter in the system was found for the specified ca_guid.
\r
574 * IB_INVALID_PARAMETER
\r
575 * A reference to the CA handle was not provided.
\r
577 * IB_INSUFFICIENT_MEMORY
\r
578 * There was insufficient memory to open the channel adapter.
\r
581 * When successful, this routine returns a handle to an open instance of a CA.
\r
584 * ib_query_ca, ib_modify_ca, ib_close_ca, ib_pfn_event_cb_t
\r
588 /****f* Access Layer/ib_query_ca
\r
593 * Queries the attributes of an opened channel adapter.
\r
597 AL_EXPORT ib_api_status_t AL_API
\r
599 IN const ib_ca_handle_t h_ca,
\r
600 OUT ib_ca_attr_t* const p_ca_attr OPTIONAL,
\r
601 IN OUT uint32_t* const p_size );
\r
605 * [in] The handle to an open channel adapter.
\r
608 * [out] A reference to a buffer where the channel adapter attributes,
\r
609 * including port attribute information will be copied. If this parameter
\r
610 * is NULL, then the required buffer size needed to return all of the CA
\r
611 * attribute information is returned through the p_size parameter. The
\r
612 * ib_ca_attr_t structure for the specified channel adapter is stored
\r
613 * at the top of the buffer.
\r
616 * [in/out] On input, this references the size of the data buffer
\r
617 * referenced by the p_ca_attr parameter.
\r
619 * On output, the number of bytes used or needed to copy all CA
\r
620 * attribute information.
\r
624 * The attributes were returned successfully.
\r
626 * IB_INVALID_CA_HANDLE
\r
627 * The channel adapter handle was invalid.
\r
629 * IB_INSUFFICIENT_MEMORY
\r
630 * The size of the p_ca_attr buffer, specified through p_size, is
\r
631 * insufficient to store all of the CA attribute information.
\r
633 * IB_INVALID_PARAMETER
\r
634 * A reference to the size was not provided.
\r
637 * This routine returns information about the specified channel adapter,
\r
638 * including port attributes. The amount of information returned through
\r
639 * this call is variable sized. Users may obtain the size of the data
\r
640 * buffer required to obtain the CA attributes by calling this function
\r
641 * with p_ca_attr set to NULL. The access layer will then return the
\r
642 * necessary size in the variable referenced by the p_size parameter.
\r
645 * ib_open_ca, ib_query_ca_by_guid, ib_modify_ca, ib_close_ca, ib_ca_attr_t
\r
649 /****f* Access Layer/ib_query_ca_by_guid
\r
651 * ib_query_ca_by_guid
\r
654 * Queries the attributes of an opened channel adapter.
\r
658 AL_EXPORT ib_api_status_t AL_API
\r
659 ib_query_ca_by_guid(
\r
660 IN const ib_al_handle_t h_al,
\r
661 IN const ib_net64_t ca_guid,
\r
662 OUT ib_ca_attr_t* const p_ca_attr OPTIONAL,
\r
663 IN OUT uint32_t* const p_size );
\r
667 * [in] The handle to an open instance of AL.
\r
670 * [in] The GUID of the channel adapter to query.
\r
673 * [out] A reference to a buffer where the channel adapter attributes,
\r
674 * including port attribute information will be copied. If this parameter
\r
675 * is NULL, then the required buffer size needed to return all of the CA
\r
676 * attribute information is returned through the p_size parameter. The
\r
677 * ib_ca_attr_t structure for the specified channel adapter is stored
\r
678 * at the top of the buffer.
\r
681 * [in/out] On input, this references the size of the data buffer
\r
682 * referenced by the p_ca_attr parameter.
\r
684 * On output, the number of bytes used or needed to copy all CA
\r
685 * attribute information.
\r
689 * The attributes were returned successfully.
\r
691 * IB_INVALID_AL_HANDLE
\r
692 * The access layer handle was invalid.
\r
695 * No channel adapter in the system was found for the specified ca_guid.
\r
697 * IB_INSUFFICIENT_MEMORY
\r
698 * The size of the p_ca_attr buffer, specified through p_size, is
\r
699 * insufficient to store all of the CA attribute information.
\r
701 * IB_INVALID_PARAMETER
\r
702 * A reference to the size was not provided.
\r
705 * This routine returns information about the specified channel adapter,
\r
706 * including port attributes. The amount of information returned through
\r
707 * this call is variable sized. Users may obtain the size of the data
\r
708 * buffer required to obtain the CA attributes by calling this function
\r
709 * with p_ca_attr set to NULL. The access layer will then return the
\r
710 * necessary size in the variable referenced by the p_size parameter.
\r
713 * ib_open_ca, ib_query_ca, ib_modify_ca, ib_close_ca, ib_ca_attr_t
\r
717 /****f* Access Layer/ib_modify_ca
\r
722 * Modifies the attributes and violation counters associated with a port.
\r
726 AL_EXPORT ib_api_status_t AL_API
\r
728 IN const ib_ca_handle_t h_ca,
\r
729 IN const uint8_t port_num,
\r
730 IN const ib_ca_mod_t ca_mod,
\r
731 IN const ib_port_attr_mod_t* const p_port_attr_mod );
\r
735 * [in] A handle to an opened channel adapter.
\r
738 * [in] An index to the port that is being modified. The port_num matches
\r
739 * the index of the port as returned through the ib_query_ca call.
\r
742 * [in] A mask of the attributes and counters to modify.
\r
745 * [in] A list of the specific port attribute information to modify. For
\r
746 * the access layer to modify an attribute, its corresponding bit must be
\r
747 * set in the ca_mod parameter.
\r
751 * The attributes were successfully modified.
\r
753 * IB_INVALID_CA_HANDLE
\r
754 * The channel adapter handle was invalid.
\r
757 * The port number supplied was invalid for the given channel adapter.
\r
759 * IB_INVALID_PARAMETER
\r
760 * The supplied ca_mod mask is invalid or a reference to the port
\r
761 * attribute information was not provided.
\r
764 * The optional qkey and pkey violation counters are not supported by
\r
765 * this channel adapter, but an attempt was made to modify them.
\r
768 * This call sets the attributes for a port in its associated PORT_INFO
\r
769 * structure. It will also reset pkey and qkey violation counters.
\r
772 * ib_open_ca, ib_query_ca, ib_close_ca, ib_ca_mod_t, ib_port_attr_mod_t
\r
776 /****f* Access Layer/ib_close_ca
\r
781 * Closes an opened channel adapter. Once closed, no further access to this
\r
782 * channel adapter is possible.
\r
786 AL_EXPORT ib_api_status_t AL_API
\r
788 IN const ib_ca_handle_t h_ca,
\r
789 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
793 * [in] A handle to an opened channel adapter.
\r
796 * [in] A user-specified callback that is invoked after the channel
\r
797 * adapter has been successfully destroyed.
\r
801 * The close request was registered.
\r
803 * IB_INVALID_CA_HANDLE
\r
804 * The channel adapter handle was invalid.
\r
807 * This call closes the opened channel adapter and frees all associated
\r
808 * resources, such as queue pairs, protection domains, and completion
\r
809 * queues. Since callbacks may be outstanding against the channel adapter
\r
810 * or one of its resources at the time the close operation is invoked, this
\r
811 * call operates asynchronously. The user will be notified through a callback
\r
812 * once the close operation completes, indicating that no additional callbacks
\r
813 * will be invoked for the specified channel adapter or a related resource.
\r
820 /****f* Access Layer/ib_alloc_pd
\r
825 * Allocates a protection domain on the specified channel adapter.
\r
829 AL_EXPORT ib_api_status_t AL_API
\r
831 IN const ib_ca_handle_t h_ca,
\r
832 IN const ib_pd_type_t pd_type,
\r
833 IN const void* const pd_context,
\r
834 OUT ib_pd_handle_t* const ph_pd );
\r
838 * [in] A handle to an opened channel adapter.
\r
841 * [in] Indicates the type of protection domain being created.
\r
844 * [in] A client-specified context to associate with this allocated
\r
845 * protection domain. This context is returned to the user when
\r
846 * invoking asynchronous callbacks referencing this protection domain.
\r
849 * [out] Upon successful completion of this call, this references a
\r
850 * handle to the allocated protection domain.
\r
854 * The operation was successful.
\r
856 * IB_INVALID_CA_HANDLE
\r
857 * The channel adapter handle was invalid.
\r
859 * IB_INVALID_PARAMETER
\r
860 * The supplied pd_type value is invalid or a reference to the protection
\r
861 * domain handle was not provided.
\r
863 * IB_INSUFFICIENT_MEMORY
\r
864 * There was insufficient memory to allocate the protection domain.
\r
866 * IB_INSUFFICIENT_RESOURCES
\r
867 * There were insufficient resources currently available on the channel
\r
868 * adapter to create the protection domain.
\r
871 * When successful, this routine returns a handle to a newly allocated
\r
872 * protection domain.
\r
875 * ib_dealloc_pd, ib_pd_type_t
\r
879 /****f* Access Layer/ib_dealloc_pd
\r
884 * Deallocates a protection domain.
\r
888 AL_EXPORT ib_api_status_t AL_API
\r
890 IN const ib_pd_handle_t h_pd,
\r
891 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
895 * [in] A handle to an allocated protection domain.
\r
898 * [in] A user-specified callback that is invoked after the protection
\r
899 * domain has been successfully destroyed.
\r
903 * The operation was successful.
\r
905 * IB_INVALID_PD_HANDLE
\r
906 * The protection domain handle was invalid.
\r
909 * This call deallocates a protection domain and releases all associated
\r
910 * resources, including queue pairs and registered memory regions. Since
\r
911 * callbacks may be outstanding against one of protection domain's related
\r
912 * resources at the time the deallocation call is invoked, this call operates
\r
913 * asynchronously. The user will be notified through a callback once the
\r
914 * deallocation call completes, indicating that no additional callbacks
\r
915 * will be invoked for a related resource.
\r
922 /****f* Access Layer/ib_create_av
\r
927 * Creates an address vector.
\r
931 AL_EXPORT ib_api_status_t AL_API
\r
933 IN const ib_pd_handle_t h_pd,
\r
934 IN const ib_av_attr_t* const p_av_attr,
\r
935 OUT ib_av_handle_t* const ph_av );
\r
939 * [in] A handle to an allocated protection domain that the address
\r
940 * vector will be associated with.
\r
943 * [in] Attributes for the newly created address vector.
\r
946 * [out] Upon successful completion of this call, this references a
\r
947 * handle to the newly created address vector.
\r
951 * The operation was successful.
\r
953 * IB_INVALID_PD_HANDLE
\r
954 * The protection domain handle was invalid.
\r
956 * IB_INVALID_PARAMETER
\r
957 * A reference to the address vector attributes or handle was not
\r
960 * IB_INSUFFICIENT_MEMORY
\r
961 * There was insufficient memory to create the address vector.
\r
964 * The port number supplied, through the address vector attributes,
\r
965 * was invalid for the given channel adapter.
\r
967 * IB_INSUFFICIENT_RESOURCES
\r
968 * There were insufficient resources currently available on the channel
\r
969 * adapter to create the address vector.
\r
972 * This routine creates an address vector. Clients specify the attributes
\r
973 * of the address vector through the p_av_attr parameter.
\r
976 * ib_query_av, ib_modify_av, ib_destroy_av
\r
980 /****f* Access Layer/ib_query_av
\r
985 * Returns the attributes of an address vector.
\r
989 AL_EXPORT ib_api_status_t AL_API
\r
991 IN const ib_av_handle_t h_av,
\r
992 OUT ib_av_attr_t* const p_av_attr,
\r
993 OUT ib_pd_handle_t* const ph_pd );
\r
997 * [in] A handle to an existing address vector.
\r
1000 * [out] Upon successful completion, the structure referenced by this
\r
1001 * parameter contains the attributes of the specified address vector.
\r
1004 * [out] Upon successful completion, this references a handle to the
\r
1005 * protection domain associated with the address vector.
\r
1009 * The attributes were returned successfully.
\r
1011 * IB_INVALID_AV_HANDLE
\r
1012 * The address vector handle was invalid.
\r
1014 * IB_INVALID_PARAMETER
\r
1015 * A reference to the address vector attributes structure or protection
\r
1016 * domain handle was not provided.
\r
1019 * ib_create_av, ib_modify_av, ib_destroy_av, ib_av_attr_t
\r
1023 /****f* Access Layer/ib_modify_av
\r
1028 * Modifies the attributes of an existing address vector.
\r
1032 AL_EXPORT ib_api_status_t AL_API
\r
1034 IN const ib_av_handle_t h_av,
\r
1035 IN const ib_av_attr_t* const p_av_attr );
\r
1039 * [in] A handle to an existing address vector.
\r
1042 * [in] The new attributes to use when modifying the address vector.
\r
1046 * The address vector was successfully modified.
\r
1048 * IB_INVALID_AV_HANDLE
\r
1049 * The address vector handle was invalid.
\r
1051 * IB_INVALID_PARAMETER
\r
1052 * A reference to the address vector attributes structure was not
\r
1056 * The port number supplied, through the address vector attributes,
\r
1057 * was invalid for the given channel adapter.
\r
1060 * This routine modifies the attributes of an existing address vector.
\r
1061 * The new attributes are specified through the p_av_attr parameter.
\r
1064 * ib_create_av, ib_destroy_av
\r
1068 /****f* Access Layer/ib_destroy_av
\r
1073 * Destroys an existing address vector.
\r
1077 AL_EXPORT ib_api_status_t AL_API
\r
1079 IN const ib_av_handle_t h_av );
\r
1083 * [in] A handle to an existing address vector.
\r
1087 * The address vector was successfully destroyed.
\r
1089 * IB_INVALID_AV_HANDLE
\r
1090 * The address vector handle was invalid.
\r
1093 * This routine destroys an existing address vector.
\r
1100 /****f* Access Layer/ib_create_qp
\r
1105 * Creates a queue pair and returns its handle to the user.
\r
1109 AL_EXPORT ib_api_status_t AL_API
\r
1111 IN const ib_pd_handle_t h_pd,
\r
1112 IN const ib_qp_create_t* const p_qp_create,
\r
1113 IN const void* const qp_context,
\r
1114 IN const ib_pfn_event_cb_t pfn_qp_event_cb OPTIONAL,
\r
1115 OUT ib_qp_handle_t* const ph_qp );
\r
1119 * [in] This is a handle to a protection domain associated with the queue
\r
1123 * [in] Attributes necessary to allocate and initialize the queue pair.
\r
1126 * [in] A user-specified context information associated with the
\r
1130 * [in] User-specified error callback routine invoked after an
\r
1131 * asynchronous event has occurred on the queue pair.
\r
1134 * [out] Upon successful completion of this call, this references a
\r
1135 * handle to the newly created queue pair.
\r
1139 * The queue pair was successfully created.
\r
1141 * IB_INVALID_PD_HANDLE
\r
1142 * The protection domain to associate with the queue pair was invalid.
\r
1144 * IB_INVALID_PARAMETER
\r
1145 * A reference to the queue pair attributes or handle was not provided.
\r
1147 * IB_INSUFFICIENT_MEMORY
\r
1148 * There was insufficient memory to create the queue pair.
\r
1150 * IB_INSUFFICIENT_RESOURCES
\r
1151 * There were insufficient resources currently available on the channel
\r
1152 * adapter to create the queue pair.
\r
1154 * IB_INVALID_CQ_HANDLE
\r
1155 * The send or receive completion queue to associate with the queue pair
\r
1158 * IB_INVALID_SETTING
\r
1159 * The specified queue pair creation attributes are invalid.
\r
1162 * The specified queue pair type was not supported by the channel adapter.
\r
1164 * IB_INVALID_MAX_WRS
\r
1165 * The requested maximum send or receive work request depth could not be
\r
1168 * IB_INVALID_MAX_SGE
\r
1169 * The requested maximum number of scatter-gather entries for the send or
\r
1170 * receive queue could not be supported.
\r
1173 * This routine allocates a queue pair with the specified attributes. If
\r
1174 * the queue pair cannot be allocated, an error is returned. When creating
\r
1175 * the queue pair, users associate a context with the queue pair. This
\r
1176 * context is returned to the user through the asynchronous event callback
\r
1177 * if an event occurs.
\r
1179 * This routine is used to create queue pairs of type:
\r
1181 * IB_QPT_RELIABLE_CONN
\r
1182 * IB_QPT_UNRELIABLE_CONN
\r
1183 * IB_QPT_UNRELIABLE_DGRM
\r
1186 * Callers of ib_create_qp should call ib_init_dgrm_svc if the queue pair
\r
1187 * is of type IB_QPT_UNRELIABLE_DGRM or IB_QPT_MAD before sending or
\r
1188 * receiving data. IB_QPT_RELIABLE_CONN, IB_QPT_UNRELIABLE_CONN type
\r
1189 * queue pairs should be used by the connection establishment process
\r
1190 * before data may be sent or received on the QP.
\r
1192 * This call does not return the QP attributes as MAD QPs do not support
\r
1193 * such an operation. This is a minor specification deviation.
\r
1196 * ib_query_qp, ib_modify_qp, ib_destroy_qp, ib_cm_req, ib_cm_rep, ib_cm_rtu
\r
1197 * ib_init_dgrm_svc, ib_qp_create_t, ib_pfn_event_cb_t, ib_qp_attr_t
\r
1201 /****f* Access Layer/ib_get_spl_qp
\r
1206 * Create a special QP or QP alias. This call provides access to queue
\r
1207 * pairs 0 and 1, and the raw queue pair types.
\r
1211 AL_EXPORT ib_api_status_t AL_API
\r
1213 IN const ib_pd_handle_t h_pd,
\r
1214 IN const ib_net64_t port_guid,
\r
1215 IN const ib_qp_create_t* const p_qp_create,
\r
1216 IN const void* const qp_context,
\r
1217 IN const ib_pfn_event_cb_t pfn_qp_event_cb OPTIONAL,
\r
1218 OUT ib_pool_key_t* const p_pool_key OPTIONAL,
\r
1219 OUT ib_qp_handle_t* const ph_qp );
\r
1223 * [in] This is a handle to a protection domain associated with the queue
\r
1224 * pair. This must be a protection domain alias for aliased QP types.
\r
1227 * [in] The port GUID that the special QP will be associated with.
\r
1230 * [in] Attributes necessary to allocate and initialize the queue pair.
\r
1233 * [in] A user-specified context information associated with the
\r
1236 * pfn_qp_ervent_cb
\r
1237 * [in] User-specified error callback routine invoked after an
\r
1238 * asynchronous event has occurred on the queue pair.
\r
1241 * [in] A key to a pool of MAD elements that are used to send MADs.
\r
1242 * This key is only valid for aliased QP types.
\r
1245 * [out] Upon successful completion of this call, this references a
\r
1246 * handle to the newly created queue pair.
\r
1250 * The queue pair was successfully created.
\r
1252 * IB_INVALID_PD_HANDLE
\r
1253 * The protection domain to associate with the queue pair was invalid.
\r
1256 * The port number supplied was invalid for the given channel adapter.
\r
1258 * IB_INVALID_PARAMETER
\r
1259 * A reference to the queue pair attributes or handle was not provided.
\r
1261 * IB_INVALID_PERMISSION
\r
1262 * The calling process does not have sufficient privilege to create the
\r
1263 * requested queue pair type.
\r
1265 * IB_INSUFFICIENT_MEMORY
\r
1266 * There was insufficient memory to create the queue pair.
\r
1268 * IB_INSUFFICIENT_RESOURCES
\r
1269 * There were insufficient resources currently available on the channel
\r
1270 * adapter to create the queue pair.
\r
1272 * IB_INVALID_CQ_HANDLE
\r
1273 * The send or receive completion queue to associate with the queue pair
\r
1276 * IB_INVALID_SETTING
\r
1277 * The specified queue pair type was invalid.
\r
1280 * The specified queue pair type was not supported by the channel adapter.
\r
1282 * IB_INVALID_MAX_WRS
\r
1283 * The requested maximum send or receive work request depth could not be
\r
1286 * IB_INVALID_MAX_SGE
\r
1287 * The requested maximum number of scatter-gather entries for the send or
\r
1288 * receive queue could not be supported.
\r
1291 * This routine allocates a queue pair with the specified attributes. If
\r
1292 * the queue pair cannot be allocated, an error is returned. When creating
\r
1293 * the queue pair, users associate a context with the queue pair. This
\r
1294 * context is returned to the user through the asynchronous event callback
\r
1295 * if an event occurs.
\r
1297 * This routine is used to create queue pairs of type:
\r
1302 * IB_QPT_RAW_ETHER
\r
1303 * IB_QPT_QP0_ALIAS
\r
1304 * IB_QPT_QP1_ALIAS
\r
1306 * Callers of ib_get_spl_qp should call ib_init_dgrm_svc if the queue pair is
\r
1307 * of type IB_QPT_QP0, IB_QPT_QP1, IB_QPT_RAW_IPV6, IB_QPT_RAW_ETHER before
\r
1308 * sending or receiving data. MADs may be sent on aliased QPs on the
\r
1309 * successful return of this routine.
\r
1312 * ib_query_qp, ib_modify_qp, ib_destroy_qp, ib_get_mad
\r
1313 * ib_init_dgrm_svc, ib_qp_create_t, ib_pfn_event_cb_t, ib_qp_attr_t
\r
1317 /****f* Access Layer/ib_query_qp
\r
1322 * Query the current attributes of the queue pair.
\r
1326 AL_EXPORT ib_api_status_t AL_API
\r
1328 IN const ib_qp_handle_t h_qp,
\r
1329 OUT ib_qp_attr_t* const p_qp_attr );
\r
1333 * [in] A handle to an existing queue pair.
\r
1336 * [out] Upon successful completion of this call, the structure
\r
1337 * referenced by this parameter contains the attributes of the specified
\r
1342 * The queue pair attributes were returned successfully.
\r
1344 * IB_INVALID_QP_HANDLE
\r
1345 * The queue pair handle was invalid.
\r
1347 * IB_INVALID_PARAMETER
\r
1348 * A reference to the queue pair attributes structure was not provided.
\r
1351 * This routine returns information about the specified queue pair.
\r
1354 * ib_create_qp, ib_modify_qp, ib_qp_attr_t
\r
1358 /****f* Access Layer/ib_modify_qp
\r
1363 * Modifies the attributes of an existing queue pair.
\r
1367 AL_EXPORT ib_api_status_t AL_API
\r
1369 IN const ib_qp_handle_t h_qp,
\r
1370 IN const ib_qp_mod_t* const p_qp_mod );
\r
1374 * [in] A handle to an existing queue pair.
\r
1377 * [in] The new attributes to use when modifying the queue pair.
\r
1381 * The queue pair was successfully modified.
\r
1383 * IB_INVALID_QP_HANDLE
\r
1384 * The queue pair handle was invalid.
\r
1386 * IB_INVALID_PARAMETER
\r
1387 * A reference to the queue pair attributes was not provided.
\r
1389 * IB_INVALID_SETTING
\r
1390 * The specified queue pair attributes were invalid.
\r
1392 * IB_INSUFFICIENT_RESOURCES
\r
1393 * There were insufficient resources currently available on the channel
\r
1394 * adapter to register the modify the queue pair.
\r
1397 * The requested modification was not supported.
\r
1399 * IB_INVALID_QP_STATE
\r
1400 * The queue pair was in an invalid state for the requested operation.
\r
1403 * The specified pkey was not valid.
\r
1405 * IB_INVALID_APM_STATE
\r
1406 * The specified automatic path migration state was not valid.
\r
1409 * This routine modifies the attributes of an existing queue pair and
\r
1410 * transitions it to a new state. The new state and attributes are
\r
1411 * specified through the p_qp_mod parameter. Upon successful completion,
\r
1412 * the queue pair is in the requested state.
\r
1415 * ib_create_qp, ib_destroy_qp, ib_qp_mod_t
\r
1419 /****f* Access Layer/ib_destroy_qp
\r
1424 * Release a queue pair. Once destroyed, no further access to this
\r
1425 * queue pair is possible.
\r
1429 AL_EXPORT ib_api_status_t AL_API
\r
1431 IN const ib_qp_handle_t h_qp,
\r
1432 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
1436 * [in] A handle to an existing queue pair.
\r
1439 * [in] A user-specified callback that is invoked after the queue pair
\r
1440 * has been successfully destroyed.
\r
1444 * The destroy request was registered.
\r
1446 * IB_INVALID_QP_HANDLE
\r
1447 * The queue pair handle was invalid.
\r
1450 * This call destroys an existing queue pair. Since callbacks may be
\r
1451 * outstanding against the queue pair at the time the destroy operation is
\r
1452 * invoked, the this call operates asynchronously. The user will be notified
\r
1453 * through a callback once the destroy operation completes, indicating that
\r
1454 * no additional callbacks will be invoked for the specified queue pair.
\r
1461 /****s* Access Layer/ib_cq_create_t
\r
1466 * Attributes used to initialize a completion queue at creation time.
\r
1470 typedef struct _ib_cq_create
\r
1473 ib_pfn_comp_cb_t pfn_comp_cb;
\r
1474 cl_waitobj_handle_t h_wait_obj;
\r
1480 * Specifies the maximum number of work completions that may be on the
\r
1481 * completion queue. If the creation call is successful, the actual
\r
1482 * size of the completion queue will be returned. The actual size of
\r
1483 * the CQ will be greater than or equal to the requested size.
\r
1486 * A callback that is invoked whenever a signaled completion occurs on
\r
1487 * the completion queue. This field is mutually exclusive with the
\r
1491 * A wait object that is triggered whenever a signaled completion occurs
\r
1492 * on the completion queue. This field is mutually exclusive with the
\r
1493 * pfn_comp_cb field and is only valid for user-mode clients. The wait
\r
1494 * object must be ready for use when the call to ib_create_cq is invoked.
\r
1497 * Clients must specify either an event or a callback when creating a
\r
1498 * completion queue. When a signaled completion occurs on the completion
\r
1499 * queue, the client will be notified through the callback or by
\r
1500 * signaling the specified event.
\r
1503 * ib_create_cq, ib_pfn_comp_cb_t
\r
1507 /****f* Access Layer/ib_create_cq
\r
1512 * Creates a completion queue and returns its handle to the user.
\r
1516 AL_EXPORT ib_api_status_t AL_API
\r
1518 IN const ib_ca_handle_t h_ca,
\r
1519 IN OUT ib_cq_create_t* const p_cq_create,
\r
1520 IN const void* const cq_context,
\r
1521 IN const ib_pfn_event_cb_t pfn_cq_event_cb OPTIONAL,
\r
1522 OUT ib_cq_handle_t* const ph_cq );
\r
1526 * [in] A handle to an open channel adapter.
\r
1529 * [in] Attributes necessary to allocate and initialize the
\r
1530 * completion queue.
\r
1533 * [in] A user-specified context associated with the completion queue.
\r
1536 * [in] User-specified error callback routine invoked after an
\r
1537 * asynchronous event has occurred on the completion queue.
\r
1540 * [out] Upon successful completion of this call, this references a
\r
1541 * handle to the newly created completion queue.
\r
1545 * The completion queue was successfully created.
\r
1547 * IB_INVALID_CA_HANDLE
\r
1548 * The channel adapter handle was invalid.
\r
1550 * IB_INVALID_PARAMETER
\r
1551 * A reference to the completion queue attributes or handle was not
\r
1554 * IB_INVALID_SETTING
\r
1555 * The specified attributes that should be used to create the completion
\r
1556 * queue are invalid. Both completion callback and wait object
\r
1557 * information were supplied or are missing.
\r
1559 * IB_INSUFFICIENT_MEMORY
\r
1560 * There was insufficient memory to create the completion queue.
\r
1562 * IB_INSUFFICIENT_RESOURCES
\r
1563 * There were insufficient resources currently available on the channel
\r
1564 * adapter to create the completion queue.
\r
1566 * IB_INVALID_CQ_SIZE
\r
1567 * The requested size of the completion queue was larger than the
\r
1568 * maximum supported by the associated channel adapter.
\r
1571 * This routine allocates a completion queue on the specified channel
\r
1572 * adapter. If the completion queue cannot be allocated, an error is
\r
1573 * returned. When creating the completion queue, users associate a context
\r
1574 * with the completion queue. This context is returned to the user through
\r
1575 * the completion and asynchronous event callbacks.
\r
1578 * ib_query_cq, ib_modify_cq, ib_destroy_cq, ib_cq_create_t, ib_pfn_event_cb_t
\r
1582 /****f* Access Layer/ib_modify_cq
\r
1587 * Modifies the attributes associated with a completion queue, allowing the
\r
1588 * completion queue to be resized.
\r
1592 AL_EXPORT ib_api_status_t AL_API
\r
1594 IN const ib_cq_handle_t h_cq,
\r
1595 IN OUT uint32_t* const p_size );
\r
1599 * [in] A handle to an existing completion queue.
\r
1602 * [in/out] Specifies the new size of the completion queue. If the
\r
1603 * modify call is successful, the actual size of the completion queue
\r
1604 * will be returned. The actual size of the CQ will be greater than or
\r
1605 * equal to the requested size.
\r
1609 * The completion queue was successfully modified.
\r
1611 * IB_INVALID_CQ_HANDLE
\r
1612 * The completion queue handle was invalid.
\r
1614 * IB_INVALID_PARAMETER
\r
1615 * A reference to the completion queue size was not provided.
\r
1617 * IB_INVALID_CQ_SIZE
\r
1618 * The requested size of the completion queue was larger than the
\r
1619 * maximum supported by the associated channel adapter.
\r
1622 * The specified size of the completion queue is smaller than the number
\r
1623 * of work completions currently on the completion queue.
\r
1625 * IB_INSUFFICIENT_MEMORY
\r
1626 * There was insufficient memory to modify the completion queue.
\r
1629 * This routine allows a client to modify the size of a completion queue.
\r
1630 * If the new size is larger than what the associated channel adapter can
\r
1631 * support, an error is returned. If the completion queue has valid
\r
1632 * completion entries on it and the requested size is smaller than the
\r
1633 * number of entries, an overflow error is returned and the modify
\r
1634 * operation is aborted.
\r
1641 /****f* Access Layer/ib_query_cq
\r
1646 * Returns information about the specified completion queue.
\r
1650 AL_EXPORT ib_api_status_t AL_API
\r
1652 IN const ib_cq_handle_t h_cq,
\r
1653 OUT uint32_t* const p_size );
\r
1657 * [in] A handle to an existing completion queue.
\r
1660 * [out] Upon successful completion of this call, contains the actual
\r
1661 * size of the completion queue.
\r
1665 * The completion queue was successfully queried.
\r
1667 * IB_INVALID_CQ_HANDLE
\r
1668 * The completion queue handle was invalid.
\r
1670 * IB_INVALID_PARAMETER
\r
1671 * A reference to the completion queue size was not provided.
\r
1678 /****f* Access Layer/ib_destroy_cq
\r
1683 * Destroys a completion queue. Once destroyed, no further access to the
\r
1684 * completion queue is possible.
\r
1688 AL_EXPORT ib_api_status_t AL_API
\r
1690 IN const ib_cq_handle_t h_cq,
\r
1691 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
1695 * [in] A handle to an existing completion queue.
\r
1698 * [in] A user-provided callback that is invoked after the
\r
1699 * completion queue has been successfully destroyed.
\r
1703 * The destroy request was registered.
\r
1705 * IB_INVALID_CQ_HANDLE
\r
1706 * The completion queue handle was invalid.
\r
1709 * This call destroys an existing completion queue. Since callbacks may be
\r
1710 * outstanding against the completion queue at the time the destroy operation
\r
1711 * is invoked, the this call operates asynchronously. The user will be
\r
1712 * notified through a callback once the destroy operation completes,
\r
1713 * indicating that no additional callbacks will be invoked for the specified
\r
1714 * completion queue.
\r
1716 * If there are still queue pairs associated with the completion queue when
\r
1717 * this function is invoked, the destroy operation will fail with status
\r
1718 * IB_RESOURCE_BUSY.
\r
1721 * ib_create_cq, ib_pfn_destroy_cb_t
\r
1725 /****f* Access Layer/ib_reg_mem
\r
1730 * Registers a virtual memory region with a channel adapter.
\r
1734 AL_EXPORT ib_api_status_t AL_API
\r
1736 IN const ib_pd_handle_t h_pd,
\r
1737 IN const ib_mr_create_t* const p_mr_create,
\r
1738 OUT net32_t* const p_lkey,
\r
1739 OUT net32_t* const p_rkey,
\r
1740 OUT ib_mr_handle_t* const ph_mr );
\r
1744 * [in] A handle to an existing protection domain that the memory
\r
1745 * should be registered with.
\r
1748 * [in] Information describing the memory region to register.
\r
1751 * [out] The local access key associated with this registered memory
\r
1755 * [out] A key that may be used by a remote end-point when performing
\r
1756 * RDMA or atomic operations to this registered memory region.
\r
1759 * [out] Upon successful completion of this call, this references a
\r
1760 * handle to the registered memory region. This handle is used when
\r
1761 * performing data transfers and to deregister the memory.
\r
1765 * The memory region was successfully registered.
\r
1767 * IB_INVALID_PD_HANDLE
\r
1768 * The protection domain to associate with the memory region was invalid.
\r
1770 * IB_INVALID_PARAMETER
\r
1771 * A reference to the memory region information, lkey, rkey, or handle
\r
1772 * was not provided.
\r
1774 * IB_INSUFFICIENT_MEMORY
\r
1775 * There was insufficient memory to register the memory region.
\r
1777 * IB_INSUFFICIENT_RESOURCES
\r
1778 * There were insufficient resources currently available on the channel
\r
1779 * adapter to register the memory region.
\r
1782 * The requested access rights are not supported by the channel adapter.
\r
1784 * IB_INVALID_PERMISSION
\r
1785 * The requested access rights are invalid.
\r
1788 * This routine registers a virtual memory region with a channel adapter.
\r
1789 * Memory must be registered before being used in a data transfer operation.
\r
1792 * ib_dereg_mr, ib_reg_phys, ib_reg_shared, ib_mr_create_t
\r
1796 /****f* Access Layer/ib_reg_phys
\r
1801 * Registers a physical memory region with a channel adapter.
\r
1805 AL_EXPORT ib_api_status_t AL_API
\r
1807 IN const ib_pd_handle_t h_pd,
\r
1808 IN const ib_phys_create_t* const p_phys_create,
\r
1809 IN OUT uint64_t* const p_vaddr,
\r
1810 OUT net32_t* const p_lkey,
\r
1811 OUT net32_t* const p_rkey,
\r
1812 OUT ib_mr_handle_t* const ph_mr );
\r
1816 * [in] A handle to an existing protection domain that the memory
\r
1817 * should be registered with.
\r
1820 * [in] Information describing the memory region to register.
\r
1823 * [in/out] On input, references the requested virtual address for the
\r
1824 * start of the physical region. On output, references the actual
\r
1825 * virtual address assigned to the registered region.
\r
1828 * [out] The local access key associated with this registered memory
\r
1832 * [out] A key that may be used by a remote end-point when performing
\r
1833 * RDMA or atomic operations to this registered memory region.
\r
1836 * [out] Upon successful completion of this call, this references a
\r
1837 * handle to the registered memory region. This handle is used when
\r
1838 * performing data transfers and to deregister the memory.
\r
1842 * The physical memory region was successfully registered.
\r
1844 * IB_INVALID_PD_HANDLE
\r
1845 * The protection domain to associate with the physical memory region
\r
1848 * IB_INVALID_PARAMETER
\r
1849 * A reference to the physical memory region information, virtual address,
\r
1850 * lkey, rkey, or handle was not provided.
\r
1852 * IB_INSUFFICIENT_MEMORY
\r
1853 * There was insufficient memory to register the physical memory region.
\r
1855 * IB_INSUFFICIENT_RESOURCES
\r
1856 * There were insufficient resources currently available on the channel
\r
1857 * adapter to register the physical memory region.
\r
1860 * The requested access rights are not supported by the channel adapter.
\r
1862 * IB_INVALID_PERMISSION
\r
1863 * The requested access rights are invalid.
\r
1866 * This routine registers an array of physical pages as a single virtually
\r
1867 * contiguous region with a channel adapter. Memory must be registered
\r
1868 * before being used in a data transfer operation.
\r
1871 * ib_dereg_mr, ib_reg_mem, ib_reg_shared, ib_phys_create_t
\r
1875 /****f* Access Layer/ib_query_mr
\r
1880 * Query the current attributes of a memory region.
\r
1884 AL_EXPORT ib_api_status_t AL_API
\r
1886 IN const ib_mr_handle_t h_mr,
\r
1887 OUT ib_mr_attr_t* const p_mr_attr );
\r
1891 * [in] A handle to a registered memory region.
\r
1894 * [out] A reference to a structure where the registered memory attributes
\r
1899 * The memory region attributes were returned successfully.
\r
1901 * IB_INVALID_MR_HANDLE
\r
1902 * The memory region handle was invalid.
\r
1904 * IB_INVALID_PARAMETER
\r
1905 * A reference to the memory region attributes was not provided.
\r
1908 * This routine returns information about the specified registered memory
\r
1912 * ib_dereg_mr, ib_reg_mem, ib_reg_shared, ib_mr_attr_t
\r
1916 /****f* Access Layer/ib_rereg_mem
\r
1921 * Modifies the attributes of an existing memory region.
\r
1925 AL_EXPORT ib_api_status_t AL_API
\r
1927 IN const ib_mr_handle_t h_mr,
\r
1928 IN const ib_mr_mod_t mr_mod_mask,
\r
1929 IN const ib_mr_create_t* const p_mr_create OPTIONAL,
\r
1930 OUT net32_t* const p_lkey,
\r
1931 OUT net32_t* const p_rkey,
\r
1932 IN const ib_pd_handle_t h_pd OPTIONAL );
\r
1936 * [in] A handle to the registered memory region being modified.
\r
1939 * [in] A mask used to specify which attributes of the memory region are
\r
1943 * [in] This references information needed to perform the modification on
\r
1944 * the registered memory region. This parameter may be NULL if only the
\r
1945 * protection domain will be modified.
\r
1948 * [out] The local access key associated with this registered memory
\r
1952 * [out] A key that may be used by a remote end-point when performing RDMA
\r
1953 * or atomic operations to this registered memory region.
\r
1956 * [in] An optionally provided parameter used to modify the protection
\r
1957 * domain of a registered region.
\r
1961 * The memory region attributes were modified successfully.
\r
1963 * IB_INVALID_MR_HANDLE
\r
1964 * The memory region handle was invalid.
\r
1966 * IB_INVALID_PARAMETER
\r
1967 * A reference to the lkey or rkey was not provided or the specified
\r
1968 * modify mask is invalid.
\r
1970 * IB_INVALID_SETTING
\r
1971 * The specified memory region attributes are invalid.
\r
1973 * IB_INVALID_PD_HANDLE
\r
1974 * The protection domain handle was invalid.
\r
1976 * IB_INSUFFICIENT_RESOURCES
\r
1977 * There were insufficient resources currently available on the channel
\r
1978 * adapter to modify the memory region.
\r
1981 * The requested access rights are not supported by the channel adapter.
\r
1983 * IB_INVALID_PERMISSION
\r
1984 * The requested access rights are invalid.
\r
1986 * IB_RESOURCE_BUSY
\r
1987 * The memory region has windows bound to it.
\r
1990 * This routine modifies the attributes of the specified memory region.
\r
1991 * The memory being modified may have been registered using either virtual
\r
1992 * or physical registration. Conceptually, this routine is equivalent to
\r
1993 * to calling ib_dereg_mr, followed by ib_reg_mem, but may be higher
\r
1997 * ib_reg_mem, ib_reg_phys, ib_dereg_mr, ib_mr_mod_t, ib_mr_create_t
\r
2001 /****f* Access Layer/ib_rereg_phys
\r
2006 * Modifies the attributes of an existing memory region.
\r
2010 AL_EXPORT ib_api_status_t AL_API
\r
2012 IN const ib_mr_handle_t h_mr,
\r
2013 IN const ib_mr_mod_t mr_mod_mask,
\r
2014 IN const ib_phys_create_t* const p_phys_create OPTIONAL,
\r
2015 IN OUT uint64_t* const p_vaddr,
\r
2016 OUT net32_t* const p_lkey,
\r
2017 OUT net32_t* const p_rkey,
\r
2018 IN const ib_pd_handle_t h_pd OPTIONAL );
\r
2022 * [in] A handle to the registered memory region being modified.
\r
2025 * [in] A mask used to specify which attributes of the memory region are
\r
2029 * [in] This references information needed to perform the modification on
\r
2030 * the registered memory region. This parameter may be NULL if
\r
2031 * only the protection domain will be modified.
\r
2034 * [in/out] On input, this specifies the requested virtual address for the
\r
2035 * start of the physical region. On output, this references the actual
\r
2036 * virtual address assigned to the registered region.
\r
2039 * [out] The local access key associated with this registered memory
\r
2043 * [out] A key that may be used by a remote end-point when performing RDMA
\r
2044 * or atomic operations to this registered memory region.
\r
2047 * [in] An optionally provided parameter used to modify the protection
\r
2048 * domain of a registered region.
\r
2052 * The memory region attributes were modified successfully.
\r
2054 * IB_INVALID_MR_HANDLE
\r
2055 * The memory region handle was invalid.
\r
2057 * IB_INVALID_PARAMETER
\r
2058 * A reference to the virtual address, lkey, rkey was not provided or
\r
2059 * the specified modify mask is invalid.
\r
2061 * IB_INVALID_SETTING
\r
2062 * The specified memory region attributes are invalid.
\r
2064 * IB_INVALID_PD_HANDLE
\r
2065 * The protection domain handle was invalid.
\r
2067 * IB_INSUFFICIENT_RESOURCES
\r
2068 * There were insufficient resources currently available on the channel
\r
2069 * adapter to modify the memory region.
\r
2072 * The requested access rights are not supported by the channel adapter.
\r
2074 * IB_INVALID_PERMISSION
\r
2075 * The requested access rights are invalid.
\r
2077 * IB_RESOURCE_BUSY
\r
2078 * The memory region has windows bound to it.
\r
2081 * This routine modifies the attributes of the specified memory region.
\r
2082 * The memory being modified may have been registered using either virtual
\r
2083 * or physical registration. Conceptually, this routine is equivalent to
\r
2084 * to calling ib_dereg_mr, followed by ib_reg_phys, but may be higher
\r
2088 * ib_reg_mem, ib_reg_phys, ib_dereg_mr, ib_mr_mod_t, ib_mr_create_t
\r
2092 /****f* Access Layer/ib_reg_shared
\r
2097 * Registers a memory region that has the same physical pages as an
\r
2098 * existing registered memory region.
\r
2102 AL_EXPORT ib_api_status_t AL_API
\r
2104 IN const ib_mr_handle_t h_mr,
\r
2105 IN const ib_pd_handle_t h_pd,
\r
2106 IN const ib_access_t access_ctrl,
\r
2107 IN OUT uint64_t* const p_vaddr,
\r
2108 OUT net32_t* const p_lkey,
\r
2109 OUT net32_t* const p_rkey,
\r
2110 OUT ib_mr_handle_t* const ph_mr );
\r
2114 * [in] A handle to an existing registered memory region that this
\r
2115 * registration should share physical pages with.
\r
2118 * [in] Handle to the PD on which memory is being registered
\r
2121 * [in] Access rights of the registered region.
\r
2124 * [in/out] On input, this specifies the requested virtual address for the
\r
2125 * start of the physical region. On output, this references the actual
\r
2126 * virtual address assigned to the registered region. This is always a
\r
2127 * 64-bit quantity to support registering more than 4GB of memory on
\r
2128 * 32-bit systems with PAE.
\r
2131 * [out] The local access key associated with this registered memory
\r
2135 * [out] A key that may be used by a remote end-point when performing RDMA
\r
2136 * or atomic operations to this registered memory region.
\r
2139 * [out] Upon successful completion of this call, this references a handle
\r
2140 * to the registered memory region. This handle is used when performing
\r
2141 * data transfers and to deregister the memory.
\r
2145 * The shared memory region was successfully registered.
\r
2147 * IB_INVALID_MR_HANDLE
\r
2148 * The memory region handle was invalid.
\r
2150 * IB_INVALID_PD_HANDLE
\r
2151 * The protection domain handle was invalid.
\r
2153 * IB_INVALID_PARAMETER
\r
2154 * A reference to the virtual address, lkey, rkey, or handle was not
\r
2157 * IB_INSUFFICIENT_MEMORY
\r
2158 * There was insufficient memory to register the shared memory region.
\r
2160 * IB_INSUFFICIENT_RESOURCES
\r
2161 * There were insufficient resources currently available on the channel
\r
2162 * adapter to register the shared memory region.
\r
2165 * The requested access rights are not supported by the channel adapter.
\r
2167 * IB_INVALID_PERMISSION
\r
2168 * The requested access rights are invalid.
\r
2171 * This routine registers a memory region that shares the same set of
\r
2172 * physical pages associated with an existing registered memory region.
\r
2175 * ib_dereg_mr, ib_reg_mem, ib_reg_phys, ib_reg_shared, ib_mr_create_t
\r
2179 /****f* Access Layer/ib_reg_shmid
\r
2184 * Registers a memory region to be shared across multiple processes.
\r
2185 * The memory is referenced by a shared memory identifier.
\r
2189 AL_EXPORT ib_api_status_t AL_API
\r
2191 IN const ib_pd_handle_t h_pd,
\r
2192 IN const ib_shmid_t shmid,
\r
2193 IN const ib_mr_create_t* const p_mr_create,
\r
2194 OUT uint64_t* const p_vaddr,
\r
2195 OUT net32_t* const p_lkey,
\r
2196 OUT net32_t* const p_rkey,
\r
2197 OUT ib_mr_handle_t* const ph_mr );
\r
2201 * [in] A handle to an existing protection domain that the memory
\r
2202 * should be registered with.
\r
2205 * [in] An identifier for the shared memory region.
\r
2208 * [in] Information describing the attributes of the memory region to
\r
2212 * [out] The HCA assigned, HCA relative virtual address for the
\r
2216 * [out] The local access key associated with this registered memory
\r
2220 * [out] A key that may be used by a remote end-point when performing RDMA
\r
2221 * or atomic operations to this registered memory region.
\r
2224 * [out] Upon successful completion of this call, this references a handle
\r
2225 * to the registered memory region. This handle is used when performing
\r
2226 * data transfers and to deregister the memory.
\r
2230 * The shared memory region was successfully registered.
\r
2232 * IB_INVALID_PD_HANDLE
\r
2233 * The protection domain handle was invalid.
\r
2235 * IB_INVALID_PARAMETER
\r
2236 * A reference to the memory region information, lkey, rkey, or handle
\r
2237 * was not provided.
\r
2239 * IB_INVALID_SETTING
\r
2240 * The length and page mapping for the memory region do not match those
\r
2241 * of the region identified by the provided SHMID.
\r
2243 * IB_INSUFFICIENT_MEMORY
\r
2244 * There was insufficient memory to register the shared memory region.
\r
2246 * IB_INSUFFICIENT_RESOURCES
\r
2247 * There were insufficient resources currently available on the channel
\r
2248 * adapter to register the shared memory region.
\r
2251 * The requested access rights are not supported by the channel adapter.
\r
2253 * IB_INVALID_PERMISSION
\r
2254 * The requested access rights are invalid.
\r
2257 * This routine registers a memory region that is shared between processes.
\r
2258 * The region being registered is identified through a shared memory
\r
2259 * identifier. The registered region shares hardware resources as much
\r
2263 * ib_dereg_mr, ib_reg_mem, ib_reg_shared, ib_mr_create_t
\r
2267 /****f* Access Layer/ib_dereg_mr
\r
2272 * Deregisters a registered memory region.
\r
2276 AL_EXPORT ib_api_status_t AL_API
\r
2278 IN const ib_mr_handle_t h_mr );
\r
2282 * [in] A handle to a registered memory region that will be unregistered.
\r
2286 * The memory region was successfully deregistered.
\r
2288 * IB_INVALID_MR_HANDLE
\r
2289 * The memory region handle was invalid.
\r
2291 * IB_RESOURCE_BUSY
\r
2292 * The memory region has memory windows bound to it.
\r
2295 * This routine deregisters a memory region with a channel adapter. The
\r
2296 * region may be deregistered only if there are no memory windows or
\r
2297 * existing shared memory regions currently bound to the region. Work
\r
2298 * requests referencing this region when it is deregistered will fail
\r
2299 * with a WRS_LOCAL_PROTECTION_ERR error.
\r
2302 * ib_reg_mem, ib_reg_phys, ib_reg_shared
\r
2308 /****f* Access Layer/mlnx_create_fmr
\r
2313 * Creates a Mellanox fast memory region.
\r
2317 AL_EXPORT ib_api_status_t AL_API
\r
2319 IN const ib_pd_handle_t h_pd,
\r
2320 IN const mlnx_fmr_create_t* const p_fmr_create,
\r
2321 OUT mlnx_fmr_handle_t* const ph_fmr );
\r
2325 * [in] An optionally provided parameter used to modify the protection
\r
2326 * domain of a registered region.
\r
2328 * [in] This references information needed to perform the modification on
\r
2329 * the registered memory region. This parameter may be NULL if only the
\r
2330 * protection domain will be modified.
\r
2332 * [out] A handle to the registered memory region being modified.
\r
2336 * The memory region attributes were modified successfully.
\r
2338 * IB_INVALID_MR_HANDLE
\r
2339 * The memory region handle was invalid.
\r
2341 * IB_INVALID_PARAMETER
\r
2342 * A reference to the lkey or rkey was not provided or the specified
\r
2343 * modify mask is invalid.
\r
2345 * IB_INVALID_SETTING
\r
2346 * The specified memory region attributes are invalid.
\r
2348 * IB_INVALID_PD_HANDLE
\r
2349 * The protection domain handle was invalid.
\r
2351 * IB_INSUFFICIENT_RESOURCES
\r
2352 * There were insufficient resources currently available on the channel
\r
2353 * adapter to modify the memory region.
\r
2356 * The requested access rights are not supported by the channel adapter.
\r
2358 * IB_INVALID_PERMISSION
\r
2359 * The requested access rights are invalid.
\r
2361 * IB_RESOURCE_BUSY
\r
2362 * The memory region has windows bound to it.
\r
2365 * This is a Mellanox specific extension to verbs.
\r
2368 * mlnx_destroy_fmr, mlnx_fmr_create_t
\r
2372 /****f* Access Layer/mlnx_map_fmr
\r
2381 AL_EXPORT ib_api_status_t AL_API
\r
2382 mlnx_map_phys_fmr(
\r
2383 IN const mlnx_fmr_handle_t h_fmr,
\r
2384 IN const uint64_t* const paddr_list,
\r
2385 IN const int list_len,
\r
2386 IN OUT uint64_t* const p_vaddr,
\r
2387 OUT net32_t* const p_lkey,
\r
2388 OUT net32_t* const p_rkey );
\r
2392 * [in] Handle to the fast memory region that these pages map to
\r
2394 * [in] array of phys address
\r
2396 * [in] number of pages in the list
\r
2398 * [in/out] On input, references the requested virtual address for the
\r
2399 * start of the FMR. On output, references the actual
\r
2400 * virtual address assigned to the FMR.
\r
2402 * [out] The local access key associated with this registered memory
\r
2405 * [out] A key that may be used by a remote end-point when performing
\r
2406 * RDMA or atomic operations to this registered memory region.
\r
2410 * The memory region attributes were modified successfully.
\r
2412 * IB_INVALID_MR_HANDLE
\r
2413 * The memory region handle was invalid.
\r
2415 * IB_INVALID_PARAMETER
\r
2416 * A reference to the lkey or rkey was not provided or the specified
\r
2417 * modify mask is invalid.
\r
2419 * IB_INVALID_SETTING
\r
2420 * The specified memory region attributes are invalid.
\r
2422 * IB_INVALID_PD_HANDLE
\r
2423 * The protection domain handle was invalid.
\r
2425 * IB_INSUFFICIENT_RESOURCES
\r
2426 * There were insufficient resources currently available on the channel
\r
2427 * adapter to modify the memory region.
\r
2430 * The requested access rights are not supported by the channel adapter.
\r
2432 * IB_INVALID_PERMISSION
\r
2433 * The requested access rights are invalid.
\r
2435 * IB_RESOURCE_BUSY
\r
2436 * The memory region has windows bound to it.
\r
2439 * This is a Mellanox specific extension to verbs.
\r
2442 * mlnx_destroy_fmr, mlnx_fmr_create_t
\r
2446 /****f* Access Layer/mlnx_unmap_fmr
\r
2455 AL_EXPORT ib_api_status_t AL_API
\r
2457 IN const mlnx_fmr_handle_t h_fmr );
\r
2464 * The memory region attributes were modified successfully.
\r
2466 * IB_INVALID_MR_HANDLE
\r
2467 * The memory region handle was invalid.
\r
2469 * IB_INVALID_PARAMETER
\r
2470 * A reference to the lkey or rkey was not provided or the specified
\r
2471 * modify mask is invalid.
\r
2473 * IB_INVALID_SETTING
\r
2474 * The specified memory region attributes are invalid.
\r
2476 * IB_INVALID_PD_HANDLE
\r
2477 * The protection domain handle was invalid.
\r
2479 * IB_INSUFFICIENT_RESOURCES
\r
2480 * There were insufficient resources currently available on the channel
\r
2481 * adapter to modify the memory region.
\r
2484 * The requested access rights are not supported by the channel adapter.
\r
2486 * IB_INVALID_PERMISSION
\r
2487 * The requested access rights are invalid.
\r
2489 * IB_RESOURCE_BUSY
\r
2490 * The memory region has windows bound to it.
\r
2493 * This is a Mellanox specific extension to verbs.
\r
2496 * mlnx_destroy_fmr, mlnx_fmr_create_t
\r
2500 /****f* Access Layer/mlnx_destroy_fmr
\r
2502 * mlnx_destroy_fmr
\r
2505 * Destroys an existing Mellanox fast memory region.
\r
2509 AL_EXPORT ib_api_status_t AL_API
\r
2511 IN const mlnx_fmr_handle_t h_fmr );
\r
2515 * [in] A handle to the registered memory region being modified.
\r
2519 * The memory region attributes were modified successfully.
\r
2521 * IB_INVALID_MR_HANDLE
\r
2522 * The memory region handle was invalid.
\r
2524 * IB_INVALID_PARAMETER
\r
2525 * A reference to the lkey or rkey was not provided or the specified
\r
2526 * modify mask is invalid.
\r
2528 * IB_INVALID_SETTING
\r
2529 * The specified memory region attributes are invalid.
\r
2531 * IB_INVALID_PD_HANDLE
\r
2532 * The protection domain handle was invalid.
\r
2534 * IB_INSUFFICIENT_RESOURCES
\r
2535 * There were insufficient resources currently available on the channel
\r
2536 * adapter to modify the memory region.
\r
2539 * The requested access rights are not supported by the channel adapter.
\r
2541 * IB_INVALID_PERMISSION
\r
2542 * The requested access rights are invalid.
\r
2544 * IB_RESOURCE_BUSY
\r
2545 * The memory region has windows bound to it.
\r
2548 * This is a Mellanox specific extension to verbs.
\r
2551 * mlnx_destroy_fmr, mlnx_fmr_create_t
\r
2554 #endif /* CL_KERNEL */
\r
2556 /****f* Access Layer/ib_create_mw
\r
2561 * Creates a memory window associated with the specified protection domain.
\r
2562 * Newly created windows are not bound to any specific memory region.
\r
2566 AL_EXPORT ib_api_status_t AL_API
\r
2568 IN const ib_pd_handle_t h_pd,
\r
2569 OUT net32_t* const p_rkey,
\r
2570 OUT ib_mw_handle_t* const ph_mw );
\r
2574 * [in] A handle to an existing protection domain that the memory window
\r
2575 * should be created within.
\r
2578 * [out] The current rkey associated with the memory window. This key is
\r
2579 * used to bind the window to a registered memory region.
\r
2582 * [out] Upon successful completion of this call, this references a handle
\r
2583 * to the memory window. This handle is used to bind and destroy
\r
2588 * The memory window was successfully created.
\r
2590 * IB_INVALID_PD_HANDLE
\r
2591 * The protection domain handle was invalid.
\r
2593 * IB_INVALID_PARAMETER
\r
2594 * A reference to the memory window rkey or handle was not provided.
\r
2596 * IB_INSUFFICIENT_MEMORY
\r
2597 * There was insufficient memory to create the memory window.
\r
2599 * IB_INSUFFICIENT_RESOURCES
\r
2600 * There were insufficient resources currently available on the channel
\r
2601 * adapter to create the memory window.
\r
2604 * This routine creates an unbound memory window associated with a specified
\r
2605 * protection domain. The memory window cannot be used for data transfer
\r
2606 * operations until being bound to a registered memory region.
\r
2609 * ib_destroy_mw, ib_query_mw, ib_bind_mw
\r
2613 /****f* Access Layer/ib_query_mw
\r
2618 * Query the current attributes of a memory window.
\r
2622 AL_EXPORT ib_api_status_t AL_API
\r
2624 IN const ib_mw_handle_t h_mw,
\r
2625 OUT ib_pd_handle_t* const ph_pd,
\r
2626 OUT net32_t* const p_rkey );
\r
2630 * [in] A handle to an existing memory window.
\r
2633 * [out] Upon successful completion of this call, this will reference
\r
2634 * the protection domain associated with this memory window.
\r
2637 * [out] Upon successful completion of this call, this will reference
\r
2638 * the current rkey associated with this memory window.
\r
2642 * The memory window attributes were returned successfully.
\r
2644 * IB_INVALID_MW_HANDLE
\r
2645 * The memory window handle was invalid.
\r
2647 * IB_INVALID_PARAMETER
\r
2648 * A reference to the protection domain handle or rkey was not provided.
\r
2651 * This routine returns information about the specified memory window.
\r
2658 /****f* Access Layer/ib_bind_mw
\r
2663 * Binds a memory window to a registered memory region.
\r
2667 AL_EXPORT ib_api_status_t AL_API
\r
2669 IN const ib_mw_handle_t h_mw,
\r
2670 IN const ib_qp_handle_t h_qp,
\r
2671 IN ib_bind_wr_t* const p_mw_bind,
\r
2672 OUT net32_t* const p_rkey );
\r
2676 * [in] A handle to an existing memory window.
\r
2679 * [in] A handle to a queue pair that the bind request will be posted to.
\r
2682 * [in] Describes the memory window bind request.
\r
2685 * [out] The new rkey for the memory window that may be used by a remote
\r
2686 * end-point when performing RDMA or atomic operations to this memory
\r
2691 * The memory window bind operation was successfully posted.
\r
2693 * IB_INVALID_MW_HANDLE
\r
2694 * The memory window handle was invalid.
\r
2696 * IB_INVALID_QP_HANDLE
\r
2697 * The queue pair handle was invalid.
\r
2699 * IB_INVALID_PARAMETER
\r
2700 * A reference to the memory window bind work request or rkey was not
\r
2703 * IB_INVALID_SERVICE_TYPE
\r
2704 * The queue pair configuration does not support this type of service.
\r
2706 * IB_INVALID_MR_HANDLE
\r
2707 * The memory region handle was invalid.
\r
2710 * The rkey is invalid for the memory region being bound.
\r
2713 * The requested access rights are not supported by the channel adapter.
\r
2715 * IB_INVALID_PERMISSION
\r
2716 * The requested access rights are invalid.
\r
2718 * IB_INSUFFICIENT_RESOURCES
\r
2719 * There were insufficient resources currently available on the channel
\r
2720 * adapter to bind the memory window.
\r
2723 * This routine posts a request to bind a memory window to a registered
\r
2724 * memory region. The bind operation occurs on the specified queue pair,
\r
2725 * but the bound region is usable across all queue pairs within the same
\r
2726 * protection domain.
\r
2729 * ib_create_mw, ib_bind_wr_t
\r
2733 /****f* Access Layer/ib_destroy_mw
\r
2738 * Destroys a memory window.
\r
2742 AL_EXPORT ib_api_status_t AL_API
\r
2744 IN const ib_mw_handle_t h_mw );
\r
2748 * [in] A handle to an existing memory window.
\r
2752 * The memory window was successfully destroyed.
\r
2754 * IB_INVALID_MW_HANDLE
\r
2755 * The memory window handle was invalid.
\r
2758 * This routine deallocates a window entry created via a ib_create_mw.
\r
2759 * Once this operation is complete, future accesses to the window will fail.
\r
2766 /****f* Access Layer/ib_post_send
\r
2771 * This routine posts a work request to the send queue of a queue pair.
\r
2775 AL_EXPORT ib_api_status_t AL_API
\r
2777 IN const ib_qp_handle_t h_qp,
\r
2778 IN ib_send_wr_t* const p_send_wr,
\r
2779 OUT ib_send_wr_t **pp_send_failure OPTIONAL );
\r
2783 * [in] The queue pair to which this work request is being submitted.
\r
2786 * [in] A reference to the head of the work request list.
\r
2789 * [out] If the post send operation failed, this references the work
\r
2790 * request in the p_send_wr list where the first failure occurred.
\r
2791 * This parameter may be NULL if only a single work request is being
\r
2792 * posted to the QP.
\r
2796 * All work requests were successfully posted.
\r
2798 * IB_INVALID_QP_HANDLE
\r
2799 * The queue pair handle was invalid.
\r
2801 * IB_INVALID_PARAMETER
\r
2802 * A reference to the send work request list was not provided.
\r
2804 * IB_INSUFFICIENT_RESOURCES
\r
2805 * The number of posted work requests exceed the current depth available
\r
2806 * on the send queue.
\r
2808 * IB_INVALID_WR_TYPE
\r
2809 * The work request type was invalid.
\r
2811 * IB_INVALID_QP_STATE
\r
2812 * The current queue pair state does not allow posting sends.
\r
2814 * IB_INVALID_MAX_SGE
\r
2815 * The number of work request scatter gather elements exceed the queue
\r
2816 * pair configuration.
\r
2819 * The requested operation is not supported by the channel adapter.
\r
2822 * This routine posts a work request to the send queue of a queue pair.
\r
2823 * The type of work to perform is defined by the p_send_wr parameter.
\r
2830 /****f* Access Layer/ib_post_recv
\r
2835 * This routine posts a work request to the receive queue of a queue pair.
\r
2839 AL_EXPORT ib_api_status_t AL_API
\r
2841 IN const ib_qp_handle_t h_qp,
\r
2842 IN ib_recv_wr_t* const p_recv_wr,
\r
2843 OUT ib_recv_wr_t **pp_recv_failure OPTIONAL );
\r
2847 * [in] The queue pair to which this work request is being submitted.
\r
2850 * [in] A reference to the head of the work request list.
\r
2853 * [out] If the post receive operation failed, this references the work
\r
2854 * request in the p_recv_wr list where the first failure occurred.
\r
2855 * This parameter may be NULL if only a single work request is being
\r
2856 * posted to the QP.
\r
2860 * All work requests were successfully posted.
\r
2862 * IB_INVALID_QP_HANDLE
\r
2863 * The queue pair handle was invalid.
\r
2865 * IB_INVALID_PARAMETER
\r
2866 * A reference to the receive work request list was not provided.
\r
2868 * IB_INSUFFICIENT_RESOURCES
\r
2869 * The number of posted work requests exceed the current depth available
\r
2870 * on the receive queue.
\r
2872 * IB_INVALID_WR_TYPE
\r
2873 * The work request type was invalid.
\r
2875 * IB_INVALID_QP_STATE
\r
2876 * The current queue pair state does not allow posting receives.
\r
2879 * This routine posts a work request to the receive queue of a queue pair.
\r
2880 * The type of work to perform is defined by the p_recv_wr parameter. This
\r
2881 * call is used to post data buffers to receive incoming message sends.
\r
2888 /****f* Access Layer/ib_send_mad
\r
2893 * This routine posts a work request to the send queue of a queue pair.
\r
2897 AL_EXPORT ib_api_status_t AL_API
\r
2899 IN const ib_mad_svc_handle_t h_mad_svc,
\r
2900 IN ib_mad_element_t* const p_mad_element_list,
\r
2901 OUT ib_mad_element_t **pp_mad_failure OPTIONAL );
\r
2905 * [in] The MAD service to which this work request is being submitted.
\r
2907 * p_mad_element_list
\r
2908 * [in] A list of MAD elements that will be posted to the send queue.
\r
2911 * [out] If the send MAD operation failed, this references the MAD
\r
2912 * element in the p_mad_element_list where the first failure occurred.
\r
2913 * This parameter is optional if p_mad_element_list contains a single
\r
2918 * The MAD element list was successfully posted.
\r
2920 * IB_INVALID_HANDLE
\r
2921 * The MAD service handle was invalid.
\r
2923 * IB_INVALID_PARAMETER
\r
2924 * A reference to the MAD element list was not provided.
\r
2926 * IB_INSUFFICIENT_RESOURCES
\r
2927 * There were insufficient resources currently available to complete
\r
2930 * IB_INVALID_SETTING
\r
2931 * The MAD element RMPP version is not supported by the access layer.
\r
2933 * IB_INSUFFICIENT_MEMORY
\r
2934 * There was insufficient memory to complete the request.
\r
2937 * This routine posts a work request to send a MAD on a MAD service. All
\r
2938 * MAD elements successfully posted by this call are under the control of
\r
2939 * the access layer and should not be accessed until the send operation
\r
2942 * In order to guarantee that MADs sent by separate clients do not use the
\r
2943 * same transaction ID, the access layer reserves the upper 32-bits of the
\r
2944 * TID on all unsolicited MADs. MADs sent with the response bit set will
\r
2945 * not have their transaction ID's modified. Unsolicited MADs will have the
\r
2946 * upper 32-bits of their TID set to an access layer generated client ID.
\r
2949 * ib_mad_element_t, ib_cancel_mad
\r
2953 /****f* Access Layer/ib_cancel_mad
\r
2958 * This routine cancels a pending send transaction to a MAD service.
\r
2962 AL_EXPORT ib_api_status_t AL_API
\r
2964 IN const ib_mad_svc_handle_t h_mad_svc,
\r
2965 IN ib_mad_element_t* const p_mad_element );
\r
2969 * [in] The MAD service to which the send operation was directed.
\r
2972 * [in] A handle to a sent MAD element.
\r
2976 * The requested MAD transaction was located and canceled.
\r
2978 * IB_INVALID_PARAMETER
\r
2979 * A reference to the MAD element list was not provided.
\r
2982 * The requested transaction was not located or had already completed.
\r
2985 * This routine cancels a pending send transaction to a MAD service. If
\r
2986 * the request is successfully located and has not yet completed, it will
\r
2987 * be completed with its status set to IB_CANCELED. The canceled operation
\r
2988 * will be returned to the user through the normal MAD completion callback.
\r
2989 * If the send transaction has already completed, this call will return
\r
2997 /****f* Access Layer/ib_peek_cq
\r
3002 * Returns the number of entries currently on the completion queue.
\r
3006 AL_EXPORT ib_api_status_t AL_API
\r
3008 IN const ib_cq_handle_t h_cq,
\r
3009 OUT uint32_t* const p_n_cqes );
\r
3013 * [in] Handle to the completion queue to peek.
\r
3016 * [out] Upon successful completion of this call, contains the number
\r
3017 * of completion queue entries currently on the completion queue.
\r
3021 * The peek operation completed successfully.
\r
3023 * IB_INVALID_CQ_HANDLE
\r
3024 * The completion queue handle was invalid.
\r
3026 * IB_INVALID_PARAMETER
\r
3027 * A reference to the completion queue entry count was not provided.
\r
3030 * This operation is not supported by the channel adapter.
\r
3033 * The value returned is a snapshot of the number of compleiton queue
\r
3034 * entries curently on the completion queue. Support for this operation
\r
3035 * is optional by a channel adapter vendor.
\r
3038 * ib_create_cq, ib_poll_cq, ib_rearm_cq, ib_rearm_n_cq
\r
3042 /****f* Access Layer/ib_poll_cq
\r
3047 * Checks a completion queue for completed work requests.
\r
3051 AL_EXPORT ib_api_status_t AL_API
\r
3053 IN const ib_cq_handle_t h_cq,
\r
3054 IN OUT ib_wc_t** const pp_free_wclist,
\r
3055 OUT ib_wc_t** const pp_done_wclist );
\r
3059 * [in] A handle to a completion queue to check for completions on.
\r
3062 * [in/out] On input, a list of work completion structures provided by
\r
3063 * the client. These are used to report completed work requests through
\r
3064 * the pp_done_wclist.
\r
3066 * On output, this contains the list of work completions structures for
\r
3067 * which no work completion was found.
\r
3070 * [out] A list of work completions retrieved from the completion queue.
\r
3074 * The poll operation completed successfully. If the work completion
\r
3075 * structures referenced by the pp_free_wclist list is empty there are
\r
3076 * potentially more completions available to retrieve.
\r
3078 * IB_INVALID_PARAMETER
\r
3079 * A reference to the free or done work completion list was not provided.
\r
3081 * IB_INVALID_CQ_HANDLE
\r
3082 * The completion queue handle was invalid.
\r
3085 * No completed work requests were removed from the completion queue.
\r
3088 * This routine retrieves completed work requests from the specified
\r
3089 * completion queue. This call will retrieve all completed requests,
\r
3090 * up to to the number of work completion structures referenced by the
\r
3091 * pp_free_wclist. Completed requests will be returned through the
\r
3092 * pp_done_wclist parameter.
\r
3095 * ib_create_cq, ib_post_send, ib_post_recv, ib_bind_mw, ib_wc_t
\r
3099 /****f* Access Layer/ib_rearm_cq
\r
3104 * This indicates that the completion queue should notify the client when
\r
3105 * the next completion is added.
\r
3109 AL_EXPORT ib_api_status_t AL_API
\r
3111 IN const ib_cq_handle_t h_cq,
\r
3112 IN const boolean_t solicited );
\r
3116 * [in] Handle to the completion queue to rearm.
\r
3119 * [in] A flag indicating whether the request is to generate a
\r
3120 * notification on the next entry, if set to FALSE, or on the next
\r
3121 * solicited entry being added to the completion queue, if set to TRUE.
\r
3125 * The completion queue rearm request was registered successfully.
\r
3127 * IB_INVALID_CQ_HANDLE
\r
3128 * The completion queue handle was invalid.
\r
3131 * This routine instructs the channel interface to invoke the completion
\r
3132 * handler when the next completion queue entry is added to this CQ.
\r
3135 * ib_create_cq, ib_peek_cq, ib_poll_cq, ib_rearm_n_cq
\r
3139 /****f* Access Layer/ib_rearm_n_cq
\r
3144 * This indicates that the completion queue should notify the client when
\r
3145 * the next N completions have been added to this CQ.
\r
3149 AL_EXPORT ib_api_status_t AL_API
\r
3151 IN const ib_cq_handle_t h_cq,
\r
3152 IN const uint32_t n_cqes );
\r
3156 * [in] Handle to the completion queue to rearm.
\r
3159 * [in] The number of completion queue entries to be added to the
\r
3160 * completion queue before notifying the client. This value must
\r
3161 * greater than or equal to one and less than or equal to the size
\r
3162 * of the completion queue.
\r
3166 * The completion queue rearm request was registered successfully.
\r
3168 * IB_INVALID_CQ_HANDLE
\r
3169 * The completion queue handle was invalid.
\r
3171 * IB_INVALID_PARAMETER
\r
3172 * The requested number of completion queue entries was invalid.
\r
3175 * This operation is not supported by the channel adapter.
\r
3178 * This routine instructs the channel interface to invoke the completion
\r
3179 * handler when the next N completions have been added to this CQ regardless
\r
3180 * of the completion type (solicited or unsolicited). Any CQ entries that
\r
3181 * existed before the rearm is enabled will not result in a call to the
\r
3182 * handler. Support for this operation is optional by a channel adapter
\r
3186 * ib_create_cq, ib_peek_cq, ib_poll_cq, ib_rearm_cq
\r
3190 /****s* Access Layer/ib_mcast_rec_t
\r
3195 * Information returned as a result of joining a multicast group.
\r
3199 typedef struct _ib_mcast_rec
\r
3201 const void* __ptr64 mcast_context;
\r
3202 ib_api_status_t status;
\r
3203 ib_net16_t error_status;
\r
3205 ib_mcast_handle_t h_mcast;
\r
3206 ib_member_rec_t* __ptr64 p_member_rec;
\r
3212 * User-defined context information associated with the multicast join
\r
3216 * Indicates the success of the multicast group join operation.
\r
3219 * Provide additional error information that was provided by the SA.
\r
3220 * This field is only valid if status is set to IB_REMOTE_ERROR.
\r
3223 * Upon successful completion of a multicast join, this references a
\r
3224 * handle to the multicast group. This handle is used to leave the
\r
3225 * multicast group.
\r
3228 * References a member record that provides information about the
\r
3229 * multicast group.
\r
3232 * This structure is returned to a client through a callback to notify them
\r
3233 * of the result of a multicast join operation.
\r
3236 * ib_join_mcast, ib_pfn_mcast_cb_t, ib_leave_mcast
\r
3240 /****f* Access Layer/ib_pfn_mcast_cb_t
\r
3242 * ib_pfn_mcast_cb_t
\r
3245 * User-defined callback invoked on completion of a multicast join request.
\r
3250 (AL_API * __ptr64 ib_pfn_mcast_cb_t)(
\r
3251 IN ib_mcast_rec_t *p_mcast_rec );
\r
3255 * [in] References the result of the join operation.
\r
3258 * The callback is used to notify a client of the result of a multicast
\r
3261 * This callback is invoked within a system thread context in the kernel.
\r
3264 * ib_join_mcast, ib_mcast_rec_t
\r
3268 /****s* Access Layer/ib_mcast_req_t
\r
3273 * Information used to join a multicast group.
\r
3277 typedef struct _ib_mcast_req
\r
3280 ib_member_rec_t member_rec;
\r
3282 const void* __ptr64 mcast_context;
\r
3283 ib_pfn_mcast_cb_t pfn_mcast_cb;
\r
3285 uint32_t timeout_ms;
\r
3286 uint32_t retry_cnt;
\r
3287 ib_al_flags_t flags;
\r
3289 ib_net64_t port_guid;
\r
3290 uint16_t pkey_index;
\r
3296 * Indicates that the multicast group should be created if it does not
\r
3300 * Specifies the membership information of the multicast group to join
\r
3301 * or create. The mgid and join state (scope_state) fields of the
\r
3302 * member record must be set. In addition, if create is set to TRUE,
\r
3303 * the following fields must also be set: qkey, tclass, service level
\r
3304 * and flow label (sl_flow_hop), and pkey. All other fields are ignored
\r
3305 * by the access layer.
\r
3308 * User-defined context information associated with the join request.
\r
3309 * This context is returned to the user through the function specified
\r
3310 * by the pfn_mcast_cb field.
\r
3313 * A user-defined callback that is invoked upon completion of the
\r
3317 * Specifies the number of milliseconds to wait for a response for
\r
3318 * the join request until retrying or timing out the request.
\r
3321 * Specifies the number of times that the join request will be retried
\r
3322 * before failing the request.
\r
3325 * Used to describe the mode of operation. Set to IB_FLAGS_SYNC to
\r
3326 * process the called routine synchronously.
\r
3329 * Indicates the port that will join the multicast group. The QP
\r
3330 * specified as part of the ib_join_mast call will bind to this port.
\r
3333 * Specifies the pkey associated with this queue pair.
\r
3336 * This structure is used when joining an existing multicast group or
\r
3337 * creating a new multicast group.
\r
3340 * ib_join_mcast, ib_pfn_mcast_cb_t, ib_gid_t
\r
3344 /****f* Access Layer/ib_join_mcast
\r
3349 * Attaches a queue pair to a multicast group.
\r
3353 AL_EXPORT ib_api_status_t AL_API
\r
3355 IN const ib_qp_handle_t h_qp,
\r
3356 IN const ib_mcast_req_t* const p_mcast_req );
\r
3360 * [in] A handle to an unreliable datagram queue pair that will join the
\r
3361 * multicast group.
\r
3364 * [in] Specifies the multicast group to join.
\r
3368 * The join multicast group request has been initiated.
\r
3370 * IB_INVALID_QP_HANDLE
\r
3371 * The queue pair handle was invalid.
\r
3373 * IB_INVALID_PARAMETER
\r
3374 * A reference to the multicast group request information was not
\r
3377 * IB_INVALID_SERVICE_TYPE
\r
3378 * The queue pair configuration does not support this type of service.
\r
3380 * IB_INSUFFICIENT_MEMORY
\r
3381 * There was insufficient memory to join the multicast group.
\r
3384 * No port was found for the port_guid specified in the request.
\r
3386 * IB_INSUFFICIENT_RESOURCES
\r
3387 * There were insufficient resources currently available on the channel
\r
3388 * adapter to perform the operation.
\r
3391 * The pkey specified in the multicast join request does not match the
\r
3392 * pkey of the queue pair.
\r
3395 * The port GUID specified in the multicast join request does not match
\r
3396 * the port of the queue pair.
\r
3399 * An error occurred while performing the multicast group join operation.
\r
3401 * IB_INSUFFICIENT_RESOURCES
\r
3402 * There were insufficient resources currently available to complete
\r
3405 * IB_INSUFFICIENT_MEMORY
\r
3406 * There was insufficient memory to complete the request.
\r
3409 * This routine results in the specified queue pair joining a multicast
\r
3410 * group. If the multicast group does not already exist, it will be created
\r
3411 * at the user's option. Information about the multicast group is returned
\r
3412 * to the user through a callback specified through the p_mcast_req
\r
3415 * If the specified queue pair is already a member of a multicast group when
\r
3416 * this call is invoked, an error will occur if there are conflicting
\r
3417 * membership requirements. The QP is restricted to being bound to a single
\r
3418 * port_guid and using a single pkey.
\r
3421 * ib_leave_mcast, ib_mcast_req_t, ib_create_qp, ib_init_dgrm_svc
\r
3425 /****f* Access Layer/ib_leave_mcast
\r
3430 * Removes a queue pair from a multicast group.
\r
3434 AL_EXPORT ib_api_status_t AL_API
\r
3436 IN const ib_mcast_handle_t h_mcast,
\r
3437 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
3441 * [in] A handle to a joined multicast group.
\r
3444 * [in] An optional user-specified callback that is invoked after the
\r
3445 * leave request has completed.
\r
3449 * The leave multicast group request has been initiated.
\r
3451 * IB_INVALID_MCAST_HANDLE
\r
3452 * The multicast group handle was invalid.
\r
3455 * An error occurred while performing the multicast group leave operation.
\r
3457 * IB_INSUFFICIENT_RESOURCES
\r
3458 * There were insufficient resources currently available on the channel
\r
3459 * adapter to perform the operation.
\r
3462 * This routine detaches a queue pair from a multicast group and removes
\r
3463 * it as a member of the group with the subnet administrator.
\r
3466 * ib_join_mcast, ib_pfn_destroy_cb_t
\r
3470 /****f* Access Layer/ib_local_mad
\r
3475 * Request that a locally received MAD be processed by the channel adapter
\r
3476 * on which it was received.
\r
3480 AL_EXPORT ib_api_status_t AL_API
\r
3482 IN const ib_ca_handle_t h_ca,
\r
3483 IN const uint8_t port_num,
\r
3484 IN const void* const p_mad_in,
\r
3485 OUT void* p_mad_out );
\r
3489 * [in] A handle to the channel adapter that should process the MAD.
\r
3490 * This must be the same adapter that the MAD was received on.
\r
3493 * [in] The port number to which this request is directed.
\r
3496 * [in] Pointer to a management datagram (MAD) structure containing
\r
3497 * the command to be processed.
\r
3500 * [out] References a MAD that should contain the response to the
\r
3501 * received input MAD specified through the p_mad_in parameter.
\r
3505 * The local MAD was processed successfully.
\r
3507 * IB_INVALID_CA_HANDLE
\r
3508 * The channel adapter handle was invalid.
\r
3511 * The port number was invalid.
\r
3513 * IB_INVALID_PARAMETER
\r
3514 * A reference to the MAD input or MAD output buffer was not provided.
\r
3517 * This call is provided to support SMA and GSA implementations above the
\r
3518 * verbs interface on ports that the access layer has disabled. This routine
\r
3519 * is used to perform local operations by the channel adapter. On successful
\r
3520 * return, the provide output MAD should be used when sending a response.
\r