4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _SYS_IB_IBTL_IBVTI_H
26 #define _SYS_IB_IBTL_IBVTI_H
31 * This file contains private verbs level transport interface extensions.
33 #include <sys/ib/ibtl/ibti_common.h>
34 #include <sys/ib/ibtl/ibtl_ci_types.h>
40 #define IBT_CM_NO_QP IBT_CM_NO_CHAN /* ibt_cm_reason_t */
42 #define IBT_CM_SREP_QPN_VALID IBT_CM_SREP_CHAN_VALID /* ibt_sidr_status_t */
43 #define IBT_CM_SREP_NO_QP IBT_CM_SREP_NO_CHAN /* ibt_sidr_status_t */
45 #define IBT_OCHAN_CM_RETRY IBT_OCHAN_OPAQUE1 /* ibt_chan_open_flags_t */
46 #define IBT_OCHAN_STARTING_PSN IBT_OCHAN_OPAQUE2 /* ibt_chan_open_flags_t */
47 #define IBT_OCHAN_LOCAL_CM_TM IBT_OCHAN_OPAQUE3 /* ibt_chan_open_flags_t */
48 #define IBT_OCHAN_REMOTE_CM_TM IBT_OCHAN_OPAQUE4 /* ibt_chan_open_flags_t */
49 #define IBT_OCHAN_RDC_EXISTS IBT_OCHAN_OPAQUE5 /* ibt_chan_open_flags_t */
50 #define IBT_OCHAN_OFUV IBT_OCHAN_OPAQUE6 /* ibt_chan_open_flags_t */
52 #define oc_cm_retry_cnt oc_opaque1 /* ibt_chan_open_args_t */
53 /* The number of times the */
54 /* CM will retry its MADs */
55 /* when IBT_OCHAN_CM_RETRY */
57 #define oc_starting_psn oc_opaque2 /* ibt_chan_open_args_t */
58 /* use oc_starting_psn when */
59 /* IBT_OCHAN_STARTING_PSN is */
62 #define oc_local_cm_time oc_opaque3 /* ibt_chan_open_args_t */
63 /* The maximum time in */
64 /* microseconds that local */
65 /* client takes to respond */
66 /* for a CM callback */
68 #define oc_remote_cm_time oc_opaque4 /* ibt_chan_open_args_t */
69 /* The maximum time in */
70 /* microseconds that remote */
71 /* node takes to respond */
74 #define cm_eec_hdl cm_opaque /* ibt_cm_event_t */
76 #define req_remote_eecn req_opaque1 /* ibt_cm_req_rcv_t */
77 #define req_local_eecn req_opaque2 /* ibt_cm_req_rcv_t */
79 #define IBT_CM_RDC_EXISTS 0x4 /* ibt_cm_flags_t */
81 #define ai_dlid ai_opaque1 /* Local dest, or router LID */
82 #define ai_src_path ai_opaque2 /* Source path bits */
86 * Note that variables of type ibt_qp_hdl_t (really ibt_channel_hdl_t)
87 * can be used in some of the IBTI interfaces, e.g., ibt_open_rc_channel().
89 #define ibt_qp_hdl_t ibt_channel_hdl_t
93 * FUNCTION PROTOTYPES.
97 * Allocates and returns an address handle (ibt_ah_hdl_t).
99 ibt_status_t
ibt_alloc_ah(ibt_hca_hdl_t hca_hdl
, ibt_ah_flags_t flags
,
100 ibt_pd_hdl_t pd
, ibt_adds_vect_t
*adds_vectp
, ibt_ah_hdl_t
*ah_p
);
104 * Release/de-allocate the specified handle.
106 ibt_status_t
ibt_free_ah(ibt_hca_hdl_t hca_hdl
, ibt_ah_hdl_t ah
);
110 * Obtain the address vector information for the specified address handle.
112 ibt_status_t
ibt_query_ah(ibt_hca_hdl_t hca_hdl
, ibt_ah_hdl_t ah
,
113 ibt_pd_hdl_t
*pd_p
, ibt_adds_vect_t
*adds_vectp
);
117 * Modify the address vector information for the specified address handle.
119 ibt_status_t
ibt_modify_ah(ibt_hca_hdl_t hca_hdl
, ibt_ah_hdl_t ah
,
120 ibt_adds_vect_t
*adds_vectp
);
125 * Allocate a QP with specified attributes.
128 * QPs allocated by ibt_alloc_qp are in the RESET state. The client
129 * needs to transition an RC QP into the INIT state if it is going to
130 * use ibt_open_rc_channel to establish the connection.
131 * The client needs to transition an UD QP into the RTS state.
133 ibt_status_t
ibt_alloc_qp(ibt_hca_hdl_t hca_hdl
, ibt_qp_type_t type
,
134 ibt_qp_alloc_attr_t
*qp_attr
, ibt_chan_sizes_t
*queue_sizes_p
,
135 ib_qpn_t
*qpn_p
, ibt_qp_hdl_t
*ibt_qp_p
);
138 * ibt_alloc_special_qp()
139 * Allocate a special QP with specified attributes.
142 * QPs allocated by ibt_alloc_special_qp are in the RESET state.
143 * The client needs to transition an UD QP into the RTS state.
145 ibt_status_t
ibt_alloc_special_qp(ibt_hca_hdl_t hca_hdl
, uint8_t port
,
146 ibt_sqp_type_t type
, ibt_qp_alloc_attr_t
*qp_attr
,
147 ibt_chan_sizes_t
*queue_sizes_p
, ibt_qp_hdl_t
*ibt_qp_p
);
151 * Transition a QP into error state to flush all outstanding
152 * work requests. Must be called before calling ibt_free_qp().
153 * Use ibt_close_rc_channel for RC QPs that have been opened
156 ibt_status_t
ibt_flush_qp(ibt_qp_hdl_t ibt_qp
);
159 * ibt_initialize_qp()
160 * Transition a QP from RESET state into a usable state.
161 * An RC QP is transitioned into the INIT state, ready for
162 * a call to ibt_open_rc_channel(). A UD QP is transitioned
163 * all the way to the RTS state.
165 ibt_status_t
ibt_initialize_qp(ibt_qp_hdl_t ibt_qp
,
166 ibt_qp_info_t
*modify_attrp
);
171 * De-allocate or free the resources associated with an existing QP.
173 ibt_status_t
ibt_free_qp(ibt_qp_hdl_t ibt_qp
);
178 * Query the attributes of an existing QP.
180 ibt_status_t
ibt_query_qp(ibt_qp_hdl_t ibt_qp
, ibt_qp_query_attr_t
*qp_attrp
);
185 * Modify the attributes of an existing QP.
187 ibt_status_t
ibt_modify_qp(ibt_qp_hdl_t ibt_qp
, ibt_cep_modify_flags_t flags
,
188 ibt_qp_info_t
*qp_attr
, ibt_queue_sizes_t
*actual_sz
);
191 * ibt_set_qp_private(), ibt_get_qp_private()
192 * Set/Get the client private data.
194 void ibt_set_qp_private(ibt_qp_hdl_t ibt_qp
, void *clnt_private
);
195 void *ibt_get_qp_private(ibt_qp_hdl_t ibt_qp
);
200 * A helper function to retrieve HCA GUID for the specified QP.
202 ib_guid_t
ibt_qp_to_hca_guid(ibt_qp_hdl_t ibt_qp
);
206 * ibt_recover_ud_qp()
207 * Recover an UD QP which has transitioned to SQ Error state. The
208 * ibt_recover_ud_qp() transitions the QP from SQ Error state to
209 * Ready-To-Send QP state.
211 * If a work request posted to a UD QP's send queue completes with
212 * an error (see ibt_wc_status_t), the QP gets transitioned to SQ
213 * Error state. In order to reuse this QP, ibt_recover_ud_qp() can
214 * be used to recover the QP to a usable (Ready-to-Send) state.
216 ibt_status_t
ibt_recover_ud_qp(ibt_qp_hdl_t ibt_qp
);
220 * Datagram Domain Functions
225 * Finds the destination QPN at the specified destination that the
226 * specified service can be reached on. The IBTF CM initiates the
227 * service ID resolution protocol (SIDR) to determine a destination QPN.
229 ibt_status_t
ibt_ud_get_dqpn(ibt_ud_dest_attr_t
*attr
,
230 ibt_execution_mode_t mode
, ibt_ud_returns_t
*returns
);
233 * ibt_get_module_failure()
235 * Used to obtain a special IBTF failure code for IB module specific
236 * failures, i.e. failures other than those defined in ibt_status_t.
238 ibt_status_t
ibt_get_module_failure(ibt_failure_type_t type
, uint64_t ena
);
240 ibt_status_t
ibt_ofuvcm_get_req_data(void *, ibt_ofuvcm_req_data_t
*);
242 ibt_status_t
ibt_ofuvcm_proceed(ibt_cm_event_type_t
, void *,
243 ibt_cm_status_t
, ibt_cm_proceed_reply_t
*, void *,
244 ibt_priv_data_len_t
);
250 #endif /* _SYS_IB_IBTL_IBVTI_H */