2 * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
\r
3 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
\r
4 * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.
\r
6 * This software is available to you under the OpenIB.org BSD license
\r
9 * Redistribution and use in source and binary forms, with or
\r
10 * without modification, are permitted provided that the following
\r
11 * conditions are met:
\r
13 * - Redistributions of source code must retain the above
\r
14 * copyright notice, this list of conditions and the following
\r
17 * - Redistributions in binary form must reproduce the above
\r
18 * copyright notice, this list of conditions and the following
\r
19 * disclaimer in the documentation and/or other materials
\r
20 * provided with the distribution.
\r
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
23 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
24 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
25 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
26 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
27 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
28 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
35 #if !defined(__IB_AL_H__)
\r
38 #include <iba/ib_types.h>
\r
39 #include <complib/cl_waitobj.h>
\r
40 #include <complib/cl_qlist.h>
\r
45 #endif /* __cplusplus */
\r
47 /****h* IB Access Layer API/Access Layer
\r
49 * InfiniBand Access Layer
\r
51 * Copyright (c) 2003 Intel Corporation - All Rights Reserved.
\r
53 * The access layer provides transport level access to an InfiniBand fabric.
\r
54 * It supplies a foundation upon which a channel driver may be built. The
\r
55 * access layer exposes the capabilities of the InfiniBand architecture and
\r
56 * adds support for higher-level functionality required by most users of an
\r
57 * InfiniBand fabric. Users define the protocols and policies used by the
\r
58 * access layer, and the access layer implements them under the direction
\r
62 typedef struct _ib_al* ib_al_handle_t;
\r
63 typedef struct _al_pnp* ib_pnp_handle_t;
\r
64 typedef struct _al_reg_svc* ib_reg_svc_handle_t;
\r
65 typedef struct _al_mad_send* ib_mad_send_handle_t;
\r
66 typedef struct _al_mad_svc* ib_mad_svc_handle_t;
\r
67 typedef struct _al_query* ib_query_handle_t;
\r
68 typedef struct _al_sub* ib_sub_handle_t;
\r
69 typedef struct _al_listen* ib_listen_handle_t;
\r
70 typedef struct _al_ioc* ib_ioc_handle_t;
\r
71 typedef struct _al_svc_entry* ib_svc_handle_t;
\r
72 typedef struct _al_pool_key* ib_pool_key_t;
\r
73 typedef struct _al_pool* ib_pool_handle_t;
\r
74 typedef struct _mlnx_fmr_pool_element* mlnx_fmr_pool_el_t;
\r
77 typedef struct _ib_cm_handle
\r
79 ib_al_handle_t h_al;
\r
80 ib_qp_handle_t h_qp;
\r
86 /****s* Access Layer/ib_shmid_t
\r
91 * Shared Memory Identifier, used to uniquely identify a shared memory region.
\r
95 typedef uint8_t ib_shmid_t[64];
\r
102 /****d* Access Layer/ATS
\r
104 * DAPL Address Translation Service
\r
107 * ATS service ID, service name, and IPv4 offset for DAPL-compliant
\r
108 * ATS service records.
\r
110 #define ATS_SERVICE_ID CL_NTOH64( 0x10000CE100415453 )
\r
111 #define ATS_NAME "DAPL Address Translation Service"
\r
112 #define ATS_IPV4_OFFSET 12
\r
116 /****s* Access Layer/ib_mad_element_t
\r
121 * Information used to submit a work request to a management datagram (MAD)
\r
126 typedef struct _ib_mad_element
\r
128 TO_LONG_PTR(struct _ib_mad_element*, p_next);
\r
129 TO_LONG_PTR(const void*, context1);
\r
130 TO_LONG_PTR(const void*, context2);
\r
132 /* Request/completion data. */
\r
133 TO_LONG_PTR(ib_mad_t*, p_mad_buf);
\r
135 uint32_t immediate_data;
\r
136 ib_net32_t remote_qp;
\r
138 /* Send request information. */
\r
139 TO_LONG_PTR(ib_av_handle_t, h_av);
\r
140 ib_send_opt_t send_opt;
\r
141 ib_net32_t remote_qkey;
\r
142 boolean_t resp_expected;
\r
143 uint32_t timeout_ms;
\r
144 uint32_t retry_cnt;
\r
145 uint8_t rmpp_version;
\r
147 /* Completion information. */
\r
148 ib_wc_status_t status;
\r
149 boolean_t grh_valid;
\r
150 TO_LONG_PTR(ib_grh_t*, p_grh);
\r
152 /* Completed receive data or send request information if h_av is NULL. */
\r
154 ib_net16_t remote_lid;
\r
156 uint16_t pkey_index;
\r
159 /* Transaction completion data. */
\r
160 TO_LONG_PTR(void*, send_context1);
\r
161 TO_LONG_PTR(void*, send_context2);
\r
163 } ib_mad_element_t;
\r
167 * A pointer used to chain MAD elements together. This value is
\r
168 * set to NULL to mark the end of the chain.
\r
171 * User-defined context information associated with the datagram.
\r
174 * User-defined context information associated with the datagram.
\r
177 * The local data buffer contain the MAD.
\r
180 * The size of the MAD referenced by p_buffer.
\r
183 * 32-bit field sent or received as part of a datagram message.
\r
184 * This field is valid for send operations if the send_opt
\r
185 * IB_SEND_OPT_IMMEDIATE flag has been set. This field is valid
\r
186 * on received datagram completions if the recv_opt
\r
187 * IB_RECV_OPT_IMMEDIATE flag is set.
\r
190 * Identifies the destination queue pair of a datagram send operation or
\r
191 * the source queue pair of a received datagram.
\r
194 * An address vector that specifies the path information used to route
\r
195 * the outbound datagram to the destination queue pair. This handle may
\r
196 * be NULL when sending a directed route SMP or if the access layer
\r
197 * should create the address vector for the user.
\r
200 * Optional send control parameters. The following options are valid:
\r
201 * IB_SEND_OPT_IMMEDIATE and IB_SEND_OPT_SOLICITED. IB_SEND_OPT_FENCE
\r
202 * is only valid on MAD QPs.
\r
205 * The qkey for the destination queue pair.
\r
208 * This field is used to indicate that the submitted operation expects
\r
209 * a response. When set, the access layer will retry this send operation
\r
210 * until the corresponding response is successfully received, or the
\r
211 * request times out. Send operations for which a response is expected
\r
212 * will always be completed by the access layer before the corresponding
\r
213 * received response.
\r
216 * Specifies the number of milliseconds to wait for a response to
\r
217 * a request until retrying or timing out the request. This field is
\r
218 * ignored if resp_expected is set to FALSE.
\r
221 * Specifies the number of times that the request will be retried
\r
222 * before failing the request. This field is ignored if resp_expected
\r
226 * Indicates the version of the RMPP protocol to use when sending this
\r
227 * MAD. For MADs posted to MAD services of type IB_MAD_SVC_DEFAULT,
\r
228 * setting this field to 0 disables RMPP on user-defined management
\r
229 * classes or invokes the default RMPP version for well-defined management
\r
230 * classes, if appropriate. For MADs posted to MAD services of type
\r
231 * IB_MAD_SVC_RMPP, setting this field to 0 disables RMPP on the sent
\r
232 * MAD. Note that if the RMPP header exists, but the RMPP protocol is
\r
233 * not activated for this MAD, the user must ensure that the RMPP header
\r
234 * has been zeroed. This field is intended to help support backwards
\r
238 * The result of the MAD work request.
\r
241 * A flag indicating whether the p_grh reference is valid.
\r
244 * A reference to the global route header information.
\r
247 * Indicates optional fields valid as part of a work request that
\r
248 * completed on an unreliable datagram queue pair.
\r
251 * The source LID of the received datagram.
\r
254 * The service level used by the source of the received datagram.
\r
257 * This is valid only for IB_QPT_QP1 and IB_QPT_QP1_ALIAS QP types.
\r
258 * For received datagrams, this field contains the pkey index for
\r
259 * the source queue pair. For send operations, this field contains
\r
260 * the pkey index to use when posting the send work request.
\r
263 * The portion of the remote_lid that may be changed to vary the path
\r
264 * through the subnet to the remote port.
\r
267 * If this datagram was received as a response to a sent datagram, this
\r
268 * field contains the context1 value of the send operation. If this is
\r
269 * an unsolicited receive, this field will be 0.
\r
272 * If this datagram was received as a response to a sent datagram, this
\r
273 * field contains the context2 value of the send operation. If this is
\r
274 * an unsolicited receive, this field will be 0.
\r
277 * Identifies the source queue pair of a received datagram.
\r
280 * The format of data sent over the fabric is expected to be in the form
\r
281 * of a MAD. MADs are expected to match the format defined by the
\r
282 * Infiniband specification and must be in network-byte order when posted
\r
283 * to a MAD service.
\r
285 * This structure is received to notify a user that a datagram has been
\r
286 * received for a registered management class. Information of the source
\r
287 * of the data is provided, along with the data buffer.
\r
289 * The MAD element structure is defined such that a received MAD element
\r
290 * may be re-used as a sent response. In such cases, the h_av field may be
\r
291 * NULL. The address vector will be created and destroyed by the access
\r
295 * ib_get_mad, ib_put_mad, ib_send_mad, ib_local_ds_t, ib_send_opt_t,
\r
296 * ib_pfn_mad_recv_cb_t, ib_get_mad_buf
\r
300 /****f* Access Layer/ib_get_mad_buf
\r
305 * Returns a pointer to the MAD buffer associated with a MAD element.
\r
309 #pragma warning(push)
\r
310 #pragma warning(disable: 4244 )
\r
311 AL_INLINE void* AL_API
\r
313 IN const ib_mad_element_t* const p_mad_element )
\r
315 CL_ASSERT( p_mad_element );
\r
316 return( p_mad_element->p_mad_buf );
\r
318 #pragma warning (pop)
\r
322 * [in] A pointer to a MAD element.
\r
325 * Returns a pointer to the MAD buffer associated with a MAD element.
\r
332 /****f* Access Layer/ib_pfn_comp_cb_t
\r
337 * Completion callback provided by a client.
\r
342 (AL_API *ib_pfn_comp_cb_t)(
\r
343 IN const ib_cq_handle_t h_cq,
\r
344 IN void *cq_context );
\r
348 * [in] Handle for the completion queue on which the completion occurred.
\r
351 * [in] User-specified context for the completion queue on which the
\r
352 * completion occurred.
\r
355 * This function is invoked upon completion of a work request on a queue pair
\r
356 * associated with the completion queue. The context associated with the
\r
357 * completion queue on which the completion occurred is return to the client
\r
358 * through the callback.
\r
360 * In the kernel, this callback is usually invoked using a tasklet, dependent
\r
361 * on the implementation of the underlying verbs provider driver.
\r
365 /****d* Access Layer/ib_al_flags_t
\r
370 * Access layer flags used to direct the operation of various calls.
\r
374 typedef uint32_t ib_al_flags_t;
\r
375 #define IB_FLAGS_SYNC 0x00000001
\r
379 * Indicates that the given operation should be performed synchronously.
\r
380 * The call will block until it completes. Callbacks will still be
\r
384 * ib_cm_req_t, ib_cm_rep_t, ib_cm_dreq_t, ib_cm_lap_t,
\r
385 * ib_reg_svc_req_t, ib_mcast_req_t, ib_query_req_t, ib_sub_req_t
\r
389 /****f* Access Layer/ib_pfn_destroy_cb_t
\r
391 * ib_pfn_destroy_cb_t
\r
394 * Asynchronous callback invoked after a resource has been successfully
\r
400 (AL_API *ib_pfn_destroy_cb_t)(
\r
401 IN void *context );
\r
405 * [in] User-specified context associated with the resource being
\r
406 * destroyed. The context for the resource is usually set during the
\r
407 * object's creation.
\r
410 * This callback notifies a client that a resource has been successfully
\r
411 * destroyed. It is used to indicate that all pending callbacks associated
\r
412 * with the resource have completed, and no additional events will be
\r
413 * generated for that resource.
\r
415 * This callback is invoked within a system thread context in the kernel.
\r
417 * If the user specifies ib_sync_destroy as the asynchronous callback, then
\r
418 * the object being destroyed will be destroyed synchronously. This may
\r
419 * result in the calling thread blocking while outstanding callbacks complete.
\r
427 /****f* Access Layer/ib_sync_destroy
\r
432 * Access layer routine used to indicate synchronous destruction of an
\r
437 static const ib_pfn_destroy_cb_t ib_sync_destroy = (ib_pfn_destroy_cb_t)(LONG_PTR)-1;
\r
443 * Users specify ib_sync_destroy as the ib_pfn_destroy_cb_t callback in order
\r
444 * to force synchronous object destruction. This may result in the calling
\r
445 * thread blocking while outstanding callbacks complete.
\r
448 * ib_pfn_destroy_cb_t
\r
452 /****s* Access Layer/ib_async_event_rec_t
\r
454 * ib_async_event_rec_t
\r
457 * Information returned when an asynchronous event occurs on an allocated
\r
462 typedef struct _ib_async_event_rec
\r
464 ib_async_event_t code;
\r
465 uint64_t vendor_specific;
\r
467 TO_LONG_PTR(void*, context);
\r
470 TO_LONG_PTR(ib_ca_handle_t, h_ca);
\r
471 TO_LONG_PTR(ib_cq_handle_t, h_cq);
\r
472 TO_LONG_PTR(ib_qp_handle_t, h_qp);
\r
473 TO_LONG_PTR(struct _ib_srq*, h_srq);
\r
477 } ib_async_event_rec_t;
\r
481 * A code that identifies the type of event being reported.
\r
484 * A field containing optional vendor specific information.
\r
487 * User-defined context information associated with the resource on
\r
488 * which the error occurred.
\r
491 * A handle to the resource for which this event record was generated.
\r
492 * This handle will match the handle returned during the creation of
\r
493 * resource. It is provided in case an event occurs before a client's
\r
494 * call to create a resource can return.
\r
497 * ib_async_event_t, ib_pfn_event_cb_t
\r
501 /****f* Access Layer/ib_pfn_event_cb_t
\r
503 * ib_pfn_event_cb_t
\r
506 * A user-specified callback that is invoked after an asynchronous event
\r
507 * has occurred on an allocated resource.
\r
512 (AL_API *ib_pfn_event_cb_t)(
\r
513 IN ib_async_event_rec_t *p_event_rec );
\r
517 * [in] Information returned to the user, indicating the type of
\r
518 * event and the associated user context.
\r
521 * This callback is invoked within a system thread context in the kernel.
\r
524 * ib_async_event_rec_t
\r
528 /****f* Access Layer/ib_open_ca
\r
533 * Opens a channel adapter for additional access. A channel adapter must
\r
534 * be opened before consuming resources on that adapter.
\r
538 AL_EXPORT ib_api_status_t AL_API
\r
540 IN const ib_al_handle_t h_al,
\r
541 IN const ib_net64_t ca_guid,
\r
542 IN const ib_pfn_event_cb_t pfn_ca_event_cb OPTIONAL,
\r
543 IN const void* const ca_context,
\r
544 OUT ib_ca_handle_t* const ph_ca );
\r
548 * [in] The handle to an open instance of AL.
\r
551 * [in] The GUID of the channel adapter to open.
\r
554 * [in] A user-specified callback that is invoked after an
\r
555 * asynchronous event has occurred on the channel adapter.
\r
558 * [in] A client-specified context to associate with this opened instance
\r
559 * of the channel adapter. This context is returned to the user when
\r
560 * invoking asynchronous callbacks referencing this channel adapter.
\r
563 * [out] Upon successful completion of this call, this references a
\r
564 * handle to the opened channel adapter.
\r
568 * The operation was successful.
\r
570 * IB_INVALID_AL_HANDLE
\r
571 * The access layer handle was invalid.
\r
574 * No channel adapter in the system was found for the specified ca_guid.
\r
576 * IB_INVALID_PARAMETER
\r
577 * A reference to the CA handle was not provided.
\r
579 * IB_INSUFFICIENT_MEMORY
\r
580 * There was insufficient memory to open the channel adapter.
\r
583 * When successful, this routine returns a handle to an open instance of a CA.
\r
586 * ib_query_ca, ib_modify_ca, ib_close_ca, ib_pfn_event_cb_t
\r
590 /****f* Access Layer/ib_query_ca
\r
595 * Queries the attributes of an opened channel adapter.
\r
599 AL_EXPORT ib_api_status_t AL_API
\r
601 IN const ib_ca_handle_t h_ca,
\r
602 OUT ib_ca_attr_t* const p_ca_attr OPTIONAL,
\r
603 IN OUT uint32_t* const p_size );
\r
607 * [in] The handle to an open channel adapter.
\r
610 * [out] A reference to a buffer where the channel adapter attributes,
\r
611 * including port attribute information will be copied. If this parameter
\r
612 * is NULL, then the required buffer size needed to return all of the CA
\r
613 * attribute information is returned through the p_size parameter. The
\r
614 * ib_ca_attr_t structure for the specified channel adapter is stored
\r
615 * at the top of the buffer.
\r
618 * [in/out] On input, this references the size of the data buffer
\r
619 * referenced by the p_ca_attr parameter.
\r
621 * On output, the number of bytes used or needed to copy all CA
\r
622 * attribute information.
\r
626 * The attributes were returned successfully.
\r
628 * IB_INVALID_CA_HANDLE
\r
629 * The channel adapter handle was invalid.
\r
631 * IB_INSUFFICIENT_MEMORY
\r
632 * The size of the p_ca_attr buffer, specified through p_size, is
\r
633 * insufficient to store all of the CA attribute information.
\r
635 * IB_INVALID_PARAMETER
\r
636 * A reference to the size was not provided.
\r
639 * This routine returns information about the specified channel adapter,
\r
640 * including port attributes. The amount of information returned through
\r
641 * this call is variable sized. Users may obtain the size of the data
\r
642 * buffer required to obtain the CA attributes by calling this function
\r
643 * with p_ca_attr set to NULL. The access layer will then return the
\r
644 * necessary size in the variable referenced by the p_size parameter.
\r
647 * ib_open_ca, ib_query_ca_by_guid, ib_modify_ca, ib_close_ca, ib_ca_attr_t
\r
651 /****f* Access Layer/ib_query_ca_by_guid
\r
653 * ib_query_ca_by_guid
\r
656 * Queries the attributes of an opened channel adapter.
\r
660 AL_EXPORT ib_api_status_t AL_API
\r
661 ib_query_ca_by_guid(
\r
662 IN const ib_al_handle_t h_al,
\r
663 IN const ib_net64_t ca_guid,
\r
664 OUT ib_ca_attr_t* const p_ca_attr OPTIONAL,
\r
665 IN OUT uint32_t* const p_size );
\r
669 * [in] The handle to an open instance of AL.
\r
672 * [in] The GUID of the channel adapter to query.
\r
675 * [out] A reference to a buffer where the channel adapter attributes,
\r
676 * including port attribute information will be copied. If this parameter
\r
677 * is NULL, then the required buffer size needed to return all of the CA
\r
678 * attribute information is returned through the p_size parameter. The
\r
679 * ib_ca_attr_t structure for the specified channel adapter is stored
\r
680 * at the top of the buffer.
\r
683 * [in/out] On input, this references the size of the data buffer
\r
684 * referenced by the p_ca_attr parameter.
\r
686 * On output, the number of bytes used or needed to copy all CA
\r
687 * attribute information.
\r
691 * The attributes were returned successfully.
\r
693 * IB_INVALID_AL_HANDLE
\r
694 * The access layer handle was invalid.
\r
697 * No channel adapter in the system was found for the specified ca_guid.
\r
699 * IB_INSUFFICIENT_MEMORY
\r
700 * The size of the p_ca_attr buffer, specified through p_size, is
\r
701 * insufficient to store all of the CA attribute information.
\r
703 * IB_INVALID_PARAMETER
\r
704 * A reference to the size was not provided.
\r
707 * This routine returns information about the specified channel adapter,
\r
708 * including port attributes. The amount of information returned through
\r
709 * this call is variable sized. Users may obtain the size of the data
\r
710 * buffer required to obtain the CA attributes by calling this function
\r
711 * with p_ca_attr set to NULL. The access layer will then return the
\r
712 * necessary size in the variable referenced by the p_size parameter.
\r
715 * ib_open_ca, ib_query_ca, ib_modify_ca, ib_close_ca, ib_ca_attr_t
\r
719 /****f* Access Layer/ib_modify_ca
\r
724 * Modifies the attributes and violation counters associated with a port.
\r
728 AL_EXPORT ib_api_status_t AL_API
\r
730 IN const ib_ca_handle_t h_ca,
\r
731 IN const uint8_t port_num,
\r
732 IN const ib_ca_mod_t ca_mod,
\r
733 IN const ib_port_attr_mod_t* const p_port_attr_mod );
\r
737 * [in] A handle to an opened channel adapter.
\r
740 * [in] An index to the port that is being modified. The port_num matches
\r
741 * the index of the port as returned through the ib_query_ca call.
\r
744 * [in] A mask of the attributes and counters to modify.
\r
747 * [in] A list of the specific port attribute information to modify. For
\r
748 * the access layer to modify an attribute, its corresponding bit must be
\r
749 * set in the ca_mod parameter.
\r
753 * The attributes were successfully modified.
\r
755 * IB_INVALID_CA_HANDLE
\r
756 * The channel adapter handle was invalid.
\r
759 * The port number supplied was invalid for the given channel adapter.
\r
761 * IB_INVALID_PARAMETER
\r
762 * The supplied ca_mod mask is invalid or a reference to the port
\r
763 * attribute information was not provided.
\r
766 * The optional qkey and pkey violation counters are not supported by
\r
767 * this channel adapter, but an attempt was made to modify them.
\r
770 * This call sets the attributes for a port in its associated PORT_INFO
\r
771 * structure. It will also reset pkey and qkey violation counters.
\r
774 * ib_open_ca, ib_query_ca, ib_close_ca, ib_ca_mod_t, ib_port_attr_mod_t
\r
778 /****f* Access Layer/ib_close_ca
\r
783 * Closes an opened channel adapter. Once closed, no further access to this
\r
784 * channel adapter is possible.
\r
788 AL_EXPORT ib_api_status_t AL_API
\r
790 IN const ib_ca_handle_t h_ca,
\r
791 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
795 * [in] A handle to an opened channel adapter.
\r
798 * [in] A user-specified callback that is invoked after the channel
\r
799 * adapter has been successfully destroyed.
\r
803 * The close request was registered.
\r
805 * IB_INVALID_CA_HANDLE
\r
806 * The channel adapter handle was invalid.
\r
809 * This call closes the opened channel adapter and frees all associated
\r
810 * resources, such as queue pairs, protection domains, and completion
\r
811 * queues. Since callbacks may be outstanding against the channel adapter
\r
812 * or one of its resources at the time the close operation is invoked, this
\r
813 * call operates asynchronously. The user will be notified through a callback
\r
814 * once the close operation completes, indicating that no additional callbacks
\r
815 * will be invoked for the specified channel adapter or a related resource.
\r
822 /****f* Access Layer/ib_alloc_pd
\r
827 * Allocates a protection domain on the specified channel adapter.
\r
831 AL_EXPORT ib_api_status_t AL_API
\r
833 IN const ib_ca_handle_t h_ca,
\r
834 IN const ib_pd_type_t pd_type,
\r
835 IN const void* const pd_context,
\r
836 OUT ib_pd_handle_t* const ph_pd );
\r
840 * [in] A handle to an opened channel adapter.
\r
843 * [in] Indicates the type of protection domain being created.
\r
846 * [in] A client-specified context to associate with this allocated
\r
847 * protection domain. This context is returned to the user when
\r
848 * invoking asynchronous callbacks referencing this protection domain.
\r
851 * [out] Upon successful completion of this call, this references a
\r
852 * handle to the allocated protection domain.
\r
856 * The operation was successful.
\r
858 * IB_INVALID_CA_HANDLE
\r
859 * The channel adapter handle was invalid.
\r
861 * IB_INVALID_PARAMETER
\r
862 * The supplied pd_type value is invalid or a reference to the protection
\r
863 * domain handle was not provided.
\r
865 * IB_INSUFFICIENT_MEMORY
\r
866 * There was insufficient memory to allocate the protection domain.
\r
868 * IB_INSUFFICIENT_RESOURCES
\r
869 * There were insufficient resources currently available on the channel
\r
870 * adapter to create the protection domain.
\r
873 * When successful, this routine returns a handle to a newly allocated
\r
874 * protection domain.
\r
877 * ib_dealloc_pd, ib_pd_type_t
\r
881 /****f* Access Layer/ib_dealloc_pd
\r
886 * Deallocates a protection domain.
\r
890 AL_EXPORT ib_api_status_t AL_API
\r
892 IN const ib_pd_handle_t h_pd,
\r
893 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
897 * [in] A handle to an allocated protection domain.
\r
900 * [in] A user-specified callback that is invoked after the protection
\r
901 * domain has been successfully destroyed.
\r
905 * The operation was successful.
\r
907 * IB_INVALID_PD_HANDLE
\r
908 * The protection domain handle was invalid.
\r
911 * This call deallocates a protection domain and releases all associated
\r
912 * resources, including queue pairs and registered memory regions. Since
\r
913 * callbacks may be outstanding against one of protection domain's related
\r
914 * resources at the time the deallocation call is invoked, this call operates
\r
915 * asynchronously. The user will be notified through a callback once the
\r
916 * deallocation call completes, indicating that no additional callbacks
\r
917 * will be invoked for a related resource.
\r
924 /****f* Access Layer/ib_create_av
\r
929 * Creates an address vector.
\r
933 AL_EXPORT ib_api_status_t AL_API
\r
935 IN const ib_pd_handle_t h_pd,
\r
936 IN const ib_av_attr_t* const p_av_attr,
\r
937 OUT ib_av_handle_t* const ph_av );
\r
941 * [in] A handle to an allocated protection domain that the address
\r
942 * vector will be associated with.
\r
945 * [in] Attributes for the newly created address vector.
\r
948 * [out] Upon successful completion of this call, this references a
\r
949 * handle to the newly created address vector.
\r
953 * The operation was successful.
\r
955 * IB_INVALID_PD_HANDLE
\r
956 * The protection domain handle was invalid.
\r
958 * IB_INVALID_PARAMETER
\r
959 * A reference to the address vector attributes or handle was not
\r
962 * IB_INSUFFICIENT_MEMORY
\r
963 * There was insufficient memory to create the address vector.
\r
966 * The port number supplied, through the address vector attributes,
\r
967 * was invalid for the given channel adapter.
\r
969 * IB_INSUFFICIENT_RESOURCES
\r
970 * There were insufficient resources currently available on the channel
\r
971 * adapter to create the address vector.
\r
974 * This routine creates an address vector. Clients specify the attributes
\r
975 * of the address vector through the p_av_attr parameter.
\r
978 * ib_query_av, ib_modify_av, ib_destroy_av
\r
982 /****f* Access Layer/ib_query_av
\r
987 * Returns the attributes of an address vector.
\r
991 AL_EXPORT ib_api_status_t AL_API
\r
993 IN const ib_av_handle_t h_av,
\r
994 OUT ib_av_attr_t* const p_av_attr,
\r
995 OUT ib_pd_handle_t* const ph_pd );
\r
999 * [in] A handle to an existing address vector.
\r
1002 * [out] Upon successful completion, the structure referenced by this
\r
1003 * parameter contains the attributes of the specified address vector.
\r
1006 * [out] Upon successful completion, this references a handle to the
\r
1007 * protection domain associated with the address vector.
\r
1011 * The attributes were returned successfully.
\r
1013 * IB_INVALID_AV_HANDLE
\r
1014 * The address vector handle was invalid.
\r
1016 * IB_INVALID_PARAMETER
\r
1017 * A reference to the address vector attributes structure or protection
\r
1018 * domain handle was not provided.
\r
1021 * ib_create_av, ib_modify_av, ib_destroy_av, ib_av_attr_t
\r
1025 /****f* Access Layer/ib_modify_av
\r
1030 * Modifies the attributes of an existing address vector.
\r
1034 AL_EXPORT ib_api_status_t AL_API
\r
1036 IN const ib_av_handle_t h_av,
\r
1037 IN const ib_av_attr_t* const p_av_attr );
\r
1041 * [in] A handle to an existing address vector.
\r
1044 * [in] The new attributes to use when modifying the address vector.
\r
1048 * The address vector was successfully modified.
\r
1050 * IB_INVALID_AV_HANDLE
\r
1051 * The address vector handle was invalid.
\r
1053 * IB_INVALID_PARAMETER
\r
1054 * A reference to the address vector attributes structure was not
\r
1058 * The port number supplied, through the address vector attributes,
\r
1059 * was invalid for the given channel adapter.
\r
1062 * This routine modifies the attributes of an existing address vector.
\r
1063 * The new attributes are specified through the p_av_attr parameter.
\r
1066 * ib_create_av, ib_destroy_av
\r
1070 /****f* Access Layer/ib_destroy_av
\r
1075 * Destroys an existing address vector.
\r
1079 AL_EXPORT ib_api_status_t AL_API
\r
1081 IN const ib_av_handle_t h_av );
\r
1085 * [in] A handle to an existing address vector.
\r
1089 * The address vector was successfully destroyed.
\r
1091 * IB_INVALID_AV_HANDLE
\r
1092 * The address vector handle was invalid.
\r
1095 * This routine destroys an existing address vector.
\r
1102 /****f* Access Layer/ib_create_srq
\r
1107 * Creates a shared receive queue and returns its handle to the user.
\r
1111 AL_EXPORT ib_api_status_t AL_API
\r
1113 IN const ib_pd_handle_t h_pd,
\r
1114 IN const ib_srq_attr_t* const p_srq_attr,
\r
1115 IN const void* const srq_context,
\r
1116 IN const ib_pfn_event_cb_t pfn_srq_event_cb OPTIONAL,
\r
1117 OUT ib_srq_handle_t* const ph_srq );
\r
1121 * [in] This is a handle to a protection domain associated with the shared queue
\r
1125 * [in] Attributes necessary to allocate and initialize a shared receive queue.
\r
1128 * [in] A user-specified context information associated with the shared
\r
1132 * [in] User-specified error callback routine invoked after an
\r
1133 * asynchronous event has occurred on the shared receive queue.
\r
1136 * [out] Upon successful completion of this call, this references a
\r
1137 * handle to the newly created shared receive queue.
\r
1141 * The receive queue was successfully created.
\r
1143 * IB_INVALID_PD_HANDLE
\r
1144 * The protection domain to associate with the shared receive queue was invalid.
\r
1146 * IB_INVALID_PARAMETER
\r
1147 * A reference to the shared receive queue attributes or handle was not provided.
\r
1149 * IB_INSUFFICIENT_MEMORY
\r
1150 * There was insufficient memory to create the shared receive queue.
\r
1152 * IB_INSUFFICIENT_RESOURCES
\r
1153 * There were insufficient resources currently available on the channel
\r
1154 * adapter to create the shared receive queue.
\r
1156 * IB_INVALID_SETTING
\r
1157 * The specified shared receive queue creation attributes are invalid.
\r
1159 * IB_INVALID_MAX_WRS
\r
1160 * The requested maximum send or receive work request depth could not be
\r
1163 * IB_INVALID_MAX_SGE
\r
1164 * The requested maximum number of scatter-gather entries for the send or
\r
1165 * receive queue could not be supported.
\r
1168 * This routine allocates a shared receive queue with the specified attributes. If
\r
1169 * the shared receive queue cannot be allocated, an error is returned. When creating
\r
1170 * the shared receive queue, users associate a context with the shared receive queue. This
\r
1171 * context is returned to the user through the asynchronous event callback
\r
1172 * if an event occurs.
\r
1174 * This routine is used to create receive queues, which work with QPs of type:
\r
1176 * IB_QPT_RELIABLE_CONN
\r
1177 * IB_QPT_UNRELIABLE_CONN
\r
1178 * IB_QPT_UNRELIABLE_DGRM
\r
1181 * ib_query_srq, ib_modify_srq, ib_destroy_srq, ib_srq_attr_t,
\r
1182 * ib_srq_attr_mask_t, ib_pfn_event_cb_t, ib_qp_attr_t
\r
1186 /****f* Access Layer/ib_query_srq
\r
1191 * Query the current attributes of the shared receive queue.
\r
1195 AL_EXPORT ib_api_status_t AL_API
\r
1197 IN const ib_srq_handle_t h_srq,
\r
1198 OUT ib_srq_attr_t* const p_srq_attr );
\r
1202 * [in] A handle to an existing shared receive queue.
\r
1205 * [out] Upon successful completion of this call, the structure
\r
1206 * referenced by this parameter contains the attributes of the specified
\r
1211 * The shared receive queue attributes were returned successfully.
\r
1213 * IB_INVALID_SRQ_HANDLE
\r
1214 * The shared receive queue handle was invalid.
\r
1216 * IB_INVALID_PARAMETER
\r
1217 * A reference to the shared receive queue attributes structure was not provided.
\r
1220 * This routine returns information about the specified shared receive queue.
\r
1223 * ib_query_srq, ib_modify_srq, ib_destroy_srq, ib_srq_attr_t,
\r
1224 * ib_srq_attr_mask_t, ib_pfn_event_cb_t, ib_qp_attr_t
\r
1228 /****f* Access Layer/ib_modify_srq
\r
1233 * Modifies the attributes of an existing shared receive queue.
\r
1237 AL_EXPORT ib_api_status_t AL_API
\r
1239 IN const ib_srq_handle_t h_srq,
\r
1240 IN const ib_srq_attr_t* const p_srq_attr,
\r
1241 IN const ib_srq_attr_mask_t srq_attr_mask );
\r
1245 * [in] A handle to an existing shared receive queue.
\r
1248 * [in] Attributes necessary to allocate and initialize a shared receive queue.
\r
1251 * [in] Flags, indicating which fields in the previous structure are valid.
\r
1255 * The shared receive queue was successfully modified.
\r
1257 * IB_INVALID_SRQ_HANDLE
\r
1258 * The shared receive queue handle was invalid.
\r
1260 * IB_INVALID_PARAMETER
\r
1261 * A reference to the shared receive queue attributes was not provided.
\r
1263 * IB_INVALID_SETTING
\r
1264 * The specified shared receive queue attributes were invalid.
\r
1267 * The required action is not supported yet.
\r
1269 * IB_INSUFFICIENT_RESOURCES
\r
1270 * There were insufficient resources currently available on the channel
\r
1271 * adapter to register the modify the shared receive queue.
\r
1274 * This routine modifies the attributes of an existing shared receive queue and
\r
1275 * transitions it to a new state. The new state and attributes are
\r
1276 * specified through the p_qp_mod parameter. Upon successful completion,
\r
1277 * the shared receive queue is in the requested state.
\r
1280 * ib_query_srq, ib_modify_srq, ib_destroy_srq, ib_srq_attr_t,
\r
1281 * ib_srq_attr_mask_t, ib_pfn_event_cb_t, ib_qp_attr_t
\r
1285 /****f* Access Layer/ib_destroy_srq
\r
1290 * Release a shared receive queue. Once destroyed, no further access to this
\r
1291 * shared receive queue is possible.
\r
1295 AL_EXPORT ib_api_status_t AL_API
\r
1297 IN const ib_srq_handle_t h_srq,
\r
1298 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
1302 * [in] A handle to an existing shared shared receive queue.
\r
1305 * [in] A user-specified callback that is invoked after the shared receive queue
\r
1306 * has been successfully destroyed.
\r
1310 * The destroy request was registered.
\r
1312 * IB_INVALID_SRQ_HANDLE
\r
1313 * The shared receive queue handle was invalid.
\r
1315 * IB_RESOURCE_BUSY
\r
1316 * There are QPs, bound to the shared receive queue
\r
1319 * This call destroys an existing shared receive queue. Since callbacks may be
\r
1320 * outstanding against the shared receive queue at the time the destroy operation is
\r
1321 * invoked, then this call operates asynchronously. The user will be notified
\r
1322 * through a callback once the destroy operation completes, indicating that
\r
1323 * no additional callbacks will be invoked for the specified shared receive queue.
\r
1326 * ib_query_srq, ib_modify_srq, ib_destroy_srq, ib_srq_attr_t,
\r
1327 * ib_srq_attr_mask_t, ib_pfn_event_cb_t, ib_qp_attr_t
\r
1331 /****f* Access Layer/ib_post_srq_recv
\r
1333 * ib_post_srq_recv
\r
1336 * This routine posts a work request to the shared receive queue of a shared receive queue.
\r
1340 AL_EXPORT ib_api_status_t AL_API
\r
1342 IN const ib_srq_handle_t h_srq,
\r
1343 IN ib_recv_wr_t* const p_recv_wr,
\r
1344 OUT ib_recv_wr_t **pp_recv_failure OPTIONAL );
\r
1348 * [in] The shared receive queue to which this work request is being submitted.
\r
1351 * [in] A reference to the head of the work request list.
\r
1354 * [out] If the post receive operation failed, this references the work
\r
1355 * request in the p_recv_wr list where the first failure occurred.
\r
1356 * This parameter may be NULL if only a single work request is being
\r
1357 * posted to the QP.
\r
1361 * All work requests were successfully posted.
\r
1363 * IB_INVALID_QP_HANDLE
\r
1364 * The shared receive queue handle was invalid.
\r
1366 * IB_INVALID_PARAMETER
\r
1367 * A reference to the receive work request list was not provided.
\r
1369 * IB_INSUFFICIENT_RESOURCES
\r
1370 * The number of posted work requests exceed the current depth available
\r
1371 * on the receive queue.
\r
1373 * IB_INVALID_WR_TYPE
\r
1374 * The work request type was invalid.
\r
1376 * IB_INVALID_QP_STATE
\r
1377 * The current shared receive queue state does not allow posting receives.
\r
1380 * This routine posts a work request to the shared receive queue.
\r
1381 * The type of work to perform is defined by the p_recv_wr parameter. This
\r
1382 * call is used to post data buffers to receive incoming message sends.
\r
1389 /****f* Access Layer/ib_create_qp
\r
1394 * Creates a queue pair and returns its handle to the user.
\r
1398 AL_EXPORT ib_api_status_t AL_API
\r
1400 IN const ib_pd_handle_t h_pd,
\r
1401 IN const ib_qp_create_t* const p_qp_create,
\r
1402 IN const void* const qp_context,
\r
1403 IN const ib_pfn_event_cb_t pfn_qp_event_cb OPTIONAL,
\r
1404 OUT ib_qp_handle_t* const ph_qp );
\r
1408 * [in] This is a handle to a protection domain associated with the queue
\r
1412 * [in] Attributes necessary to allocate and initialize the queue pair.
\r
1415 * [in] A user-specified context information associated with the
\r
1419 * [in] User-specified error callback routine invoked after an
\r
1420 * asynchronous event has occurred on the queue pair.
\r
1423 * [out] Upon successful completion of this call, this references a
\r
1424 * handle to the newly created queue pair.
\r
1428 * The queue pair was successfully created.
\r
1430 * IB_INVALID_PD_HANDLE
\r
1431 * The protection domain to associate with the queue pair was invalid.
\r
1433 * IB_INVALID_PARAMETER
\r
1434 * A reference to the queue pair attributes or handle was not provided.
\r
1436 * IB_INSUFFICIENT_MEMORY
\r
1437 * There was insufficient memory to create the queue pair.
\r
1439 * IB_INSUFFICIENT_RESOURCES
\r
1440 * There were insufficient resources currently available on the channel
\r
1441 * adapter to create the queue pair.
\r
1443 * IB_INVALID_CQ_HANDLE
\r
1444 * The send or receive completion queue to associate with the queue pair
\r
1447 * IB_INVALID_SRQ_HANDLE
\r
1448 * The shared receive queue to be associated with the queue pair
\r
1451 * IB_INVALID_SETTING
\r
1452 * The specified queue pair creation attributes are invalid.
\r
1455 * The specified queue pair type was not supported by the channel adapter.
\r
1457 * IB_INVALID_MAX_WRS
\r
1458 * The requested maximum send or receive work request depth could not be
\r
1461 * IB_INVALID_MAX_SGE
\r
1462 * The requested maximum number of scatter-gather entries for the send or
\r
1463 * receive queue could not be supported.
\r
1466 * 1. This routine allocates a queue pair with the specified attributes. If
\r
1467 * the queue pair cannot be allocated, an error is returned. When creating
\r
1468 * the queue pair, users associate a context with the queue pair. This
\r
1469 * context is returned to the user through the asynchronous event callback
\r
1470 * if an event occurs.
\r
1472 * 2. For QPs that are associated with an SRQ, the Consumer should take
\r
1473 * the QP through the Error State before invoking a Destroy QP or a Modify
\r
1474 * QP to the Reset State. The Consumer may invoke the Destroy QP without
\r
1475 * first performing a Modify QP to the Error State and waiting for the Affiliated
\r
1476 * Asynchronous Last WQE Reached Event. However, if the Consumer
\r
1477 * does not wait for the Affiliated Asynchronous Last WQE Reached Event,
\r
1478 * then WQE and Data Segment leakage may occur.
\r
1480 * 3. This routine is used to create queue pairs of type:
\r
1481 * IB_QPT_RELIABLE_CONN
\r
1482 * IB_QPT_UNRELIABLE_CONN
\r
1483 * IB_QPT_UNRELIABLE_DGRM
\r
1486 * 4. Callers of ib_create_qp should call ib_init_dgrm_svc if the queue pair
\r
1487 * is of type IB_QPT_UNRELIABLE_DGRM or IB_QPT_MAD before sending or
\r
1488 * receiving data. IB_QPT_RELIABLE_CONN, IB_QPT_UNRELIABLE_CONN type
\r
1489 * queue pairs should be used by the connection establishment process
\r
1490 * before data may be sent or received on the QP.
\r
1492 * This call does not return the QP attributes as MAD QPs do not support
\r
1493 * such an operation. This is a minor specification deviation.
\r
1496 * ib_query_qp, ib_modify_qp, ib_destroy_qp, ib_cm_req, ib_cm_rep, ib_cm_rtu
\r
1497 * ib_init_dgrm_svc, ib_qp_create_t, ib_pfn_event_cb_t, ib_qp_attr_t
\r
1501 /****f* Access Layer/ib_get_spl_qp
\r
1506 * Create a special QP or QP alias. This call provides access to queue
\r
1507 * pairs 0 and 1, and the raw queue pair types.
\r
1511 AL_EXPORT ib_api_status_t AL_API
\r
1513 IN const ib_pd_handle_t h_pd,
\r
1514 IN const ib_net64_t port_guid,
\r
1515 IN const ib_qp_create_t* const p_qp_create,
\r
1516 IN const void* const qp_context,
\r
1517 IN const ib_pfn_event_cb_t pfn_qp_event_cb OPTIONAL,
\r
1518 OUT ib_pool_key_t* const p_pool_key OPTIONAL,
\r
1519 OUT ib_qp_handle_t* const ph_qp );
\r
1523 * [in] This is a handle to a protection domain associated with the queue
\r
1524 * pair. This must be a protection domain alias for aliased QP types.
\r
1527 * [in] The port GUID that the special QP will be associated with.
\r
1530 * [in] Attributes necessary to allocate and initialize the queue pair.
\r
1533 * [in] A user-specified context information associated with the
\r
1536 * pfn_qp_ervent_cb
\r
1537 * [in] User-specified error callback routine invoked after an
\r
1538 * asynchronous event has occurred on the queue pair.
\r
1541 * [in] A key to a pool of MAD elements that are used to send MADs.
\r
1542 * This key is only valid for aliased QP types.
\r
1545 * [out] Upon successful completion of this call, this references a
\r
1546 * handle to the newly created queue pair.
\r
1550 * The queue pair was successfully created.
\r
1552 * IB_INVALID_PD_HANDLE
\r
1553 * The protection domain to associate with the queue pair was invalid.
\r
1556 * The port number supplied was invalid for the given channel adapter.
\r
1558 * IB_INVALID_PARAMETER
\r
1559 * A reference to the queue pair attributes or handle was not provided.
\r
1561 * IB_INVALID_PERMISSION
\r
1562 * The calling process does not have sufficient privilege to create the
\r
1563 * requested queue pair type.
\r
1565 * IB_INSUFFICIENT_MEMORY
\r
1566 * There was insufficient memory to create the queue pair.
\r
1568 * IB_INSUFFICIENT_RESOURCES
\r
1569 * There were insufficient resources currently available on the channel
\r
1570 * adapter to create the queue pair.
\r
1572 * IB_INVALID_CQ_HANDLE
\r
1573 * The send or receive completion queue to associate with the queue pair
\r
1576 * IB_INVALID_SETTING
\r
1577 * The specified queue pair type was invalid.
\r
1580 * The specified queue pair type was not supported by the channel adapter.
\r
1582 * IB_INVALID_MAX_WRS
\r
1583 * The requested maximum send or receive work request depth could not be
\r
1586 * IB_INVALID_MAX_SGE
\r
1587 * The requested maximum number of scatter-gather entries for the send or
\r
1588 * receive queue could not be supported.
\r
1591 * This routine allocates a queue pair with the specified attributes. If
\r
1592 * the queue pair cannot be allocated, an error is returned. When creating
\r
1593 * the queue pair, users associate a context with the queue pair. This
\r
1594 * context is returned to the user through the asynchronous event callback
\r
1595 * if an event occurs.
\r
1597 * This routine is used to create queue pairs of type:
\r
1602 * IB_QPT_RAW_ETHER
\r
1603 * IB_QPT_QP0_ALIAS
\r
1604 * IB_QPT_QP1_ALIAS
\r
1606 * Callers of ib_get_spl_qp should call ib_init_dgrm_svc if the queue pair is
\r
1607 * of type IB_QPT_QP0, IB_QPT_QP1, IB_QPT_RAW_IPV6, IB_QPT_RAW_ETHER before
\r
1608 * sending or receiving data. MADs may be sent on aliased QPs on the
\r
1609 * successful return of this routine.
\r
1612 * ib_query_qp, ib_modify_qp, ib_destroy_qp, ib_get_mad
\r
1613 * ib_init_dgrm_svc, ib_qp_create_t, ib_pfn_event_cb_t, ib_qp_attr_t
\r
1617 /****f* Access Layer/ib_query_qp
\r
1622 * Query the current attributes of the queue pair.
\r
1626 AL_EXPORT ib_api_status_t AL_API
\r
1628 IN const ib_qp_handle_t h_qp,
\r
1629 OUT ib_qp_attr_t* const p_qp_attr );
\r
1633 * [in] A handle to an existing queue pair.
\r
1636 * [out] Upon successful completion of this call, the structure
\r
1637 * referenced by this parameter contains the attributes of the specified
\r
1642 * The queue pair attributes were returned successfully.
\r
1644 * IB_INVALID_QP_HANDLE
\r
1645 * The queue pair handle was invalid.
\r
1647 * IB_INVALID_PARAMETER
\r
1648 * A reference to the queue pair attributes structure was not provided.
\r
1651 * This routine returns information about the specified queue pair.
\r
1654 * ib_create_qp, ib_modify_qp, ib_qp_attr_t
\r
1658 /****f* Access Layer/ib_modify_qp
\r
1663 * Modifies the attributes of an existing queue pair.
\r
1667 AL_EXPORT ib_api_status_t AL_API
\r
1669 IN const ib_qp_handle_t h_qp,
\r
1670 IN const ib_qp_mod_t* const p_qp_mod );
\r
1674 * [in] A handle to an existing queue pair.
\r
1677 * [in] The new attributes to use when modifying the queue pair.
\r
1681 * The queue pair was successfully modified.
\r
1683 * IB_INVALID_QP_HANDLE
\r
1684 * The queue pair handle was invalid.
\r
1686 * IB_INVALID_PARAMETER
\r
1687 * A reference to the queue pair attributes was not provided.
\r
1689 * IB_INVALID_SETTING
\r
1690 * The specified queue pair attributes were invalid.
\r
1692 * IB_INSUFFICIENT_RESOURCES
\r
1693 * There were insufficient resources currently available on the channel
\r
1694 * adapter to register the modify the queue pair.
\r
1697 * The requested modification was not supported.
\r
1699 * IB_INVALID_QP_STATE
\r
1700 * The queue pair was in an invalid state for the requested operation.
\r
1703 * The specified pkey was not valid.
\r
1705 * IB_INVALID_APM_STATE
\r
1706 * The specified automatic path migration state was not valid.
\r
1709 * This routine modifies the attributes of an existing queue pair and
\r
1710 * transitions it to a new state. The new state and attributes are
\r
1711 * specified through the p_qp_mod parameter. Upon successful completion,
\r
1712 * the queue pair is in the requested state.
\r
1715 * ib_create_qp, ib_destroy_qp, ib_qp_mod_t
\r
1719 /****f* Access Layer/ib_destroy_qp
\r
1724 * Release a queue pair. Once destroyed, no further access to this
\r
1725 * queue pair is possible.
\r
1729 AL_EXPORT ib_api_status_t AL_API
\r
1731 IN const ib_qp_handle_t h_qp,
\r
1732 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
1736 * [in] A handle to an existing queue pair.
\r
1739 * [in] A user-specified callback that is invoked after the queue pair
\r
1740 * has been successfully destroyed.
\r
1744 * The destroy request was registered.
\r
1746 * IB_INVALID_QP_HANDLE
\r
1747 * The queue pair handle was invalid.
\r
1750 * This call destroys an existing queue pair. Since callbacks may be
\r
1751 * outstanding against the queue pair at the time the destroy operation is
\r
1752 * invoked, the this call operates asynchronously. The user will be notified
\r
1753 * through a callback once the destroy operation completes, indicating that
\r
1754 * no additional callbacks will be invoked for the specified queue pair.
\r
1761 /****s* Access Layer/ib_cq_create_t
\r
1766 * Attributes used to initialize a completion queue at creation time.
\r
1770 typedef struct _ib_cq_create
\r
1773 ib_pfn_comp_cb_t pfn_comp_cb;
\r
1774 cl_waitobj_handle_t h_wait_obj;
\r
1780 * Specifies the maximum number of work completions that may be on the
\r
1781 * completion queue. If the creation call is successful, the actual
\r
1782 * size of the completion queue will be returned. The actual size of
\r
1783 * the CQ will be greater than or equal to the requested size.
\r
1786 * A callback that is invoked whenever a signaled completion occurs on
\r
1787 * the completion queue. This field is mutually exclusive with the
\r
1791 * A wait object that is triggered whenever a signaled completion occurs
\r
1792 * on the completion queue. This field is mutually exclusive with the
\r
1793 * pfn_comp_cb field and is only valid for user-mode clients. The wait
\r
1794 * object must be ready for use when the call to ib_create_cq is invoked.
\r
1797 * Clients must specify either an event or a callback when creating a
\r
1798 * completion queue. When a signaled completion occurs on the completion
\r
1799 * queue, the client will be notified through the callback or by
\r
1800 * signaling the specified event.
\r
1803 * ib_create_cq, ib_pfn_comp_cb_t
\r
1807 /****f* Access Layer/ib_create_cq
\r
1812 * Creates a completion queue and returns its handle to the user.
\r
1816 AL_EXPORT ib_api_status_t AL_API
\r
1818 IN const ib_ca_handle_t h_ca,
\r
1819 IN OUT ib_cq_create_t* const p_cq_create,
\r
1820 IN const void* const cq_context,
\r
1821 IN const ib_pfn_event_cb_t pfn_cq_event_cb OPTIONAL,
\r
1822 OUT ib_cq_handle_t* const ph_cq );
\r
1826 * [in] A handle to an open channel adapter.
\r
1829 * [in] Attributes necessary to allocate and initialize the
\r
1830 * completion queue.
\r
1833 * [in] A user-specified context associated with the completion queue.
\r
1836 * [in] User-specified error callback routine invoked after an
\r
1837 * asynchronous event has occurred on the completion queue.
\r
1840 * [out] Upon successful completion of this call, this references a
\r
1841 * handle to the newly created completion queue.
\r
1845 * The completion queue was successfully created.
\r
1847 * IB_INVALID_CA_HANDLE
\r
1848 * The channel adapter handle was invalid.
\r
1850 * IB_INVALID_PARAMETER
\r
1851 * A reference to the completion queue attributes or handle was not
\r
1854 * IB_INVALID_SETTING
\r
1855 * The specified attributes that should be used to create the completion
\r
1856 * queue are invalid. Both completion callback and wait object
\r
1857 * information were supplied or are missing.
\r
1859 * IB_INSUFFICIENT_MEMORY
\r
1860 * There was insufficient memory to create the completion queue.
\r
1862 * IB_INSUFFICIENT_RESOURCES
\r
1863 * There were insufficient resources currently available on the channel
\r
1864 * adapter to create the completion queue.
\r
1866 * IB_INVALID_CQ_SIZE
\r
1867 * The requested size of the completion queue was larger than the
\r
1868 * maximum supported by the associated channel adapter.
\r
1871 * This routine allocates a completion queue on the specified channel
\r
1872 * adapter. If the completion queue cannot be allocated, an error is
\r
1873 * returned. When creating the completion queue, users associate a context
\r
1874 * with the completion queue. This context is returned to the user through
\r
1875 * the completion and asynchronous event callbacks.
\r
1878 * ib_query_cq, ib_modify_cq, ib_destroy_cq, ib_cq_create_t, ib_pfn_event_cb_t
\r
1882 /****f* Access Layer/ib_modify_cq
\r
1887 * Modifies the attributes associated with a completion queue, allowing the
\r
1888 * completion queue to be resized.
\r
1892 AL_EXPORT ib_api_status_t AL_API
\r
1894 IN const ib_cq_handle_t h_cq,
\r
1895 IN OUT uint32_t* const p_size );
\r
1899 * [in] A handle to an existing completion queue.
\r
1902 * [in/out] Specifies the new size of the completion queue. If the
\r
1903 * modify call is successful, the actual size of the completion queue
\r
1904 * will be returned. The actual size of the CQ will be greater than or
\r
1905 * equal to the requested size.
\r
1909 * The completion queue was successfully modified.
\r
1911 * IB_INVALID_CQ_HANDLE
\r
1912 * The completion queue handle was invalid.
\r
1914 * IB_INVALID_PARAMETER
\r
1915 * A reference to the completion queue size was not provided.
\r
1917 * IB_INVALID_CQ_SIZE
\r
1918 * The requested size of the completion queue was larger than the
\r
1919 * maximum supported by the associated channel adapter.
\r
1922 * The specified size of the completion queue is smaller than the number
\r
1923 * of work completions currently on the completion queue.
\r
1925 * IB_INSUFFICIENT_MEMORY
\r
1926 * There was insufficient memory to modify the completion queue.
\r
1929 * This routine allows a client to modify the size of a completion queue.
\r
1930 * If the new size is larger than what the associated channel adapter can
\r
1931 * support, an error is returned. If the completion queue has valid
\r
1932 * completion entries on it and the requested size is smaller than the
\r
1933 * number of entries, an overflow error is returned and the modify
\r
1934 * operation is aborted.
\r
1941 /****f* Access Layer/ib_query_cq
\r
1946 * Returns information about the specified completion queue.
\r
1950 AL_EXPORT ib_api_status_t AL_API
\r
1952 IN const ib_cq_handle_t h_cq,
\r
1953 OUT uint32_t* const p_size );
\r
1957 * [in] A handle to an existing completion queue.
\r
1960 * [out] Upon successful completion of this call, contains the actual
\r
1961 * size of the completion queue.
\r
1965 * The completion queue was successfully queried.
\r
1967 * IB_INVALID_CQ_HANDLE
\r
1968 * The completion queue handle was invalid.
\r
1970 * IB_INVALID_PARAMETER
\r
1971 * A reference to the completion queue size was not provided.
\r
1978 /****f* Access Layer/ib_destroy_cq
\r
1983 * Destroys a completion queue. Once destroyed, no further access to the
\r
1984 * completion queue is possible.
\r
1988 AL_EXPORT ib_api_status_t AL_API
\r
1990 IN const ib_cq_handle_t h_cq,
\r
1991 IN const ib_pfn_destroy_cb_t pfn_destroy_cb OPTIONAL );
\r
1995 * [in] A handle to an existing completion queue.
\r
1998 * [in] A user-provided callback that is invoked after the
\r
1999 * completion queue has been successfully destroyed.
\r
2003 * The destroy request was registered.
\r
2005 * IB_INVALID_CQ_HANDLE
\r
2006 * The completion queue handle was invalid.
\r
2009 * This call destroys an existing completion queue. Since callbacks may be
\r
2010 * outstanding against the completion queue at the time the destroy operation
\r
2011 * is invoked, the this call operates asynchronously. The user will be
\r
2012 * notified through a callback once the destroy operation completes,
\r
2013 * indicating that no additional callbacks will be invoked for the specified
\r
2014 * completion queue.
\r
2016 * If there are still queue pairs associated with the completion queue when
\r
2017 * this function is invoked, the destroy operation will fail with status
\r
2018 * IB_RESOURCE_BUSY.
\r
2021 * ib_create_cq, ib_pfn_destroy_cb_t
\r
2025 /****f* Access Layer/ib_reg_mem
\r
2030 * Registers a virtual memory region with a channel adapter.
\r
2034 AL_EXPORT ib_api_status_t AL_API
\r
2036 IN const ib_pd_handle_t h_pd,
\r
2037 IN const ib_mr_create_t* const p_mr_create,
\r
2038 OUT net32_t* const p_lkey,
\r
2039 OUT net32_t* const p_rkey,
\r
2040 OUT ib_mr_handle_t* const ph_mr );
\r
2044 * [in] A handle to an existing protection domain that the memory
\r
2045 * should be registered with.
\r
2048 * [in] Information describing the memory region to register.
\r
2051 * [out] The local access key associated with this registered memory
\r
2055 * [out] A key that may be used by a remote end-point when performing
\r
2056 * RDMA or atomic operations to this registered memory region.
\r
2059 * [out] Upon successful completion of this call, this references a
\r
2060 * handle to the registered memory region. This handle is used when
\r
2061 * performing data transfers and to deregister the memory.
\r
2065 * The memory region was successfully registered.
\r
2067 * IB_INVALID_PD_HANDLE
\r
2068 * The protection domain to associate with the memory region was invalid.
\r
2070 * IB_INVALID_PARAMETER
\r
2071 * A reference to the memory region information, lkey, rkey, or handle
\r
2072 * was not provided.
\r
2074 * IB_INSUFFICIENT_MEMORY
\r
2075 * There was insufficient memory to register the memory region.
\r
2077 * IB_INSUFFICIENT_RESOURCES
\r
2078 * There were insufficient resources currently available on the channel
\r
2079 * adapter to register the memory region.
\r
2082 * The requested access rights are not supported by the channel adapter.
\r
2084 * IB_INVALID_PERMISSION
\r
2085 * The requested access rights are invalid.
\r
2088 * This routine registers a virtual memory region with a channel adapter.
\r
2089 * Memory must be registered before being used in a data transfer operation.
\r
2092 * ib_dereg_mr, ib_reg_phys, ib_reg_shared, ib_mr_create_t
\r
2096 /****f* Access Layer/ib_reg_phys
\r
2101 * Registers a physical memory region with a channel adapter.
\r
2105 AL_EXPORT ib_api_status_t AL_API
\r
2107 IN const ib_pd_handle_t h_pd,
\r
2108 IN const ib_phys_create_t* const p_phys_create,
\r
2109 IN OUT uint64_t* const p_vaddr,
\r
2110 OUT net32_t* const p_lkey,
\r
2111 OUT net32_t* const p_rkey,
\r
2112 OUT ib_mr_handle_t* const ph_mr );
\r
2116 * [in] A handle to an existing protection domain that the memory
\r
2117 * should be registered with.
\r
2120 * [in] Information describing the memory region to register.
\r
2123 * [in/out] On input, references the requested virtual address for the
\r
2124 * start of the physical region. On output, references the actual
\r
2125 * virtual address assigned to the registered region.
\r
2128 * [out] The local access key associated with this registered memory
\r
2132 * [out] A key that may be used by a remote end-point when performing
\r
2133 * RDMA or atomic operations to this registered memory region.
\r
2136 * [out] Upon successful completion of this call, this references a
\r
2137 * handle to the registered memory region. This handle is used when
\r
2138 * performing data transfers and to deregister the memory.
\r
2142 * The physical memory region was successfully registered.
\r
2144 * IB_INVALID_PD_HANDLE
\r
2145 * The protection domain to associate with the physical memory region
\r
2148 * IB_INVALID_PARAMETER
\r
2149 * A reference to the physical memory region information, virtual address,
\r
2150 * lkey, rkey, or handle was not provided.
\r
2152 * IB_INSUFFICIENT_MEMORY
\r
2153 * There was insufficient memory to register the physical memory region.
\r
2155 * IB_INSUFFICIENT_RESOURCES
\r
2156 * There were insufficient resources currently available on the channel
\r
2157 * adapter to register the physical memory region.
\r
2160 * The requested access rights are not supported by the channel adapter.
\r
2162 * IB_INVALID_PERMISSION
\r
2163 * The requested access rights are invalid.
\r
2166 * This routine registers an array of physical pages as a single virtually
\r
2167 * contiguous region with a channel adapter. Memory must be registered
\r
2168 * before being used in a data transfer operation.
\r
2171 * ib_dereg_mr, ib_reg_mem, ib_reg_shared, ib_phys_create_t
\r
2175 /****f* Access Layer/ib_query_mr
\r
2180 * Query the current attributes of a memory region.
\r
2184 AL_EXPORT ib_api_status_t AL_API
\r
2186 IN const ib_mr_handle_t h_mr,
\r
2187 OUT ib_mr_attr_t* const p_mr_attr );
\r
2191 * [in] A handle to a registered memory region.
\r
2194 * [out] A reference to a structure where the registered memory attributes
\r
2199 * The memory region attributes were returned successfully.
\r
2201 * IB_INVALID_MR_HANDLE
\r
2202 * The memory region handle was invalid.
\r
2204 * IB_INVALID_PARAMETER
\r
2205 * A reference to the memory region attributes was not provided.
\r
2208 * This routine returns information about the specified registered memory
\r
2212 * ib_dereg_mr, ib_reg_mem, ib_reg_shared, ib_mr_attr_t
\r
2216 /****f* Access Layer/ib_rereg_mem
\r
2221 * Modifies the attributes of an existing memory region.
\r
2225 AL_EXPORT ib_api_status_t AL_API
\r
2227 IN const ib_mr_handle_t h_mr,
\r
2228 IN const ib_mr_mod_t mr_mod_mask,
\r
2229 IN const ib_mr_create_t* const p_mr_create OPTIONAL,
\r
2230 OUT net32_t* const p_lkey,
\r
2231 OUT net32_t* const p_rkey,
\r
2232 IN const ib_pd_handle_t h_pd OPTIONAL );
\r
2236 * [in] A handle to the registered memory region being modified.
\r
2239 * [in] A mask used to specify which attributes of the memory region are
\r
2243 * [in] This references information needed to perform the modification on
\r
2244 * the registered memory region. This parameter may be NULL if only the
\r
2245 * protection domain will be modified.
\r
2248 * [out] The local access key associated with this registered memory
\r
2252 * [out] A key that may be used by a remote end-point when performing RDMA
\r
2253 * or atomic operations to this registered memory region.
\r
2256 * [in] An optionally provided parameter used to modify the protection
\r
2257 * domain of a registered region.
\r
2261 * The memory region attributes were modified successfully.
\r
2263 * IB_INVALID_MR_HANDLE
\r
2264 * The memory region handle was invalid.
\r
2266 * IB_INVALID_PARAMETER
\r
2267 * A reference to the lkey or rkey was not provided or the specified
\r
2268 * modify mask is invalid.
\r
2270 * IB_INVALID_SETTING
\r
2271 * The specified memory region attributes are invalid.
\r
2273 * IB_INVALID_PD_HANDLE
\r
2274 * The protection domain handle was invalid.
\r
2276 * IB_INSUFFICIENT_RESOURCES
\r
2277 * There were insufficient resources currently available on the channel
\r
2278 * adapter to modify the memory region.
\r
2281 * The requested access rights are not supported by the channel adapter.
\r
2283 * IB_INVALID_PERMISSION
\r
2284 * The requested access rights are invalid.
\r
2286 * IB_RESOURCE_BUSY
\r
2287 * The memory region has windows bound to it.
\r
2290 * This routine modifies the attributes of the specified memory region.
\r
2291 * The memory being modified may have been registered using either virtual
\r
2292 * or physical registration. Conceptually, this routine is equivalent to
\r
2293 * to calling ib_dereg_mr, followed by ib_reg_mem, but may be higher
\r
2297 * ib_reg_mem, ib_reg_phys, ib_dereg_mr, ib_mr_mod_t, ib_mr_create_t
\r
2301 /****f* Access Layer/ib_rereg_phys
\r
2306 * Modifies the attributes of an existing memory region.
\r
2310 AL_EXPORT ib_api_status_t AL_API
\r
2312 IN const ib_mr_handle_t h_mr,
\r
2313 IN const ib_mr_mod_t mr_mod_mask,
\r
2314 IN const ib_phys_create_t* const p_phys_create OPTIONAL,
\r
2315 IN OUT uint64_t* const p_vaddr,
\r
2316 OUT net32_t* const p_lkey,
\r
2317 OUT net32_t* const p_rkey,
\r
2318 IN const ib_pd_handle_t h_pd OPTIONAL );
\r
2322 * [in] A handle to the registered memory region being modified.
\r
2325 * [in] A mask used to specify which attributes of the memory region are
\r
2329 * [in] This references information needed to perform the modification on
\r
2330 * the registered memory region. This parameter may be NULL if
\r
2331 * only the protection domain will be modified.
\r
2334 * [in/out] On input, this specifies the requested virtual address for the
\r
2335 * start of the physical region. On output, this references the actual
\r
2336 * virtual address assigned to the registered region.
\r
2339 * [out] The local access key associated with this registered memory
\r
2343 * [out] A key that may be used by a remote end-point when performing RDMA
\r
2344 * or atomic operations to this registered memory region.
\r
2347 * [in] An optionally provided parameter used to modify the protection
\r
2348 * domain of a registered region.
\r
2352 * The memory region attributes were modified successfully.
\r
2354 * IB_INVALID_MR_HANDLE
\r
2355 * The memory region handle was invalid.
\r
2357 * IB_INVALID_PARAMETER
\r
2358 * A reference to the virtual address, lkey, rkey was not provided or
\r
2359 * the specified modify mask is invalid.
\r
2361 * IB_INVALID_SETTING
\r
2362 * The specified memory region attributes are invalid.
\r
2364 * IB_INVALID_PD_HANDLE
\r
2365 * The protection domain handle was invalid.
\r
2367 * IB_INSUFFICIENT_RESOURCES
\r
2368 * There were insufficient resources currently available on the channel
\r
2369 * adapter to modify the memory region.
\r
2372 * The requested access rights are not supported by the channel adapter.
\r
2374 * IB_INVALID_PERMISSION
\r
2375 * The requested access rights are invalid.
\r
2377 * IB_RESOURCE_BUSY
\r
2378 * The memory region has windows bound to it.
\r
2381 * This routine modifies the attributes of the specified memory region.
\r
2382 * The memory being modified may have been registered using either virtual
\r
2383 * or physical registration. Conceptually, this routine is equivalent to
\r
2384 * to calling ib_dereg_mr, followed by ib_reg_phys, but may be higher
\r
2388 * ib_reg_mem, ib_reg_phys, ib_dereg_mr, ib_mr_mod_t, ib_mr_create_t
\r
2392 /****f* Access Layer/ib_reg_shared
\r
2397 * Registers a memory region that has the same physical pages as an
\r
2398 * existing registered memory region.
\r
2402 AL_EXPORT ib_api_status_t AL_API
\r
2404 IN const ib_mr_handle_t h_mr,
\r
2405 IN const ib_pd_handle_t h_pd,
\r
2406 IN const ib_access_t access_ctrl,
\r
2407 IN OUT uint64_t* const p_vaddr,
\r
2408 OUT net32_t* const p_lkey,
\r
2409 OUT net32_t* const p_rkey,
\r
2410 OUT ib_mr_handle_t* const ph_mr );
\r
2414 * [in] A handle to an existing registered memory region that this
\r
2415 * registration should share physical pages with.
\r
2418 * [in] Handle to the PD on which memory is being registered
\r
2421 * [in] Access rights of the registered region.
\r
2424 * [in/out] On input, this specifies the requested virtual address for the
\r
2425 * start of the physical region. On output, this references the actual
\r
2426 * virtual address assigned to the registered region. This is always a
\r
2427 * 64-bit quantity to support registering more than 4GB of memory on
\r
2428 * 32-bit systems with PAE.
\r
2431 * [out] The local access key associated with this registered memory
\r
2435 * [out] A key that may be used by a remote end-point when performing RDMA
\r
2436 * or atomic operations to this registered memory region.
\r
2439 * [out] Upon successful completion of this call, this references a handle
\r
2440 * to the registered memory region. This handle is used when performing
\r
2441 * data transfers and to deregister the memory.
\r
2445 * The shared memory region was successfully registered.
\r
2447 * IB_INVALID_MR_HANDLE
\r
2448 * The memory region handle was invalid.
\r
2450 * IB_INVALID_PD_HANDLE
\r
2451 * The protection domain handle was invalid.
\r
2453 * IB_INVALID_PARAMETER
\r
2454 * A reference to the virtual address, lkey, rkey, or handle was not
\r
2457 * IB_INSUFFICIENT_MEMORY
\r
2458 * There was insufficient memory to register the shared memory region.
\r
2460 * IB_INSUFFICIENT_RESOURCES
\r
2461 * There were insufficient resources currently available on the channel
\r
2462 * adapter to register the shared memory region.
\r
2465 * The requested access rights are not supported by the channel adapter.
\r
2467 * IB_INVALID_PERMISSION
\r
2468 * The requested access rights are invalid.
\r
2471 * This routine registers a memory region that shares the same set of
\r
2472 * physical pages associated with an existing registered memory region.
\r
2475 * ib_dereg_mr, ib_reg_mem, ib_reg_phys, ib_reg_shared, ib_mr_create_t
\r
2479 /****f* Access Layer/ib_reg_shmid
\r
2484 * Registers a memory region to be shared across multiple processes.
\r
2485 * The memory is referenced by a shared memory identifier.
\r
2489 AL_EXPORT ib_api_status_t AL_API
\r
2491 IN const ib_pd_handle_t h_pd,
\r
2492 IN const ib_shmid_t shmid,
\r
2493 IN const ib_mr_create_t* const p_mr_create,
\r
2494 OUT uint64_t* const p_vaddr,
\r
2495 OUT net32_t* const p_lkey,
\r
2496 OUT net32_t* const p_rkey,
\r
2497 OUT ib_mr_handle_t* const ph_mr );
\r
2501 * [in] A handle to an existing protection domain that the memory
\r
2502 * should be registered with.
\r
2505 * [in] An identifier for the shared memory region.
\r
2508 * [in] Information describing the attributes of the memory region to
\r
2512 * [out] The HCA assigned, HCA relative virtual address for the
\r
2516 * [out] The local access key associated with this registered memory
\r
2520 * [out] A key that may be used by a remote end-point when performing RDMA
\r
2521 * or atomic operations to this registered memory region.
\r
2524 * [out] Upon successful completion of this call, this references a handle
\r
2525 * to the registered memory region. This handle is used when performing
\r
2526 * data transfers and to deregister the memory.
\r
2530 * The shared memory region was successfully registered.
\r
2532 * IB_INVALID_PD_HANDLE
\r
2533 * The protection domain handle was invalid.
\r
2535 * IB_INVALID_PARAMETER
\r
2536 * A reference to the memory region information, lkey, rkey, or handle
\r
2537 * was not provided.
\r
2539 * IB_INVALID_SETTING
\r
2540 * The length and page mapping for the memory region do not match those
\r
2541 * of the region identified by the provided SHMID.
\r
2543 * IB_INSUFFICIENT_MEMORY
\r
2544 * There was insufficient memory to register the shared memory region.
\r
2546 * IB_INSUFFICIENT_RESOURCES
\r
2547 * There were insufficient resources currently available on the channel
\r
2548 * adapter to register the shared memory region.
\r
2551 * The requested access rights are not supported by the channel adapter.
\r
2553 * IB_INVALID_PERMISSION
\r
2554 * The requested access rights are invalid.
\r
2557 * This routine registers a memory region that is shared between processes.
\r
2558 * The region being registered is identified through a shared memory
\r
2559 * identifier. The registered region shares hardware resources as much
\r
2563 * ib_dereg_mr, ib_reg_mem, ib_reg_shared, ib_mr_create_t
\r
2567 /****f* Access Layer/ib_dereg_mr
\r
2572 * Deregisters a registered memory region.
\r
2576 AL_EXPORT ib_api_status_t AL_API
\r
2578 IN const ib_mr_handle_t h_mr );
\r
2582 * [in] A handle to a registered memory region that will be unregistered.
\r
2586 * The memory region was successfully deregistered.
\r
2588 * IB_INVALID_MR_HANDLE
\r
2589 * The memory region handle was invalid.
\r
2591 * IB_RESOURCE_BUSY
\r
2592 * The memory region has memory windows bound to it.
\r
2595 * This routine deregisters a memory region with a channel adapter. The
\r
2596 * region may be deregistered only if there are no memory windows or
\r
2597 * existing shared memory regions currently bound to the region. Work
\r
2598 * requests referencing this region when it is deregistered will fail
\r
2599 * with a WRS_LOCAL_PROTECTION_ERR error.
\r
2602 * ib_reg_mem, ib_reg_phys, ib_reg_shared
\r
2608 /****f* Access Layer/mlnx_create_fmr
\r
2613 * Creates a Mellanox fast memory region.
\r
2617 AL_EXPORT ib_api_status_t AL_API
\r
2619 IN const ib_pd_handle_t h_pd,
\r
2620 IN const mlnx_fmr_create_t* const p_fmr_create,
\r
2621 OUT mlnx_fmr_handle_t* const ph_fmr );
\r
2625 * [in] An optionally provided parameter used to modify the protection
\r
2626 * domain of a registered region.
\r
2628 * [in] This references information needed to perform the modification on
\r
2629 * the registered memory region. This parameter may be NULL if only the
\r
2630 * protection domain will be modified.
\r
2632 * [out] A handle to the registered memory region being modified.
\r
2636 * The memory region attributes were modified successfully.
\r
2638 * IB_INVALID_MR_HANDLE
\r
2639 * The memory region handle was invalid.
\r
2641 * IB_INVALID_PARAMETER
\r
2642 * A reference to the lkey or rkey was not provided or the specified
\r
2643 * modify mask is invalid.
\r
2645 * IB_INVALID_SETTING
\r
2646 * The specified memory region attributes are invalid.
\r
2648 * IB_INVALID_PD_HANDLE
\r
2649 * The protection domain handle was invalid.
\r
2651 * IB_INSUFFICIENT_RESOURCES
\r
2652 * There were insufficient resources currently available on the channel
\r
2653 * adapter to modify the memory region.
\r
2656 * The requested access rights are not supported by the channel adapter.
\r
2658 * IB_INVALID_PERMISSION
\r
2659 * The requested access rights are invalid.
\r
2661 * IB_RESOURCE_BUSY
\r
2662 * The memory region has windows bound to it.
\r
2665 * This is a Mellanox specific extension to verbs.
\r
2668 * mlnx_destroy_fmr, mlnx_fmr_create_t
\r
2672 /****f* Access Layer/mlnx_map_fmr
\r
2681 AL_EXPORT ib_api_status_t AL_API
\r
2682 mlnx_map_phys_fmr(
\r
2683 IN const mlnx_fmr_handle_t h_fmr,
\r
2684 IN const uint64_t* const paddr_list,
\r
2685 IN const int list_len,
\r
2686 IN OUT uint64_t* const p_vaddr,
\r
2687 OUT net32_t* const p_lkey,
\r
2688 OUT net32_t* const p_rkey );
\r
2692 * [in] Handle to the fast memory region that these pages map to
\r
2694 * [in] array of phys address
\r
2696 * [in] number of pages in the list
\r
2698 * [in/out] On input, references the requested virtual address for the
\r
2699 * start of the FMR. On output, references the actual
\r
2700 * virtual address assigned to the FMR.
\r
2702 * [out] The local access key associated with this registered memory
\r
2705 * [out] A key that may be used by a remote end-point when performing
\r
2706 * RDMA or atomic operations to this registered memory region.
\r
2710 * The memory region attributes were modified successfully.
\r
2712 * IB_INVALID_MR_HANDLE
\r
2713 * The memory region handle was invalid.
\r
2715 * IB_INVALID_PARAMETER
\r
2716 * A reference to the lkey or rkey was not provided or the specified
\r
2717 * modify mask is invalid.
\r
2719 * IB_INVALID_SETTING
\r
2720 * The specified memory region attributes are invalid.
\r
2722 * IB_INVALID_PD_HANDLE
\r
2723 * The protection domain handle was invalid.
\r
2725 * IB_INSUFFICIENT_RESOURCES
\r
2726 * There were insufficient resources currently available on the channel
\r
2727 * adapter to modify the memory region.
\r
2730 * The requested access rights are not supported by the channel adapter.
\r
2732 * IB_INVALID_PERMISSION
\r
2733 * The requested access rights are invalid.
\r
2735 * IB_RESOURCE_BUSY
\r
2736 * The memory region has windows bound to it.
\r
2739 * This is a Mellanox specific extension to verbs.
\r
2742 * mlnx_destroy_fmr, mlnx_fmr_create_t
\r
2746 /****f* Access Layer/mlnx_unmap_fmr
\r
2755 AL_EXPORT ib_api_status_t AL_API
\r
2757 IN const mlnx_fmr_handle_t h_fmr );
\r
2764 * The memory region attributes were modified successfully.
\r
2766 * IB_INVALID_MR_HANDLE
\r
2767 * The memory region handle was invalid.
\r
2769 * IB_INVALID_PARAMETER
\r
2770 * A reference to the lkey or rkey was not provided or the specified
\r
2771 * modify mask is invalid.
\r
2773 * IB_INVALID_SETTING
\r
2774 * The specified memory region attributes are invalid.
\r
2776 * IB_INVALID_PD_HANDLE
\r
2777 * The protection domain handle was invalid.
\r
2779 * IB_INSUFFICIENT_RESOURCES
\r
2780 * There were insufficient resources currently available on the channel
\r
2781 * adapter to modify the memory region.
\r
2784 * The requested access rights are not supported by the channel adapter.
\r
2786 * IB_INVALID_PERMISSION
\r
2787 * The requested access rights are invalid.
\r
2789 * IB_RESOURCE_BUSY
\r
2790 * The memory region has windows bound to it.
\r
2793 * This is a Mellanox specific extension to verbs.
\r
2796 * mlnx_destroy_fmr, mlnx_fmr_create_t
\r
2800 /****f* Access Layer/mlnx_destroy_fmr
\r
2802 * mlnx_destroy_fmr
\r
2805 * Destroys an existing Mellanox fast memory region.
\r
2809 AL_EXPORT ib_api_status_t AL_API
\r
2811 IN const mlnx_fmr_handle_t h_fmr );
\r
2815 * [in] A handle to the registered memory region being modified.
\r
2819 * The memory region attributes were modified successfully.
\r
2821 * IB_INVALID_MR_HANDLE
\r
2822 * The memory region handle was invalid.
\r
2824 * IB_INVALID_PARAMETER
\r
2825 * A reference to the lkey or rkey was not provided or the specified
\r
2826 * modify mask is invalid.
\r
2828 * IB_INVALID_SETTING
\r
2829 * The specified memory region attributes are invalid.
\r
2831 * IB_INVALID_PD_HANDLE
\r
2832 * The protection domain handle was invalid.
\r
2834 * IB_INSUFFICIENT_RESOURCES
\r
2835 * There were insufficient resources currently available on the channel
\r
2836 * adapter to modify the memory region.
\r
2839 * The requested access rights are not supported by the channel adapter.
\r
2841 * IB_INVALID_PERMISSION
\r
2842 * The requested access rights are invalid.
\r
2844 * IB_RESOURCE_BUSY
\r
2845 * The memory region has windows bound to it.
\r
2848 * This is a Mellanox specific extension to verbs.
\r
2851 * mlnx_destroy_fmr, mlnx_fmr_create_t
\r
2855 /****f* Access Layer/ib_create_fmr_pool
\r
2857 * ib_create_fmr_pool
\r
2860 * Creates a pool of FMR elements for use
\r
2864 AL_EXPORT ib_api_status_t AL_API
\r
2865 mlnx_create_fmr_pool(
\r
2866 IN const ib_pd_handle_t h_pd,
\r
2867 IN const mlnx_fmr_pool_create_t *p_fmr_pool_attr,
\r
2868 OUT mlnx_fmr_pool_handle_t* const ph_pool );
\r
2884 /****f* Access Layer/ib_destroy_fmr_pool
\r
2886 * ib_destroy_fmr_pool
\r
2889 * Destroys a MAD pool and all associated resources.
\r
2893 AL_EXPORT ib_api_status_t AL_API
\r
2894 mlnx_destroy_fmr_pool(
\r
2895 IN const mlnx_fmr_pool_handle_t h_pool );
\r
2916 /****f* Access Layer/ib_fmr_pool_map_phys
\r
2918 * ib_destroy_fmr_pool
\r
2921 * Destroys a MAD pool and all associated resources.
\r
2925 AL_EXPORT ib_api_status_t AL_API
\r
2926 mlnx_map_phys_fmr_pool(
\r
2927 IN const mlnx_fmr_pool_handle_t h_pool ,
\r
2928 IN const uint64_t* const paddr_list,
\r
2929 IN const int list_len,
\r
2930 IN OUT uint64_t* const p_vaddr,
\r
2931 OUT net32_t* const p_lkey,
\r
2932 OUT net32_t* const p_rkey,
\r
2933 OUT mlnx_fmr_pool_el_t *pp_fmr_el);
\r
2952 /****f* Access Layer/ib_destroy_fmr_pool
\r
2954 * ib_destroy_fmr_pool
\r
2957 * Destroys a MAD pool and all associated resources.
\r
2961 AL_EXPORT ib_api_status_t AL_API
\r
2962 mlnx_unmap_fmr_pool(
\r
2963 IN mlnx_fmr_pool_el_t p_fmr_el );
\r
2979 /****f* Access Layer/ib_flush_fmr_pool
\r
2981 * ib_flush_fmr_pool
\r
2984 * Destroys a MAD pool and all associated resources.
\r
2989 mlnx_flush_fmr_pool(mlnx_fmr_pool_handle_t h_pool);
\r
3003 #endif /* CL_KERNEL */
\r
3005 /****f* Access Layer/ib_create_mw
\r
3010 * Creates a memory window associated with the specified protection domain.
\r
3011 * Newly created windows are not bound to any specific memory region.
\r
3015 AL_EXPORT ib_api_status_t AL_API
\r
3017 IN const ib_pd_handle_t h_pd,
\r
3018 OUT net32_t* const p_rkey,
\r
3019 OUT ib_mw_handle_t* const ph_mw );
\r
3023 * [in] A handle to an existing protection domain that the memory window
\r
3024 * should be created within.
\r
3027 * [out] The current rkey associated with the memory window. This key is
\r
3028 * used to bind the window to a registered memory region.
\r
3031 * [out] Upon successful completion of this call, this references a handle
\r
3032 * to the memory window. This handle is used to bind and destroy
\r
3037 * The memory window was successfully created.
\r
3039 * IB_INVALID_PD_HANDLE
\r
3040 * The protection domain handle was invalid.
\r
3042 * IB_INVALID_PARAMETER
\r
3043 * A reference to the memory window rkey or handle was not provided.
\r
3045 * IB_INSUFFICIENT_MEMORY
\r
3046 * There was insufficient memory to create the memory window.
\r
3048 * IB_INSUFFICIENT_RESOURCES
\r
3049 * There were insufficient resources currently available on the channel
\r
3050 * adapter to create the memory window.
\r
3053 * This routine creates an unbound memory window associated with a specified
\r
3054 * protection domain. The memory window cannot be used for data transfer
\r
3055 * operations until being bound to a registered memory region.
\r
3058 * ib_destroy_mw, ib_query_mw, ib_bind_mw
\r
3062 /****f* Access Layer/ib_query_mw
\r
3067 * Query the current attributes of a memory window.
\r
3071 AL_EXPORT ib_api_status_t AL_API
\r
3073 IN const ib_mw_handle_t h_mw,
\r
3074 OUT ib_pd_handle_t* const ph_pd,
\r
3075 OUT net32_t* const p_rkey );
\r
3079 * [in] A handle to an existing memory window.
\r
3082 * [out] Upon successful completion of this call, this will reference
\r
3083 * the protection domain associated with this memory window.
\r
3086 * [out] Upon successful completion of this call, this will reference
\r
3087 * the current rkey associated with this memory window.
\r
3091 * The memory window attributes were returned successfully.
\r
3093 * IB_INVALID_MW_HANDLE
\r
3094 * The memory window handle was invalid.
\r
3096 * IB_INVALID_PARAMETER
\r
3097 * A reference to the protection domain handle or rkey was not provided.
\r
3100 * This routine returns information about the specified memory window.
\r
3107 /****f* Access Layer/ib_bind_mw
\r
3112 * Binds a memory window to a registered memory region.
\r
3116 AL_EXPORT ib_api_status_t AL_API
\r
3118 IN const ib_mw_handle_t h_mw,
\r
3119 IN const ib_qp_handle_t h_qp,
\r
3120 IN ib_bind_wr_t* const p_mw_bind,
\r
3121 OUT net32_t* const p_rkey );
\r
3125 * [in] A handle to an existing memory window.
\r
3128 * [in] A handle to a queue pair that the bind request will be posted to.
\r
3131 * [in] Describes the memory window bind request.
\r
3134 * [out] The new rkey for the memory window that may be used by a remote
\r
3135 * end-point when performing RDMA or atomic operations to this memory
\r
3140 * The memory window bind operation was successfully posted.
\r
3142 * IB_INVALID_MW_HANDLE
\r
3143 * The memory window handle was invalid.
\r
3145 * IB_INVALID_QP_HANDLE
\r
3146 * The queue pair handle was invalid.
\r
3148 * IB_INVALID_PARAMETER
\r
3149 * A reference to the memory window bind work request or rkey was not
\r
3152 * IB_INVALID_SERVICE_TYPE
\r
3153 * The queue pair configuration does not support this type of service.
\r
3155 * IB_INVALID_MR_HANDLE
\r
3156 * The memory region handle was invalid.
\r
3159 * The rkey is invalid for the memory region being bound.
\r
3162 * The requested access rights are not supported by the channel adapter.
\r
3164 * IB_INVALID_PERMISSION
\r
3165 * The requested access rights are invalid.
\r
3167 * IB_INSUFFICIENT_RESOURCES
\r
3168 * There were insufficient resources currently available on the channel
\r
3169 * adapter to bind the memory window.
\r
3172 * This routine posts a request to bind a memory window to a registered
\r
3173 * memory region. The bind operation occurs on the specified queue pair,
\r
3174 * but the bound region is usable across all queue pairs within the same
\r
3175 * protection domain.
\r
3178 * ib_create_mw, ib_bind_wr_t
\r
3182 /****f* Access Layer/ib_destroy_mw
\r
3187 * Destroys a memory window.
\r
3191 AL_EXPORT ib_api_status_t AL_API
\r
3193 IN const ib_mw_handle_t h_mw );
\r
3197 * [in] A handle to an existing memory window.
\r
3201 * The memory window was successfully destroyed.
\r
3203 * IB_INVALID_MW_HANDLE
\r
3204 * The memory window handle was invalid.
\r
3207 * This routine deallocates a window entry created via a ib_create_mw.
\r
3208 * Once this operation is complete, future accesses to the window will fail.
\r
3215 /****f* Access Layer/ib_post_send
\r
3220 * This routine posts a work request to the send queue of a queue pair.
\r
3224 AL_EXPORT ib_api_status_t AL_API
\r
3226 IN const ib_qp_handle_t h_qp,
\r
3227 IN ib_send_wr_t* const p_send_wr,
\r
3228 OUT ib_send_wr_t **pp_send_failure OPTIONAL );
\r
3232 * [in] The queue pair to which this work request is being submitted.
\r
3235 * [in] A reference to the head of the work request list.
\r
3238 * [out] If the post send operation failed, this references the work
\r
3239 * request in the p_send_wr list where the first failure occurred.
\r
3240 * This parameter may be NULL if only a single work request is being
\r
3241 * posted to the QP.
\r
3245 * All work requests were successfully posted.
\r
3247 * IB_INVALID_QP_HANDLE
\r
3248 * The queue pair handle was invalid.
\r
3250 * IB_INVALID_PARAMETER
\r
3251 * A reference to the send work request list was not provided.
\r
3253 * IB_INSUFFICIENT_RESOURCES
\r
3254 * The number of posted work requests exceed the current depth available
\r
3255 * on the send queue.
\r
3257 * IB_INVALID_WR_TYPE
\r
3258 * The work request type was invalid.
\r
3260 * IB_INVALID_QP_STATE
\r
3261 * The current queue pair state does not allow posting sends.
\r
3263 * IB_INVALID_MAX_SGE
\r
3264 * The number of work request scatter gather elements exceed the queue
\r
3265 * pair configuration.
\r
3268 * The requested operation is not supported by the channel adapter.
\r
3271 * This routine posts a work request to the send queue of a queue pair.
\r
3272 * The type of work to perform is defined by the p_send_wr parameter.
\r
3279 /****f* Access Layer/ib_post_recv
\r
3284 * This routine posts a work request to the receive queue of a queue pair.
\r
3288 AL_EXPORT ib_api_status_t AL_API
\r
3290 IN const ib_qp_handle_t h_qp,
\r
3291 IN ib_recv_wr_t* const p_recv_wr,
\r
3292 OUT ib_recv_wr_t **pp_recv_failure OPTIONAL );
\r
3296 * [in] The queue pair to which this work request is being submitted.
\r
3299 * [in] A reference to the head of the work request list.
\r
3302 * [out] If the post receive operation failed, this references the work
\r
3303 * request in the p_recv_wr list where the first failure occurred.
\r
3304 * This parameter may be NULL if only a single work request is being
\r
3305 * posted to the QP.
\r
3309 * All work requests were successfully posted.
\r
3311 * IB_INVALID_QP_HANDLE
\r
3312 * The queue pair handle was invalid.
\r
3314 * IB_INVALID_PARAMETER
\r
3315 * A reference to the receive work request list was not provided.
\r
3317 * IB_INSUFFICIENT_RESOURCES
\r
3318 * The number of posted work requests exceed the current depth available
\r
3319 * on the receive queue.
\r
3321 * IB_INVALID_WR_TYPE
\r
3322 * The work request type was invalid.
\r
3324 * IB_INVALID_QP_STATE
\r
3325 * The current queue pair state does not allow posting receives.
\r
3328 * This routine posts a work request to the receive queue of a queue pair.
\r
3329 * The type of work to perform is defined by the p_recv_wr parameter. This
\r
3330 * call is used to post data buffers to receive incoming message sends.
\r
3337 /****f* Access Layer/ib_send_mad
\r
3342 * This routine posts a work request to the send queue of a queue pair.
\r
3346 AL_EXPORT ib_api_status_t AL_API
\r
3348 IN const ib_mad_svc_handle_t h_mad_svc,
\r
3349 IN ib_mad_element_t* const p_mad_element_list,
\r
3350 OUT ib_mad_element_t **pp_mad_failure OPTIONAL );
\r
3354 * [in] The MAD service to which this work request is being submitted.
\r
3356 * p_mad_element_list
\r
3357 * [in] A list of MAD elements that will be posted to the send queue.
\r
3360 * [out] If the send MAD operation failed, this references the MAD
\r
3361 * element in the p_mad_element_list where the first failure occurred.
\r
3362 * This parameter is optional if p_mad_element_list contains a single
\r
3367 * The MAD element list was successfully posted.
\r
3369 * IB_INVALID_HANDLE
\r
3370 * The MAD service handle was invalid.
\r
3372 * IB_INVALID_PARAMETER
\r
3373 * A reference to the MAD element list was not provided.
\r
3375 * IB_INSUFFICIENT_RESOURCES
\r
3376 * There were insufficient resources currently available to complete
\r
3379 * IB_INVALID_SETTING
\r
3380 * The MAD element RMPP version is not supported by the access layer.
\r
3382 * IB_INSUFFICIENT_MEMORY
\r
3383 * There was insufficient memory to complete the request.
\r
3386 * This routine posts a work request to send a MAD on a MAD service. All
\r
3387 * MAD elements successfully posted by this call are under the control of
\r
3388 * the access layer and should not be accessed until the send operation
\r
3391 * In order to guarantee that MADs sent by separate clients do not use the
\r
3392 * same transaction ID, the access layer reserves the upper 32-bits of the
\r
3393 * TID on all unsolicited MADs. MADs sent with the response bit set will
\r
3394 * not have their transaction ID's modified. Unsolicited MADs will have the
\r
3395 * upper 32-bits of their TID set to an access layer generated client ID.
\r
3398 * ib_mad_element_t, ib_cancel_mad
\r
3402 /****f* Access Layer/ib_cancel_mad
\r
3407 * This routine cancels a pending send transaction to a MAD service.
\r
3411 AL_EXPORT ib_api_status_t AL_API
\r
3413 IN const ib_mad_svc_handle_t h_mad_svc,
\r
3414 IN ib_mad_element_t* const p_mad_element );
\r
3418 * [in] The MAD service to which the send operation was directed.
\r
3421 * [in] A handle to a sent MAD element.
\r
3425 * The requested MAD transaction was located and canceled.
\r
3427 * IB_INVALID_PARAMETER
\r
3428 * A reference to the MAD element list was not provided.
\r
3431 * The requested transaction was not located or had already completed.
\r
3434 * This routine cancels a pending send transaction to a MAD service. If
\r
3435 * the request is successfully located and has not yet completed, it will
\r
3436 * be completed with its status set to IB_CANCELED. The canceled operation
\r
3437 * will be returned to the user through the normal MAD completion callback.
\r
3438 * If the send transaction has already completed, this call will return
\r
3446 /****f* Access Layer/ib_peek_cq
\r
3451 * Returns the number of entries currently on the completion queue.
\r
3455 AL_EXPORT ib_api_status_t AL_API
\r
3457 IN const ib_cq_handle_t h_cq,
\r
3458 OUT uint32_t* const p_n_cqes );
\r
3462 * [in] Handle to the completion queue to peek.
\r
3465 * [out] Upon successful completion of this call, contains the number
\r
3466 * of completion queue entries currently on the completion queue.
\r
3470 * The peek operation completed successfully.
\r
3472 * IB_INVALID_CQ_HANDLE
\r
3473 * The completion queue handle was invalid.
\r
3475 * IB_INVALID_PARAMETER
\r
3476 * A reference to the completion queue entry count was not provided.
\r
3479 * This operation is not supported by the channel adapter.
\r
3482 * The value returned is a snapshot of the number of compleiton queue
\r
3483 * entries curently on the completion queue. Support for this operation
\r
3484 * is optional by a channel adapter vendor.
\r
3487 * ib_create_cq, ib_poll_cq, ib_rearm_cq, ib_rearm_n_cq
\r
3491 /****f* Access Layer/ib_poll_cq
\r
3496 * Checks a completion queue for completed work requests.
\r
3500 AL_EXPORT ib_api_status_t AL_API
\r
3502 IN const ib_cq_handle_t h_cq,
\r
3503 IN OUT ib_wc_t** const pp_free_wclist,
\r
3504 OUT ib_wc_t** const pp_done_wclist );
\r
3508 * [in] A handle to a completion queue to check for completions on.
\r
3511 * [in/out] On input, a list of work completion structures provided by
\r
3512 * the client. These are used to report completed work requests through
\r
3513 * the pp_done_wclist.
\r
3515 * On output, this contains the list of work completions structures for
\r
3516 * which no work completion was found.
\r
3519 * [out] A list of work completions retrieved from the completion queue.
\r
3523 * The poll operation completed successfully. If the work completion
\r
3524 * structures referenced by the pp_free_wclist list is empty there are
\r
3525 * potentially more completions available to retrieve.
\r
3527 * IB_INVALID_PARAMETER
\r
3528 * A reference to the free or done work completion list was not provided.
\r
3530 * IB_INVALID_CQ_HANDLE
\r
3531 * The completion queue handle was invalid.
\r
3534 * No completed work requests were removed from the completion queue.
\r
3537 * This routine retrieves completed work requests from the specified
\r
3538 * completion queue. This call will