2 * Copyright (c) 2004,2005 Voltaire, Inc. All rights reserved.
\r
3 * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
\r
4 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
\r
5 * Portions Copyright (c) 2008 Microsoft Corporation. All rights reserved.
\r
7 * This software is available to you under the OpenIB.org BSD license
\r
10 * Redistribution and use in source and binary forms, with or
\r
11 * without modification, are permitted provided that the following
\r
12 * conditions are met:
\r
14 * - Redistributions of source code must retain the above
\r
15 * copyright notice, this list of conditions and the following
\r
18 * - Redistributions in binary form must reproduce the above
\r
19 * copyright notice, this list of conditions and the following
\r
20 * disclaimer in the documentation and/or other materials
\r
21 * provided with the distribution.
\r
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
36 #if !defined(__IB_TYPES_EXTENDED_H__)
\r
37 #define __IB_TYPES_EXTENDED_H__
\r
40 #if defined( WIN32 )
\r
41 #if defined( EXPORT_AL_SYMBOLS )
\r
42 #define AL_EXPORT __declspec(dllexport)
\r
44 #define AL_EXPORT __declspec(dllimport)
\r
49 #define AL_INLINE static inline
\r
51 #define AL_API __stdcall
\r
52 #define AL_INLINE static inline
\r
53 #endif /* CL_KERNEL */
\r
55 #define AL_EXPORT extern
\r
56 #define AL_INLINE static inline
\r
62 * Defines the size of user available data in communication management MADs
\r
64 #define IB_REQ_PDATA_SIZE 92
\r
65 #define IB_MRA_PDATA_SIZE 222
\r
66 #define IB_REJ_PDATA_SIZE 148
\r
67 #define IB_REP_PDATA_SIZE 196
\r
68 #define IB_RTU_PDATA_SIZE 224
\r
69 #define IB_LAP_PDATA_SIZE 168
\r
70 #define IB_APR_PDATA_SIZE 148
\r
71 #define IB_DREQ_PDATA_SIZE 220
\r
72 #define IB_DREP_PDATA_SIZE 224
\r
73 #define IB_SIDR_REQ_PDATA_SIZE 216
\r
74 #define IB_SIDR_REP_PDATA_SIZE 136
\r
76 /* following v1 ver1.2 p901 */
\r
77 #define IB_PATH_RECORD_RATE_5_GBS 5
\r
78 #define IB_PATH_RECORD_RATE_20_GBS 6
\r
79 #define IB_PATH_RECORD_RATE_40_GBS 7
\r
80 #define IB_PATH_RECORD_RATE_60_GBS 8
\r
81 #define IB_PATH_RECORD_RATE_80_GBS 9
\r
82 #define IB_PATH_RECORD_RATE_120_GBS 10
\r
86 typedef struct _ib_srq* ib_srq_handle_t ;
\r
89 * The following definitions are shared between the Access Layer and VPD
\r
94 /****d* Access Layer/ib_api_status_t
\r
99 * Function return codes indicating the success or failure of an API call.
\r
100 * Note that success is indicated by the return value IB_SUCCESS, which
\r
104 * IB_VERBS_PROCESSING_DONE is used by UVP library to terminate a verbs call
\r
105 * in the pre-ioctl step itself.
\r
109 typedef enum _ib_api_status_t
\r
112 IB_INSUFFICIENT_RESOURCES,
\r
113 IB_INSUFFICIENT_MEMORY,
\r
114 IB_INVALID_PARAMETER,
\r
115 IB_INVALID_SETTING,
\r
120 IB_INVALID_PERMISSION,
\r
123 IB_MAX_MCAST_QPS_REACHED,
\r
124 IB_INVALID_QP_STATE,
\r
125 IB_INVALID_APM_STATE,
\r
126 IB_INVALID_PORT_STATE,
\r
132 IB_INVALID_MAX_WRS,
\r
133 IB_INVALID_MAX_SGE,
\r
134 IB_INVALID_CQ_SIZE,
\r
135 IB_INVALID_SRQ_SIZE,
\r
136 IB_INVALID_SERVICE_TYPE,
\r
140 IB_INVALID_CA_HANDLE,
\r
141 IB_INVALID_AV_HANDLE,
\r
142 IB_INVALID_CQ_HANDLE,
\r
143 IB_INVALID_QP_HANDLE,
\r
144 IB_INVALID_SRQ_HANDLE,
\r
145 IB_INVALID_PD_HANDLE,
\r
146 IB_INVALID_MR_HANDLE,
\r
147 IB_INVALID_FMR_HANDLE,
\r
148 IB_INVALID_MW_HANDLE,
\r
149 IB_INVALID_MCAST_HANDLE,
\r
150 IB_INVALID_CALLBACK,
\r
151 IB_INVALID_AL_HANDLE, /* InfiniBand Access Layer */
\r
152 IB_INVALID_HANDLE, /* InfiniBand Access Layer */
\r
153 IB_ERROR, /* InfiniBand Access Layer */
\r
154 IB_REMOTE_ERROR, /* Infiniband Access Layer */
\r
155 IB_VERBS_PROCESSING_DONE, /* See Notes above */
\r
156 IB_INVALID_WR_TYPE,
\r
164 IB_UNKNOWN_ERROR /* ALWAYS LAST ENUM VALUE! */
\r
171 /****f* IBA Base: Types/ib_get_err_str
\r
176 * Returns a string for the specified status value.
\r
180 AL_EXPORT const char* AL_API
\r
182 IN ib_api_status_t status );
\r
186 * [in] status value
\r
189 * Pointer to the status description string.
\r
196 /****d* Verbs/ib_async_event_t
\r
198 * ib_async_event_t -- Async event types
\r
201 * This type indicates the reason the async callback was called.
\r
202 * The context in the ib_event_rec_t indicates the resource context
\r
203 * that associated with the callback. For example, for IB_AE_CQ_ERROR
\r
204 * the context provided during the ib_create_cq is returned in the event.
\r
208 typedef enum _ib_async_event_t
\r
210 IB_AE_SQ_ERROR = 1,
\r
222 IB_AE_SYSIMG_GUID_TRAP,
\r
224 IB_AE_LINK_INTEGRITY,
\r
225 IB_AE_FLOW_CTRL_ERROR,
\r
227 IB_AE_QP_APM_ERROR,
\r
228 IB_AE_WQ_REQ_ERROR,
\r
229 IB_AE_WQ_ACCESS_ERROR,
\r
232 IB_AE_CLIENT_REREGISTER,
\r
233 IB_AE_SRQ_LIMIT_REACHED,
\r
234 IB_AE_SRQ_QP_LAST_WQE_REACHED,
\r
235 IB_AE_UNKNOWN /* ALWAYS LAST ENUM VALUE */
\r
237 } ib_async_event_t;
\r
241 * An error occurred when accessing the send queue of the QP.
\r
242 * This event is optional.
\r
245 * The send queue of the specified QP has completed the outstanding
\r
246 * messages in progress when the state change was requested and, if
\r
247 * applicable, has received all acknowledgements for those messages.
\r
250 * An error occurred when accessing the receive queue of the QP.
\r
251 * This event is optional.
\r
254 * An error occurred when writing an entry to the CQ.
\r
257 * A catastrophic error occurred while accessing or processing the
\r
258 * work queue that prevents reporting of completions.
\r
261 * The first packet has arrived for the receive work queue where the
\r
262 * QP is still in the RTR state.
\r
265 * If alternate path migration is supported, this event indicates that
\r
266 * the QP connection has migrated to the alternate path.
\r
268 * IB_AE_LOCAL_FATAL
\r
269 * A catastrophic HCA error occurred which cannot be attributed to any
\r
270 * resource; behavior is indeterminate.
\r
273 * A PKEY violation was detected. This event is optional.
\r
276 * A QKEY violation was detected. This event is optional.
\r
279 * An MKEY violation was detected. This event is optional.
\r
282 * A port capability change was detected. This event is optional.
\r
284 * IB_AE_SYSIMG_GUID_TRAP
\r
285 * If the system image GUID is supported, this event indicates that the
\r
286 * system image GUID of this HCA has been changed. This event is
\r
289 * IB_AE_BUF_OVERRUN
\r
290 * The number of consecutive flow control update periods with at least
\r
291 * one overrun error in each period has exceeded the threshold specified
\r
292 * in the port info attributes. This event is optional.
\r
294 * IB_AE_LINK_INTEGRITY
\r
295 * The detection of excessively frequent local physical errors has
\r
296 * exceeded the threshold specified in the port info attributes. This
\r
297 * event is optional.
\r
299 * IB_AE_FLOW_CTRL_ERROR
\r
300 * An HCA watchdog timer monitoring the arrival of flow control updates
\r
301 * has expired without receiving an update. This event is optional.
\r
304 * An BKEY violation was detected. This event is optional.
\r
306 * IB_AE_QP_APM_ERROR
\r
307 * If alternate path migration is supported, this event indicates that
\r
308 * an incoming path migration request to this QP was not accepted.
\r
310 * IB_AE_WQ_REQ_ERROR
\r
311 * An OpCode violation was detected at the responder.
\r
313 * IB_AE_WQ_ACCESS_ERROR
\r
314 * An access violation was detected at the responder.
\r
316 * IB_AE_PORT_ACTIVE
\r
317 * If the port active event is supported, this event is generated
\r
318 * when the link becomes active: IB_LINK_ACTIVE.
\r
321 * The link is declared unavailable: IB_LINK_INIT, IB_LINK_ARMED,
\r
324 * IB_AE_CLIENT_REREGISTER
\r
325 * The SM idicate to client to reregister its SA records.
\r
327 * IB_AE_SRQ_CATAS_ERROR
\r
328 * An error occurred while processing or accessing the SRQ that prevents
\r
329 * dequeuing a WQE from the SRQ and reporting of receive completions.
\r
331 * IB_AE_SRQ_QP_LAST_WQE_REACHED
\r
332 * An event, issued for a QP, associated with a shared receive queue, when
\r
333 * a CQE is generated for the last WQE, or
\r
334 * the QP gets in the Error State and there are no more WQEs on the RQ.
\r
337 * An unknown error occurred which cannot be attributed to any
\r
338 * resource; behavior is indeterminate.
\r
344 /****f* IBA Base: Types/ib_get_async_event_str
\r
346 * ib_get_async_event_str
\r
349 * Returns a string for the specified asynchronous event.
\r
353 AL_EXPORT const char* AL_API
\r
354 ib_get_async_event_str(
\r
355 IN ib_async_event_t event );
\r
362 * Pointer to the asynchronous event description string.
\r
370 /****s* Verbs/ib_event_rec_t
\r
372 * ib_event_rec_t -- Async event notification record
\r
375 * When an async event callback is made, this structure is passed to indicate
\r
376 * the type of event, the source of event that caused it, and the context
\r
377 * associated with this event.
\r
379 * context -- Context of the resource that caused the event.
\r
380 * -- ca_context if this is a port/adapter event.
\r
381 * -- qp_context if the source is a QP event
\r
382 * -- cq_context if the source is a CQ event.
\r
383 * -- ee_context if the source is an EE event.
\r
387 typedef struct _ib_event_rec
\r
389 TO_LONG_PTR(void* , context) ;
\r
390 ib_async_event_t type;
\r
392 /* HCA vendor specific event information. */
\r
393 uint64_t vendor_specific;
\r
395 /* The following structures are valid only for trap types. */
\r
401 ib_net64_t port_guid;
\r
405 * The following structure is valid only for
\r
406 * P_KEY, Q_KEY, and M_KEY violation traps.
\r
428 ib_net64_t sysimg_guid;
\r
436 /****d* Access Layer/ib_atomic_t
\r
441 * Indicates atomicity levels supported by an adapter.
\r
445 typedef enum _ib_atomic_t
\r
455 * Atomic operations not supported.
\r
458 * Atomic operations guaranteed between QPs of a single CA.
\r
461 * Atomic operations are guaranteed between CA and any other entity
\r
466 /****s* Access Layer/ib_port_cap_t
\r
471 * Indicates which management agents are currently available on the specified
\r
476 typedef struct _ib_port_cap
\r
480 boolean_t dev_mgmt;
\r
483 boolean_t sm_disable;
\r
484 boolean_t qkey_ctr;
\r
485 boolean_t pkey_ctr;
\r
490 boolean_t pkey_nvram;
\r
491 boolean_t mkey_nvram;
\r
493 boolean_t dr_notice;
\r
494 boolean_t boot_mgmt;
\r
495 boolean_t capm_notice;
\r
498 boolean_t port_active;
\r
500 boolean_t pkey_switch_ext_port;
\r
502 boolean_t link_rtl;
\r
503 boolean_t client_reregister;
\r
509 /****d* Access Layer/ib_init_type_t
\r
514 * If supported by the HCA, the type of initialization requested by
\r
515 * this port before SM moves it to the active or armed state. If the
\r
516 * SM implements reinitialization, it shall set these bits to indicate
\r
517 * the type of initialization performed prior to activating the port.
\r
518 * Otherwise, these bits shall be set to 0.
\r
522 typedef uint8_t ib_init_type_t;
\r
523 #define IB_INIT_TYPE_NO_LOAD 0x01
\r
524 #define IB_INIT_TYPE_PRESERVE_CONTENT 0x02
\r
525 #define IB_INIT_TYPE_PRESERVE_PRESENCE 0x04
\r
526 #define IB_INIT_TYPE_DO_NOT_RESUSCITATE 0x08
\r
530 /****s* Access Layer/ib_port_attr_mod_t
\r
532 * ib_port_attr_mod_t
\r
535 * Port attributes that may be modified.
\r
539 typedef struct _ib_port_attr_mod
\r
545 ib_init_type_t init_type;
\r
546 ib_net64_t system_image_guid;
\r
548 } ib_port_attr_mod_t;
\r
555 /****s* Access Layer/ib_port_attr_t
\r
560 * Information about a port on a given channel adapter.
\r
564 typedef struct _ib_port_attr
\r
566 ib_net64_t port_guid;
\r
569 uint64_t max_msg_size;
\r
574 * LinkWidthSupported as defined in PortInfo. Required to calculate
\r
575 * inter-packet delay (a.k.a. static rate).
\r
577 uint8_t link_width_supported;
\r
583 uint8_t link_state;
\r
585 ib_init_type_t init_type_reply; /* Optional */
\r
589 * The maximum expected subnet propagation delay to reach any port on
\r
590 * the subnet. This value also determines the rate at which traps can
\r
591 * be generated from this node.
\r
593 * timeout = 4.096 microseconds * 2^subnet_timeout
\r
595 uint8_t subnet_timeout;
\r
602 uint16_t num_pkeys;
\r
604 * Pointers at the end of the structure to allow doing a simple
\r
605 * memory comparison of contents up to the first pointer.
\r
607 TO_LONG_PTR(ib_gid_t* , p_gid_table) ;
\r
608 TO_LONG_PTR(ib_net16_t* , p_pkey_table) ;
\r
613 * uint8_t, ib_port_cap_t, ib_link_states_t
\r
617 /****s* Access Layer/ib_ca_attr_t
\r
622 * Information about a channel adapter.
\r
626 typedef struct _ib_ca_attr
\r
628 ib_net64_t ca_guid;
\r
636 * Total size of the ca attributes in bytes
\r
643 uint32_t max_rd_sges;
\r
650 uint32_t init_regions;
\r
651 uint64_t init_region_size;
\r
653 uint32_t init_windows;
\r
654 uint32_t max_addr_handles;
\r
656 uint32_t max_partitions;
\r
658 ib_atomic_t atomicity;
\r
660 uint8_t max_qp_resp_res;
\r
661 uint8_t max_resp_res;
\r
663 uint8_t max_qp_init_depth;
\r
665 uint32_t max_ipv6_qps;
\r
666 uint32_t max_ether_qps;
\r
668 uint32_t max_mcast_grps;
\r
669 uint32_t max_mcast_qps;
\r
670 uint32_t max_qps_per_mcast_grp;
\r
672 uint32_t max_map_per_fmr;
\r
674 uint32_t max_srq_wrs;
\r
675 uint32_t max_srq_sges;
\r
679 * Specifies the maximum time interval between the local CA receiving
\r
680 * a message and the transmission of the associated ACK or NAK.
\r
682 * timeout = 4.096 microseconds * 2^local_ack_delay
\r
684 uint8_t local_ack_delay;
\r
686 boolean_t bad_pkey_ctr_support;
\r
687 boolean_t bad_qkey_ctr_support;
\r
688 boolean_t raw_mcast_support;
\r
689 boolean_t apm_support;
\r
690 boolean_t av_port_check;
\r
691 boolean_t change_primary_port;
\r
692 boolean_t modify_wr_depth;
\r
693 boolean_t modify_srq_depth;
\r
694 boolean_t current_qp_state_support;
\r
695 boolean_t shutdown_port_capability;
\r
696 boolean_t init_type_support;
\r
697 boolean_t port_active_event_support;
\r
698 boolean_t system_image_guid_support;
\r
699 boolean_t hw_agents;
\r
701 ib_net64_t system_image_guid;
\r
703 uint32_t num_page_sizes;
\r
706 TO_LONG_PTR(uint32_t* , p_page_size) ;
\r
707 TO_LONG_PTR(ib_port_attr_t* , p_port_attr) ;
\r
713 * GUID for this adapter.
\r
716 * IEEE vendor ID for this adapter
\r
719 * Device ID of this adapter. (typically from PCI device ID)
\r
722 * Revision ID of this adapter
\r
725 * Device Firmware version.
\r
728 * Total size in bytes for the HCA attributes. This size includes total
\r
729 * size required for all the variable members of the structure. If a
\r
730 * vendor requires to pass vendor specific fields beyond this structure,
\r
731 * the HCA vendor can choose to report a larger size. If a vendor is
\r
732 * reporting extended vendor specific features, they should also provide
\r
733 * appropriate access functions to aid with the required interpretation.
\r
736 * Maximum number of QP's supported by this HCA.
\r
739 * Maximum number of work requests supported by this HCA.
\r
742 * Maximum number of scatter gather elements supported per work request.
\r
745 * Maximum number of scatter gather elements supported for READ work
\r
746 * requests for a Reliable Datagram QP. This value must be zero if RD
\r
747 * service is not supported.
\r
750 * Maximum number of Completion Queues supported.
\r
753 * Maximum number of CQ elements supported per CQ.
\r
756 * Maximum number of protection domains supported.
\r
759 * Initial number of memory regions supported. These are only informative
\r
760 * values. HCA vendors can extended and grow these limits on demand.
\r
763 * Initial limit on the size of the registered memory region.
\r
766 * Initial number of window entries supported.
\r
769 * Maximum number of address handles supported.
\r
772 * Maximum number of partitions supported.
\r
775 * Indicates level of atomic operations supported by this HCA.
\r
778 * Maximum limit on number of responder resources for incomming RDMA
\r
779 * operations on QPs.
\r
782 * Maximum number of Fast Memory Regions supported.
\r
785 * Maximum number of mappings, supported by a Fast Memory Region.
\r
788 * Maximum number of Shared Receive Queues supported.
\r
791 * Maximum number of work requests supported by this SRQ.
\r
794 * Maximum number of scatter gather elements supported per work request on SRQ.
\r
797 * Maximum number of responder resources per HCA, with this HCA used as
\r
800 * max_qp_init_depth
\r
801 * Maximimum initiator depth per QP for initiating RDMA reads and
\r
802 * atomic operations.
\r
806 * Maximum number of IPV6 and raw ether QP's supported by this HCA.
\r
809 * Maximum number of multicast groups supported.
\r
812 * Maximum number of QP's that can support multicast operations.
\r
814 * max_qps_per_mcast_grp
\r
815 * Maximum number of multicast QP's per multicast group.
\r
818 * Specifies the maximum time interval between the local CA receiving
\r
819 * a message and the transmission of the associated ACK or NAK.
\r
820 * timeout = 4.096 microseconds * 2^local_ack_delay
\r
822 * bad_pkey_ctr_support
\r
823 * bad_qkey_ctr_support
\r
824 * Indicates support for the bad pkey and qkey counters.
\r
826 * raw_mcast_support
\r
827 * Indicates support for raw packet multicast.
\r
830 * Indicates support for Automatic Path Migration.
\r
833 * Indicates ability to check port number in address handles.
\r
835 * change_primary_port
\r
836 * Indicates ability to change primary port for a QP during a
\r
837 * SQD->RTS transition.
\r
840 * Indicates ability to modify QP depth during a modify QP operation.
\r
841 * Check the verb specification for permitted states.
\r
844 * Indicates ability to modify SRQ depth during a modify SRQ operation.
\r
845 * Check the verb specification for permitted states.
\r
847 * current_qp_state_support
\r
848 * Indicates ability of the HCA to support the current QP state modifier
\r
849 * during a modify QP operation.
\r
851 * shutdown_port_capability
\r
852 * Shutdown port capability support indicator.
\r
854 * init_type_support
\r
855 * Indicates init_type_reply and ability to set init_type is supported.
\r
857 * port_active_event_support
\r
858 * Port active event support indicator.
\r
860 * system_image_guid_support
\r
861 * System image GUID support indicator.
\r
864 * Indicates SMA is implemented in HW.
\r
866 * system_image_guid
\r
867 * Optional system image GUID. This field is valid only if the
\r
868 * system_image_guid_support flag is set.
\r
871 * Indicates support for different page sizes supported by the HCA.
\r
872 * The variable size array can be obtained from p_page_size.
\r
875 * Number of physical ports supported on this HCA.
\r
878 * Array holding different page size supported.
\r
881 * Array holding port attributes.
\r
884 * This structure contains the attributes of a channel adapter. Users must
\r
885 * call ib_copy_ca_attr to copy the contents of this structure to a new
\r
889 * ib_port_attr_t, ib_atomic_t, ib_copy_ca_attr
\r
892 /****f* Access layer/ib_copy_ca_attr
\r
897 * Copies CA attributes.
\r
901 AL_EXPORT ib_ca_attr_t* AL_API
\r
903 IN ib_ca_attr_t* const p_dest,
\r
904 IN const ib_ca_attr_t* const p_src );
\r
908 * Pointer to the buffer that is the destination of the copy.
\r
911 * Pointer to the CA attributes to copy.
\r
914 * Pointer to the copied CA attributes.
\r
917 * The buffer pointed to by the p_dest parameter must be at least the size
\r
918 * specified in the size field of the buffer pointed to by p_src.
\r
921 * ib_ca_attr_t, ib_dup_ca_attr, ib_free_ca_attr
\r
925 /****d* Access Layer/ib_pd_type_t
\r
930 * Indicates the type of protection domain being allocated.
\r
934 typedef enum _ib_pd_type
\r
944 * Protection domain for all non-aliased QPs.
\r
947 * Protection domain for IB_QPT_QP0_ALIAS and IB_QPT_QP1_ALIAS QPs.
\r
950 * Protection domain for special queue pair usage.
\r
954 /****s* Access Layer/ib_av_attr_t
\r
959 * IBA address vector.
\r
963 typedef struct _ib_av_attr
\r
970 boolean_t grh_valid;
\r
972 uint8_t static_rate;
\r
978 uint8_t local_ack_timeout;
\r
979 uint8_t seq_err_retry_cnt;
\r
980 uint8_t rnr_retry_cnt;
\r
991 /****d* Access Layer/ib_qp_type_t
\r
996 * Indicates the type of queue pair being created.
\r
1000 typedef enum _ib_qp_type
\r
1002 IB_QPT_RELIABLE_CONN = 0, /* Matches CM REQ transport type */
\r
1003 IB_QPT_UNRELIABLE_CONN = 1, /* Matches CM REQ transport type */
\r
1004 IB_QPT_UNRELIABLE_DGRM = 3, /* Purposefully skip RDD type. */
\r
1009 IB_QPT_MAD, /* InfiniBand Access Layer */
\r
1010 IB_QPT_QP0_ALIAS, /* InfiniBand Access Layer */
\r
1011 IB_QPT_QP1_ALIAS /* InfiniBand Access Layer */
\r
1016 * IB_QPT_RELIABLE_CONN
\r
1017 * Reliable, connected queue pair.
\r
1019 * IB_QPT_UNRELIABLE_CONN
\r
1020 * Unreliable, connected queue pair.
\r
1022 * IB_QPT_UNRELIABLE_DGRM
\r
1023 * Unreliable, datagram queue pair.
\r
1032 * Raw datagram queue pair.
\r
1035 * Raw IP version 6 queue pair.
\r
1037 * IB_QPT_RAW_ETHER
\r
1038 * Raw Ethernet queue pair.
\r
1041 * Unreliable, datagram queue pair that will send and receive management
\r
1042 * datagrams with assistance from the access layer.
\r
1044 * IB_QPT_QP0_ALIAS
\r
1045 * Alias to queue pair 0. Aliased QPs can only be created on an aliased
\r
1046 * protection domain.
\r
1048 * IB_QPT_QP1_ALIAS
\r
1049 * Alias to queue pair 1. Aliased QPs can only be created on an aliased
\r
1050 * protection domain.
\r
1054 /****d* Access Layer/ib_access_t
\r
1059 * Indicates the type of access is permitted on resources such as QPs,
\r
1060 * memory regions and memory windows.
\r
1064 typedef uint32_t ib_access_t;
\r
1065 #define IB_AC_RDMA_READ 0x00000001
\r
1066 #define IB_AC_RDMA_WRITE 0x00000002
\r
1067 #define IB_AC_ATOMIC 0x00000004
\r
1068 #define IB_AC_LOCAL_WRITE 0x00000008
\r
1069 #define IB_AC_MW_BIND 0x00000010
\r
1072 * Users may combine access rights using a bit-wise or operation to specify
\r
1073 * additional access. For example: IB_AC_RDMA_READ | IB_AC_RDMA_WRITE grants
\r
1074 * RDMA read and write access.
\r
1078 /****d* Access Layer/ib_qp_state_t
\r
1083 * Indicates or sets the state of a queue pair. The current state of a queue
\r
1084 * pair is returned through the ib_qp_query call and set via the
\r
1085 * ib_qp_modify call.
\r
1089 typedef uint32_t ib_qp_state_t;
\r
1090 #define IB_QPS_RESET 0x00000001
\r
1091 #define IB_QPS_INIT 0x00000002
\r
1092 #define IB_QPS_RTR 0x00000004
\r
1093 #define IB_QPS_RTS 0x00000008
\r
1094 #define IB_QPS_SQD 0x00000010
\r
1095 #define IB_QPS_SQD_DRAINING 0x00000030
\r
1096 #define IB_QPS_SQD_DRAINED 0x00000050
\r
1097 #define IB_QPS_SQERR 0x00000080
\r
1098 #define IB_QPS_ERROR 0x00000100
\r
1099 #define IB_QPS_TIME_WAIT 0xDEAD0000 /* InfiniBand Access Layer */
\r
1103 /****d* Access Layer/ib_apm_state_t
\r
1108 * The current automatic path migration state of a queue pair
\r
1112 typedef enum _ib_apm_state
\r
1114 IB_APM_MIGRATED = 1,
\r
1121 /****d* Access Layer/ib_srq_attr_mask_t
\r
1123 * ib_srq_attr_mask_t
\r
1126 * Indicates valid fields in ib_srq_attr_t structure
\r
1130 typedef enum _ib_srq_attr_mask {
\r
1131 IB_SRQ_MAX_WR = 1 << 0,
\r
1132 IB_SRQ_LIMIT = 1 << 1,
\r
1133 } ib_srq_attr_mask_t;
\r
1137 /****s* Access Layer/ib_srq_attr_t
\r
1142 * Attributes used to initialize a shared queue pair at creation time.
\r
1146 typedef struct _ib_srq_attr {
\r
1149 uint32_t srq_limit;
\r
1154 * Specifies the max number of work request on SRQ.
\r
1157 * Specifies the max number of scatter/gather elements in one work request.
\r
1160 * Specifies the low water mark for SRQ.
\r
1163 * ib_qp_type_t, ib_srq_attr_mask_t
\r
1168 /****s* Access Layer/ib_qp_create_t
\r
1173 * Attributes used to initialize a queue pair at creation time.
\r
1177 typedef struct _ib_qp_create
\r
1179 ib_qp_type_t qp_type;
\r
1181 uint32_t sq_depth;
\r
1182 uint32_t rq_depth;
\r
1186 TO_LONG_PTR( struct _ib_cq* , h_sq_cq) ;
\r
1187 TO_LONG_PTR( struct _ib_cq* , h_rq_cq) ;
\r
1188 TO_LONG_PTR( struct _ib_srq* , h_srq) ;
\r
1190 boolean_t sq_signaled;
\r
1196 * Specifies the type of queue pair to create.
\r
1199 * Indicates the requested maximum number of work requests that may be
\r
1200 * outstanding on the queue pair's send queue. This value must be less
\r
1201 * than or equal to the maximum reported by the channel adapter associated
\r
1202 * with the queue pair.
\r
1205 * Indicates the requested maximum number of work requests that may be
\r
1206 * outstanding on the queue pair's receive queue. This value must be less
\r
1207 * than or equal to the maximum reported by the channel adapter associated
\r
1208 * with the queue pair.
\r
1211 * Indicates the maximum number scatter-gather elements that may be
\r
1212 * given in a send work request. This value must be less
\r
1213 * than or equal to the maximum reported by the channel adapter associated
\r
1214 * with the queue pair.
\r
1217 * Indicates the maximum number scatter-gather elements that may be
\r
1218 * given in a receive work request. This value must be less
\r
1219 * than or equal to the maximum reported by the channel adapter associated
\r
1220 * with the queue pair.
\r
1223 * A handle to the completion queue that will be used to report send work
\r
1224 * request completions. This handle must be NULL if the type is
\r
1225 * IB_QPT_MAD, IB_QPT_QP0_ALIAS, or IB_QPT_QP1_ALIAS.
\r
1228 * A handle to the completion queue that will be used to report receive
\r
1229 * work request completions. This handle must be NULL if the type is
\r
1230 * IB_QPT_MAD, IB_QPT_QP0_ALIAS, or IB_QPT_QP1_ALIAS.
\r
1233 * A handle to an SRQ to get receive completions via. Must be coded NULL
\r
1234 * when QP is not associated with SRQ
\r
1237 * A flag that is used to indicate whether the queue pair will signal
\r
1238 * an event upon completion of a send work request. If set to
\r
1239 * TRUE, send work requests will always generate a completion
\r
1240 * event. If set to FALSE, a completion event will only be
\r
1241 * generated if the send_opt field of the send work request has the
\r
1242 * IB_SEND_OPT_SIGNALED flag set.
\r
1245 * ib_qp_type_t, ib_qp_attr_t
\r
1249 /****s* Access Layer/ib_qp_attr_t
\r
1254 * Queue pair attributes returned through ib_query_qp.
\r
1258 typedef struct _ib_qp_attr
\r
1260 TO_LONG_PTR( struct _ib_pd* , h_pd) ;
\r
1261 ib_qp_type_t qp_type;
\r
1262 ib_access_t access_ctrl;
\r
1263 uint16_t pkey_index;
\r
1265 uint32_t sq_max_inline;
\r
1266 uint32_t sq_depth;
\r
1267 uint32_t rq_depth;
\r
1270 uint8_t init_depth;
\r
1273 TO_LONG_PTR( struct ib_cq* , h_sq_cq) ;
\r
1274 TO_LONG_PTR( struct ib_cq* , h_rq_cq) ;
\r
1275 TO_LONG_PTR( struct ib_srq* , h_srq) ;
\r
1277 boolean_t sq_signaled;
\r
1279 ib_qp_state_t state;
\r
1281 ib_net32_t dest_num;
\r
1284 ib_net32_t sq_psn;
\r
1285 ib_net32_t rq_psn;
\r
1287 uint8_t primary_port;
\r
1288 uint8_t alternate_port;
\r
1289 ib_av_attr_t primary_av;
\r
1290 ib_av_attr_t alternate_av;
\r
1291 ib_apm_state_t apm_state;
\r
1297 * This is a handle to a protection domain associated with the QP.
\r
1300 * Maximum payload that can be inlined directly in a WQE, eliminating
\r
1301 * protection checks and additional DMA operations.
\r
1304 * Other fields are defined by the Infiniband specification.
\r
1307 * ib_qp_type_t, ib_access_t, ib_qp_state_t, ib_av_attr_t, ib_apm_state_t
\r
1311 /****d* Access Layer/ib_qp_opts_t
\r
1316 * Optional fields supplied in the modify QP operation.
\r
1320 typedef uint32_t ib_qp_opts_t;
\r
1321 #define IB_MOD_QP_ALTERNATE_AV 0x00000001
\r
1322 #define IB_MOD_QP_PKEY 0x00000002
\r
1323 #define IB_MOD_QP_APM_STATE 0x00000004
\r
1324 #define IB_MOD_QP_PRIMARY_AV 0x00000008
\r
1325 #define IB_MOD_QP_RNR_NAK_TIMEOUT 0x00000010
\r
1326 #define IB_MOD_QP_RESP_RES 0x00000020
\r
1327 #define IB_MOD_QP_INIT_DEPTH 0x00000040
\r
1328 #define IB_MOD_QP_PRIMARY_PORT 0x00000080
\r
1329 #define IB_MOD_QP_ACCESS_CTRL 0x00000100
\r
1330 #define IB_MOD_QP_QKEY 0x00000200
\r
1331 #define IB_MOD_QP_SQ_DEPTH 0x00000400
\r
1332 #define IB_MOD_QP_RQ_DEPTH 0x00000800
\r
1333 #define IB_MOD_QP_CURRENT_STATE 0x00001000
\r
1334 #define IB_MOD_QP_RETRY_CNT 0x00002000
\r
1335 #define IB_MOD_QP_LOCAL_ACK_TIMEOUT 0x00004000
\r
1336 #define IB_MOD_QP_RNR_RETRY_CNT 0x00008000
\r
1344 /****s* Access Layer/ib_qp_mod_t
\r
1349 * Information needed to change the state of a queue pair through the
\r
1350 * ib_modify_qp call.
\r
1354 typedef struct _ib_qp_mod
\r
1356 ib_qp_state_t req_state;
\r
1362 ib_qp_opts_t opts;
\r
1363 uint8_t primary_port;
\r
1365 uint16_t pkey_index;
\r
1366 ib_access_t access_ctrl;
\r
1372 ib_net32_t rq_psn;
\r
1373 ib_net32_t dest_qp;
\r
1374 ib_av_attr_t primary_av;
\r
1376 uint8_t rnr_nak_timeout;
\r
1378 ib_qp_opts_t opts;
\r
1379 ib_av_attr_t alternate_av;
\r
1381 uint16_t pkey_index;
\r
1382 ib_access_t access_ctrl;
\r
1383 uint32_t sq_depth;
\r
1384 uint32_t rq_depth;
\r
1390 ib_net32_t sq_psn;
\r
1391 uint8_t retry_cnt;
\r
1392 uint8_t rnr_retry_cnt;
\r
1393 uint8_t local_ack_timeout;
\r
1394 uint8_t init_depth;
\r
1396 ib_qp_opts_t opts;
\r
1397 uint8_t rnr_nak_timeout;
\r
1398 ib_qp_state_t current_state;
\r
1400 ib_access_t access_ctrl;
\r
1403 ib_av_attr_t primary_av;
\r
1404 ib_av_attr_t alternate_av;
\r
1406 uint32_t sq_depth;
\r
1407 uint32_t rq_depth;
\r
1409 ib_apm_state_t apm_state;
\r
1410 uint8_t primary_port;
\r
1411 uint16_t pkey_index;
\r
1417 boolean_t sqd_event;
\r
1426 * ib_qp_state_t, ib_access_t, ib_av_attr_t, ib_apm_state_t
\r
1430 /****d* Access Layer/ib_wr_type_t
\r
1435 * Identifies the type of work request posted to a queue pair.
\r
1439 typedef enum _ib_wr_type_t
\r
1451 /****s* Access Layer/ib_local_ds_t
\r
1456 * Local data segment information referenced by send and receive work
\r
1457 * requests. This is used to specify local data buffers used as part of a
\r
1462 typedef struct _ib_local_ds
\r
1472 /****d* Access Layer/ib_send_opt_t
\r
1477 * Optional flags used when posting send work requests. These flags
\r
1478 * indicate specific processing for the send operation.
\r
1482 typedef uint32_t ib_send_opt_t;
\r
1483 #define IB_SEND_OPT_IMMEDIATE 0x00000001
\r
1484 #define IB_SEND_OPT_FENCE 0x00000002
\r
1485 #define IB_SEND_OPT_SIGNALED 0x00000004
\r
1486 #define IB_SEND_OPT_SOLICITED 0x00000008
\r
1487 #define IB_SEND_OPT_INLINE 0x00000010
\r
1488 #define IB_SEND_OPT_LOCAL 0x00000020
\r
1489 #define IB_SEND_OPT_VEND_MASK 0xFFFF0000
\r
1492 * The following flags determine the behavior of a work request when
\r
1493 * posted to the send side.
\r
1495 * IB_SEND_OPT_IMMEDIATE
\r
1496 * Send immediate data with the given request.
\r
1498 * IB_SEND_OPT_FENCE
\r
1499 * The operation is fenced. Complete all pending send operations before
\r
1500 * processing this request.
\r
1502 * IB_SEND_OPT_SIGNALED
\r
1503 * If the queue pair is configured for signaled completion, then
\r
1504 * generate a completion queue entry when this request completes.
\r
1506 * IB_SEND_OPT_SOLICITED
\r
1507 * Set the solicited bit on the last packet of this request.
\r
1509 * IB_SEND_OPT_INLINE
\r
1510 * Indicates that the requested send data should be copied into a VPD
\r
1511 * owned data buffer. This flag permits the user to issue send operations
\r
1512 * without first needing to register the buffer(s) associated with the
\r
1513 * send operation. Verb providers that support this operation may place
\r
1514 * vendor specific restrictions on the size of send operation that may
\r
1515 * be performed as inline.
\r
1517 * IB_SEND_OPT_LOCAL
\r
1518 * Indicates that a sent MAD request should be given to the local VPD for
\r
1519 * processing. MADs sent using this option are not placed on the wire.
\r
1520 * This send option is only valid for MAD send operations.
\r
1522 * IB_SEND_OPT_VEND_MASK
\r
1523 * This mask indicates bits reserved in the send options that may be used
\r
1524 * by the verbs provider to indicate vendor specific options. Bits set
\r
1525 * in this area of the send options are ignored by the Access Layer, but
\r
1526 * may have specific meaning to the underlying VPD.
\r
1531 /****s* Access Layer/ib_send_wr_t
\r
1536 * Information used to submit a work request to the send queue of a queue
\r
1541 typedef struct _ib_send_wr
\r
1543 TO_LONG_PTR(struct _ib_send_wr* , p_next) ;
\r
1545 ib_wr_type_t wr_type;
\r
1546 ib_send_opt_t send_opt;
\r
1548 TO_LONG_PTR(ib_local_ds_t* , ds_array) ;
\r
1549 ib_net32_t immediate_data;
\r
1555 ib_net32_t remote_qp;
\r
1556 ib_net32_t remote_qkey;
\r
1557 TO_LONG_PTR( struct _ib_av* , h_av) ;
\r
1558 uint16_t pkey_index;
\r
1559 TO_LONG_PTR(void* , rsvd) ;
\r
1563 struct _send_raw_ether
\r
1565 ib_net16_t dest_lid;
\r
1566 uint8_t path_bits;
\r
1568 uint8_t max_static_rate;
\r
1569 ib_net16_t ether_type;
\r
1573 struct _send_raw_ipv6
\r
1575 ib_net16_t dest_lid;
\r
1576 uint8_t path_bits;
\r
1578 uint8_t max_static_rate;
\r
1584 struct _send_remote_ops
\r
1589 ib_net64_t atomic1;
\r
1590 ib_net64_t atomic2;
\r
1598 * A pointer used to chain work requests together. This permits multiple
\r
1599 * work requests to be posted to a queue pair through a single function
\r
1600 * call. This value is set to NULL to mark the end of the chain.
\r
1603 * A 64-bit work request identifier that is returned to the consumer
\r
1604 * as part of the work completion.
\r
1607 * The type of work request being submitted to the send queue.
\r
1610 * Optional send control parameters.
\r
1613 * Number of local data segments specified by this work request.
\r
1616 * A reference to an array of local data segments used by the send
\r
1620 * 32-bit field sent as part of a message send or RDMA write operation.
\r
1621 * This field is only valid if the send_opt flag IB_SEND_OPT_IMMEDIATE
\r
1624 * dgrm.ud.remote_qp
\r
1625 * Identifies the destination queue pair of an unreliable datagram send
\r
1628 * dgrm.ud.remote_qkey
\r
1629 * The qkey for the destination queue pair.
\r
1632 * An address vector that specifies the path information used to route
\r
1633 * the outbound datagram to the destination queue pair.
\r
1635 * dgrm.ud.pkey_index
\r
1636 * The pkey index for this send work request. This is valid only
\r
1637 * for IB_QPT_QP1 and IB_QPT_QP1_ALIAS QP types. The work request
\r
1638 * is posted to using this pkey index build the GMP's BTH instead
\r
1639 * of the QP's pkey.
\r
1642 * Reserved for use by the Access Layer.
\r
1644 * dgrm.raw_ether.dest_lid
\r
1645 * The destination LID that will receive this raw ether send.
\r
1647 * dgrm.raw_ether.path_bits
\r
1650 * dgrm.raw_ether.sl
\r
1651 * service level...
\r
1653 * dgrm.raw_ether.max_static_rate
\r
1656 * dgrm.raw_ether.ether_type
\r
1659 * dgrm.raw_ipv6.dest_lid
\r
1660 * The destination LID that will receive this raw ether send.
\r
1662 * dgrm.raw_ipv6.path_bits
\r
1665 * dgrm.raw_ipv6.sl
\r
1666 * service level...
\r
1668 * dgrm.raw_ipv6.max_static_rate
\r
1671 * remote_ops.vaddr
\r
1672 * The registered virtual memory address of the remote memory to access
\r
1673 * with an RDMA or atomic operation.
\r
1676 * The rkey associated with the specified remote vaddr. This data must
\r
1677 * be presented exactly as obtained from the remote node. No swapping
\r
1678 * of data must be performed.
\r
1681 * The first operand for an atomic operation.
\r
1684 * The second operand for an atomic operation.
\r
1687 * The format of data sent over the fabric is user-defined and is considered
\r
1688 * opaque to the access layer. The sole exception to this are MADs posted
\r
1689 * to a MAD QP service. MADs are expected to match the format defined by
\r
1690 * the Infiniband specification and must be in network-byte order when posted
\r
1691 * to the MAD QP service.
\r
1694 * ib_wr_type_t, ib_local_ds_t, ib_send_opt_t
\r
1698 /****s* Access Layer/ib_recv_wr_t
\r
1703 * Information used to submit a work request to the receive queue of a queue
\r
1708 typedef struct _ib_recv_wr
\r
1710 TO_LONG_PTR(struct _ib_recv_wr* , p_next) ;
\r
1713 TO_LONG_PTR(ib_local_ds_t* , ds_array) ;
\r
1719 * A pointer used to chain work requests together. This permits multiple
\r
1720 * work requests to be posted to a queue pair through a single function
\r
1721 * call. This value is set to NULL to mark the end of the chain.
\r
1724 * A 64-bit work request identifier that is returned to the consumer
\r
1725 * as part of the work completion.
\r
1728 * Number of local data segments specified by this work request.
\r
1731 * A reference to an array of local data segments used by the send
\r
1739 /****s* Access Layer/ib_bind_wr_t
\r
1744 * Information used to submit a memory window bind work request to the send
\r
1745 * queue of a queue pair.
\r
1749 typedef struct _ib_bind_wr
\r
1752 ib_send_opt_t send_opt;
\r
1754 TO_LONG_PTR( struct _ib_mr* , h_mr) ;
\r
1755 ib_access_t access_ctrl;
\r
1756 net32_t current_rkey;
\r
1758 ib_local_ds_t local_ds;
\r
1764 * A 64-bit work request identifier that is returned to the consumer
\r
1765 * as part of the work completion.
\r
1768 * Optional send control parameters.
\r
1771 * Handle to the memory region to which this window is being bound.
\r
1774 * Access rights for this memory window.
\r
1777 * The current rkey assigned to this window for remote access.
\r
1780 * A reference to a local data segment used by the bind operation.
\r
1783 * ib_send_opt_t, ib_access_t, ib_local_ds_t
\r
1787 /****d* Access Layer/ib_wc_status_t
\r
1792 * Indicates the status of a completed work request. These VALUES are
\r
1793 * returned to the user when retrieving completions. Note that success is
\r
1794 * identified as IB_WCS_SUCCESS, which is always zero.
\r
1798 typedef enum _ib_wc_status_t
\r
1801 IB_WCS_LOCAL_LEN_ERR,
\r
1802 IB_WCS_LOCAL_OP_ERR,
\r
1803 IB_WCS_LOCAL_PROTECTION_ERR,
\r
1804 IB_WCS_WR_FLUSHED_ERR,
\r
1805 IB_WCS_MEM_WINDOW_BIND_ERR,
\r
1806 IB_WCS_REM_ACCESS_ERR,
\r
1807 IB_WCS_REM_OP_ERR,
\r
1808 IB_WCS_RNR_RETRY_ERR,
\r
1809 IB_WCS_TIMEOUT_RETRY_ERR,
\r
1810 IB_WCS_REM_INVALID_REQ_ERR,
\r
1811 IB_WCS_UNMATCHED_RESPONSE, /* InfiniBand Access Layer */
\r
1812 IB_WCS_CANCELED, /* InfiniBand Access Layer */
\r
1813 IB_WCS_REM_ABORT_ERR,
\r
1814 IB_WCS_UNKNOWN /* Must be last. */
\r
1821 * Work request completed successfully.
\r
1824 * The completed work request was associated with a managmenet datagram
\r
1825 * that requires post processing. The MAD will be returned to the user
\r
1826 * through a callback once all post processing has completed.
\r
1828 * IB_WCS_LOCAL_LEN_ERR
\r
1829 * Generated for a work request posted to the send queue when the
\r
1830 * total of the data segment lengths exceeds the message length of the
\r
1831 * channel. Generated for a work request posted to the receive queue when
\r
1832 * the total of the data segment lengths is too small for a
\r
1833 * valid incoming message.
\r
1835 * IB_WCS_LOCAL_OP_ERR
\r
1836 * An internal QP consistency error was generated while processing this
\r
1837 * work request. This may indicate that the QP was in an incorrect state
\r
1838 * for the requested operation.
\r
1840 * IB_WCS_LOCAL_PROTECTION_ERR
\r
1841 * The data segments of the locally posted work request did not refer to
\r
1842 * a valid memory region. The memory may not have been properly
\r
1843 * registered for the requested operation.
\r
1845 * IB_WCS_WR_FLUSHED_ERR
\r
1846 * The work request was flushed from the QP before being completed.
\r
1848 * IB_WCS_MEM_WINDOW_BIND_ERR
\r
1849 * A memory window bind operation failed due to insufficient access
\r
1852 * IB_WCS_REM_ACCESS_ERR,
\r
1853 * A protection error was detected at the remote node for a RDMA or atomic
\r
1856 * IB_WCS_REM_OP_ERR,
\r
1857 * The operation could not be successfully completed at the remote node.
\r
1858 * This may indicate that the remote QP was in an invalid state or
\r
1859 * contained an invalid work request.
\r
1861 * IB_WCS_RNR_RETRY_ERR,
\r
1862 * The RNR retry count was exceeded while trying to send this message.
\r
1864 * IB_WCS_TIMEOUT_RETRY_ERR
\r
1865 * The local transport timeout counter expired while trying to send this
\r
1868 * IB_WCS_REM_INVALID_REQ_ERR,
\r
1869 * The remote node detected an invalid message on the channel. This error
\r
1870 * is usually a result of one of the following:
\r
1871 * - The operation was not supported on receive queue.
\r
1872 * - There was insufficient buffers to receive a new RDMA request.
\r
1873 * - There was insufficient buffers to receive a new atomic operation.
\r
1874 * - An RDMA request was larger than 2^31 bytes.
\r
1876 * IB_WCS_UNMATCHED_RESPONSE
\r
1877 * A response MAD was received for which there was no matching send. The
\r
1878 * send operation may have been canceled by the user or may have timed
\r
1882 * The completed work request was canceled by the user.
\r
1884 * IB_WCS_REM_ABORT_ERR,
\r
1885 * The operation was aborted (e.g., For UD QPs associated with an SRQ,
\r
1886 * the responder aborted the operation).
\r
1893 /****f* IBA Base: Types/ib_get_wc_status_str
\r
1895 * ib_get_wc_status_str
\r
1898 * Returns a string for the specified work completion status.
\r
1902 AL_EXPORT const char* AL_API
\r
1903 ib_get_wc_status_str(
\r
1904 IN ib_wc_status_t wc_status );
\r
1908 * [in] work completion status value
\r
1911 * Pointer to the work completion status description string.
\r
1919 /****d* Access Layer/ib_wc_type_t
\r
1924 * Indicates the type of work completion.
\r
1928 typedef enum _ib_wc_type_t
\r
1936 IB_WC_COMPARE_SWAP,
\r
1937 IB_WC_RECV_RDMA_WRITE,
\r
1944 /****f* IBA Base: Types/ib_get_wc_type_str
\r
1946 * ib_get_wc_type_str
\r
1949 * Returns a string for the specified work completion type.
\r
1953 AL_EXPORT const char* AL_API
\r
1954 ib_get_wc_type_str(
\r
1955 IN ib_wc_type_t wc_type );
\r
1959 * [in] work completion type value
\r
1962 * Pointer to the work completion type description string.
\r
1970 /****d* Access Layer/ib_recv_opt_t
\r
1975 * Indicates optional fields valid in a receive work completion.
\r
1979 typedef uint32_t ib_recv_opt_t;
\r
1980 #define IB_RECV_OPT_IMMEDIATE 0x00000001
\r
1981 #define IB_RECV_OPT_FORWARD 0x00000002
\r
1982 #define IB_RECV_OPT_GRH_VALID 0x00000004
\r
1983 #define IB_RECV_OPT_VEND_MASK 0xFFFF0000
\r
1986 * IB_RECV_OPT_IMMEDIATE
\r
1987 * Indicates that immediate data is valid for this work completion.
\r
1989 * IB_RECV_OPT_FORWARD
\r
1990 * Indicates that the received trap should be forwarded to the SM.
\r
1992 * IB_RECV_OPT_GRH_VALID
\r
1993 * Indicates presence of the global route header. When set, the first
\r
1994 * 40 bytes received are the GRH.
\r
1996 * IB_RECV_OPT_VEND_MASK
\r
1997 * This mask indicates bits reserved in the receive options that may be
\r
1998 * used by the verbs provider to indicate vendor specific options. Bits
\r
1999 * set in this area of the receive options are ignored by the Access Layer,
\r
2000 * but may have specific meaning to the underlying VPD.
\r
2004 /****s* Access Layer/ib_wc_t
\r
2009 * Work completion information.
\r
2013 typedef struct _ib_wc
\r
2015 TO_LONG_PTR(struct _ib_wc* , p_next) ;
\r
2017 ib_wc_type_t wc_type;
\r
2020 ib_wc_status_t status;
\r
2021 uint64_t vendor_specific;
\r
2027 ib_recv_opt_t recv_opt;
\r
2028 ib_net32_t immediate_data;
\r
2034 ib_recv_opt_t recv_opt;
\r
2035 ib_net32_t immediate_data;
\r
2036 ib_net32_t remote_qp;
\r
2037 uint16_t pkey_index;
\r
2038 ib_net16_t remote_lid;
\r
2039 uint8_t remote_sl;
\r
2040 uint8_t path_bits;
\r
2044 struct _wc_raw_ipv6
\r
2046 ib_net16_t remote_lid;
\r
2047 uint8_t remote_sl;
\r
2048 uint8_t path_bits;
\r
2052 struct _wc_raw_ether
\r
2054 ib_net16_t remote_lid;
\r
2055 uint8_t remote_sl;
\r
2056 uint8_t path_bits;
\r
2057 ib_net16_t ether_type;
\r
2067 * A pointer used to chain work completions. This permits multiple
\r
2068 * work completions to be retrieved from a completion queue through a
\r
2069 * single function call. This value is set to NULL to mark the end of
\r
2073 * The 64-bit work request identifier that was specified when posting the
\r
2077 * Indicates the type of work completion.
\r
2080 * The total length of the data sent or received with the work request.
\r
2083 * The result of the work request.
\r
2086 * HCA vendor specific information returned as part of the completion.
\r
2088 * recv.conn.recv_opt
\r
2089 * Indicates optional fields valid as part of a work request that
\r
2090 * completed on a connected (reliable or unreliable) queue pair.
\r
2092 * recv.conn.immediate_data
\r
2093 * 32-bit field received as part of an inbound message on a connected
\r
2094 * queue pair. This field is only valid if the recv_opt flag
\r
2095 * IB_RECV_OPT_IMMEDIATE has been set.
\r
2097 * recv.ud.recv_opt
\r
2098 * Indicates optional fields valid as part of a work request that
\r
2099 * completed on an unreliable datagram queue pair.
\r
2101 * recv.ud.immediate_data
\r
2102 * 32-bit field received as part of an inbound message on a unreliable
\r
2103 * datagram queue pair. This field is only valid if the recv_opt flag
\r
2104 * IB_RECV_OPT_IMMEDIATE has been set.
\r
2106 * recv.ud.remote_qp
\r
2107 * Identifies the source queue pair of a received datagram.
\r
2109 * recv.ud.pkey_index
\r
2110 * The pkey index of the source queue pair. This is valid only for
\r
2111 * IB_QPT_QP1 and IB_QPT_QP1_ALIAS QP types.
\r
2113 * recv.ud.remote_lid
\r
2114 * The source LID of the received datagram.
\r
2116 * recv.ud.remote_sl
\r
2117 * The service level used by the source of the received datagram.
\r
2119 * recv.ud.path_bits
\r
2122 * recv.raw_ipv6.remote_lid
\r
2123 * The source LID of the received message.
\r
2125 * recv.raw_ipv6.remote_sl
\r
2126 * The service level used by the source of the received message.
\r
2128 * recv.raw_ipv6.path_bits
\r
2131 * recv.raw_ether.remote_lid
\r
2132 * The source LID of the received message.
\r
2134 * recv.raw_ether.remote_sl
\r
2135 * The service level used by the source of the received message.
\r
2137 * recv.raw_ether.path_bits
\r
2140 * recv.raw_ether.ether_type
\r
2143 * When the work request completes with error, the only values that the
\r
2144 * consumer can depend on are the wr_id field, and the status of the
\r
2147 * If the consumer is using the same CQ for completions from more than
\r
2148 * one type of QP (i.e Reliable Connected, Datagram etc), then the consumer
\r
2149 * must have additional information to decide what fields of the union are
\r
2152 * ib_wc_type_t, ib_qp_type_t, ib_wc_status_t, ib_recv_opt_t
\r
2156 /****s* Access Layer/ib_mr_create_t
\r
2161 * Information required to create a registered memory region.
\r
2165 typedef struct _ib_mr_create
\r
2167 TO_LONG_PTR(void* , vaddr) ;
\r
2169 ib_access_t access_ctrl;
\r
2175 * Starting virtual address of the region being registered.
\r
2178 * Length of the buffer to register.
\r
2181 * Access rights of the registered region.
\r
2188 /****s* Access Layer/ib_phys_range_t
\r
2193 * Information describing a physical memory range.
\r
2197 typedef struct _ib_phys_range
\r
2199 uint64_t base_addr;
\r
2202 } ib_phys_range_t;
\r
2206 * Physical address of the base of the memory range.
\r
2209 * size, in bytes, of the memory range.
\r
2212 * The base address must be start and end on an HCA-supported page boundary.
\r
2215 * ib_phys_create_t
\r
2219 /****s* Access Layer/ib_phys_create_t
\r
2221 * ib_phys_create_t
\r
2224 * Information required to create a physical memory region.
\r
2228 typedef struct _ib_phys_create
\r
2231 uint32_t num_ranges;
\r
2232 TO_LONG_PTR(ib_phys_range_t* , range_array) ;
\r
2233 uint32_t buf_offset;
\r
2234 uint32_t hca_page_size;
\r
2235 ib_access_t access_ctrl;
\r
2237 } ib_phys_create_t;
\r
2241 * The length of the memory region in bytes.
\r
2244 * Number of ib_phys_range structures listed in the specified range array.
\r
2247 * An array of ib_phys_range structures to be registered as a single memory
\r
2251 * The offset into the first physical memory range of the specified memory
\r
2252 * region on which to start the virtual address.
\r
2255 * The HCA page size to use to register the memory.
\r
2258 * Access rights of the registered region.
\r
2265 /****s* Access Layer/ib_mr_attr_t
\r
2270 * Attributes of a registered memory region.
\r
2274 typedef struct _ib_mr_attr
\r
2276 TO_LONG_PTR( struct ib_pd* , h_pd) ;
\r
2277 uint64_t local_lb;
\r
2278 uint64_t local_ub;
\r
2279 uint64_t remote_lb;
\r
2280 uint64_t remote_ub;
\r
2281 ib_access_t access_ctrl;
\r
2289 * Handle to the protection domain for this memory region.
\r
2292 * The virtual address of the lower bound of protection for local
\r
2293 * memory access. This is always a 64-bit quantity to support registering
\r
2294 * more than 4GB of memory on 32-bit systems with PAE.
\r
2297 * The virtual address of the upper bound of protection for local
\r
2298 * memory access. This is always a 64-bit quantity to support registering
\r
2299 * more than 4GB of memory on 32-bit systems with PAE.
\r
2302 * The virtual address of the lower bound of protection for remote
\r
2303 * memory access. This is always a 64-bit quantity to support registering
\r
2304 * more than 4GB of memory on 32-bit systems with PAE.
\r
2307 * The virtual address of the upper bound of protection for remote
\r
2308 * memory access. This is always a 64-bit quantity to support registering
\r
2309 * more than 4GB of memory on 32-bit systems with PAE.
\r
2312 * Access rights for the specified memory region.
\r
2315 * The lkey associated with this memory region.
\r
2318 * The rkey associated with this memory region.
\r
2321 * The remote_lb, remote_ub, and rkey are only valid if remote memory access
\r
2322 * is enabled for this memory region.
\r
2329 /****d* Access Layer/ib_ca_mod_t
\r
2331 * ib_ca_mod_t -- Modify port attributes and error counters
\r
2334 * Specifies modifications to the port attributes of a channel adapter.
\r
2338 typedef uint32_t ib_ca_mod_t;
\r
2339 #define IB_CA_MOD_IS_CM_SUPPORTED 0x00000001
\r
2340 #define IB_CA_MOD_IS_SNMP_SUPPORTED 0x00000002
\r
2341 #define IB_CA_MOD_IS_DEV_MGMT_SUPPORTED 0x00000004
\r
2342 #define IB_CA_MOD_IS_VEND_SUPPORTED 0x00000008
\r
2343 #define IB_CA_MOD_IS_SM 0x00000010
\r
2344 #define IB_CA_MOD_IS_SM_DISABLED 0x00000020
\r
2345 #define IB_CA_MOD_QKEY_CTR 0x00000040
\r
2346 #define IB_CA_MOD_PKEY_CTR 0x00000080
\r
2347 #define IB_CA_MOD_IS_NOTICE_SUPPORTED 0x00000100
\r
2348 #define IB_CA_MOD_IS_TRAP_SUPPORTED 0x00000200
\r
2349 #define IB_CA_MOD_IS_APM_SUPPORTED 0x00000400
\r
2350 #define IB_CA_MOD_IS_SLMAP_SUPPORTED 0x00000800
\r
2351 #define IB_CA_MOD_IS_PKEY_NVRAM_SUPPORTED 0x00001000
\r
2352 #define IB_CA_MOD_IS_MKEY_NVRAM_SUPPORTED 0x00002000
\r
2353 #define IB_CA_MOD_IS_SYSGUID_SUPPORTED 0x00004000
\r
2354 #define IB_CA_MOD_IS_DR_NOTICE_SUPPORTED 0x00008000
\r
2355 #define IB_CA_MOD_IS_BOOT_MGMT_SUPPORTED 0x00010000
\r
2356 #define IB_CA_MOD_IS_CAPM_NOTICE_SUPPORTED 0x00020000
\r
2357 #define IB_CA_MOD_IS_REINIT_SUPORTED 0x00040000
\r
2358 #define IB_CA_MOD_IS_LEDINFO_SUPPORTED 0x00080000
\r
2359 #define IB_CA_MOD_SHUTDOWN_PORT 0x00100000
\r
2360 #define IB_CA_MOD_INIT_TYPE_VALUE 0x00200000
\r
2361 #define IB_CA_MOD_SYSTEM_IMAGE_GUID 0x00400000
\r
2364 * IB_CA_MOD_IS_CM_SUPPORTED
\r
2365 * Indicates if there is a communication manager accessible through
\r
2368 * IB_CA_MOD_IS_SNMP_SUPPORTED
\r
2369 * Indicates if there is an SNMP agent accessible through the port.
\r
2371 * IB_CA_MOD_IS_DEV_MGMT_SUPPORTED
\r
2372 * Indicates if there is a device management agent accessible through
\r
2375 * IB_CA_MOD_IS_VEND_SUPPORTED
\r
2376 * Indicates if there is a vendor supported agent accessible through
\r
2380 * Indicates if there is a subnet manager accessible through
\r
2383 * IB_CA_MOD_IS_SM_DISABLED
\r
2384 * Indicates if the port has been disabled for configuration by the subnet
\r
2387 * IB_CA_MOD_QKEY_CTR
\r
2388 * Used to reset the qkey violation counter associated with the port.
\r
2390 * IB_CA_MOD_PKEY_CTR
\r
2391 * Used to reset the pkey violation counter associated with the port.
\r
2393 * IB_CA_MOD_IS_NOTICE_SUPPORTED
\r
2394 * Indicates that this CA supports ability to generate Notices for
\r
2395 * Port State changes. (only applicable to switches)
\r
2397 * IB_CA_MOD_IS_TRAP_SUPPORTED
\r
2398 * Indicates that this management port supports ability to generate
\r
2399 * trap messages. (only applicable to switches)
\r
2401 * IB_CA_MOD_IS_APM_SUPPORTED
\r
2402 * Indicates that this port is capable of performing Automatic Migration.
\r
2404 * IB_CA_MOD_IS_SLMAP_SUPPORTED
\r
2405 * Indicates this port supports SLMAP capability.
\r
2407 * IB_CA_MOD_IS_PKEY_NVRAM_SUPPORTED
\r
2408 * Indicates that PKEY is supported in NVRAM
\r
2410 * IB_CA_MOD_IS_MKEY_NVRAM_SUPPORTED
\r
2411 * Indicates that MKEY is supported in NVRAM
\r
2413 * IB_CA_MOD_IS_SYSGUID_SUPPORTED
\r
2414 * Indicates System Image GUID support.
\r
2416 * IB_CA_MOD_IS_DR_NOTICE_SUPPORTED
\r
2417 * Indicate support for generating Direct Routed Notices
\r
2419 * IB_CA_MOD_IS_BOOT_MGMT_SUPPORTED
\r
2420 * Indicates support for Boot Management
\r
2422 * IB_CA_MOD_IS_CAPM_NOTICE_SUPPORTED
\r
2423 * Indicates capability to generate notices for changes to CAPMASK
\r
2425 * IB_CA_MOD_IS_REINIT_SUPORTED
\r
2426 * Indicates type of node init supported. Refer to Chapter 14 for
\r
2427 * Initialization actions.
\r
2429 * IB_CA_MOD_IS_LEDINFO_SUPPORTED
\r
2430 * Indicates support for LED info.
\r
2432 * IB_CA_MOD_SHUTDOWN_PORT
\r
2433 * Used to modify the port active indicator.
\r
2435 * IB_CA_MOD_INIT_TYPE_VALUE
\r
2436 * Used to modify the init_type value for the port.
\r
2438 * IB_CA_MOD_SYSTEM_IMAGE_GUID
\r
2439 * Used to modify the system image GUID for the port.
\r
2443 /****d* Access Layer/ib_mr_mod_t
\r
2448 * Mask used to specify which attributes of a registered memory region are
\r
2453 typedef uint32_t ib_mr_mod_t;
\r
2454 #define IB_MR_MOD_ADDR 0x00000001
\r
2455 #define IB_MR_MOD_PD 0x00000002
\r
2456 #define IB_MR_MOD_ACCESS 0x00000004
\r
2460 * The address of the memory region is being modified.
\r
2463 * The protection domain associated with the memory region is being
\r
2466 * IB_MEM_MOD_ACCESS
\r
2467 * The access rights the memory region are being modified.
\r
2470 /****d* IBA Base: Constants/IB_SMINFO_STATE_INIT
\r
2472 * IB_SMINFO_STATE_INIT
\r
2475 * Encoded state value used in the SMInfo attribute.
\r
2479 #define IB_SMINFO_STATE_INIT 4
\r
2482 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_HANDOVER
\r
2484 * IB_SMINFO_ATTR_MOD_HANDOVER
\r
2487 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
\r
2491 #define IB_SMINFO_ATTR_MOD_HANDOVER (CL_NTOH32(0x000001))
\r
2494 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_ACKNOWLEDGE
\r
2496 * IB_SMINFO_ATTR_MOD_ACKNOWLEDGE
\r
2499 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
\r
2503 #define IB_SMINFO_ATTR_MOD_ACKNOWLEDGE (CL_NTOH32(0x000002))
\r
2506 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_DISABLE
\r
2508 * IB_SMINFO_ATTR_MOD_DISABLE
\r
2511 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
\r
2515 #define IB_SMINFO_ATTR_MOD_DISABLE (CL_NTOH32(0x000003))
\r
2518 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_STANDBY
\r
2520 * IB_SMINFO_ATTR_MOD_STANDBY
\r
2523 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
\r
2527 #define IB_SMINFO_ATTR_MOD_STANDBY (CL_NTOH32(0x000004))
\r
2530 /****d* IBA Base: Constants/IB_SMINFO_ATTR_MOD_DISCOVER
\r
2532 * IB_SMINFO_ATTR_MOD_DISCOVER
\r
2535 * Encoded attribute modifier value used on SubnSet(SMInfo) SMPs.
\r
2539 #define IB_SMINFO_ATTR_MOD_DISCOVER (CL_NTOH32(0x000005))
\r
2542 /****s* Access Layer/ib_ci_op_t
\r
2547 * A structure used for vendor specific CA interface communication.
\r
2551 typedef struct _ib_ci_op
\r
2553 IN uint32_t command;
\r
2554 IN uint32_t buf_size;
\r
2555 IN uint32_t buf_info;
\r
2556 IN OUT int32_t status;
\r
2557 IN OUT TO_LONG_PTR(void*,p_buf) OPTIONAL; // Do not put it last in the structure, because of memory alignment
\r
2558 OUT uint32_t num_bytes_ret;
\r
2565 * A command code that is understood by the verbs provider.
\r
2568 * The completion status from the verbs provider. This field should be
\r
2569 * initialize to indicate an error to allow detection and cleanup in
\r
2570 * case a communication error occurs between user-mode and kernel-mode.
\r
2573 * The size of the buffer in bytes.
\r
2576 * Additional buffer information
\r
2579 * A reference to a buffer containing vendor specific data. The verbs
\r
2580 * provider must not access pointers in the p_buf between user-mode and
\r
2581 * kernel-mode. Any pointers embedded in the p_buf are invalidated by
\r
2582 * the user-mode/kernel-mode transition.
\r
2585 * The size in bytes of the vendor specific data returned in the buffer.
\r
2586 * This field is set by the verbs provider. The verbs provider should
\r
2587 * verify that the buffer size is sufficient to hold the data being
\r
2591 * This structure is provided to allow the exchange of vendor specific
\r
2592 * data between the originator and the verbs provider. Users of this
\r
2593 * structure are expected to know the format of data in the p_buf based
\r
2594 * on the structure command field or the usage context.
\r
2598 #endif // __IB_TYPES_EXTENDED_H__
\r