xref: /onnv-gate/usr/src/uts/common/sys/ib/ibtl/ibvti.h (revision 12965:b65a8427f8fe)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
59913SShantkumar.Hiremath@Sun.COM  * Common Development and Distribution License (the "License").
69913SShantkumar.Hiremath@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*12965SWilliam.Taylor@Oracle.COM  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate #ifndef	_SYS_IB_IBTL_IBVTI_H
260Sstevel@tonic-gate #define	_SYS_IB_IBTL_IBVTI_H
270Sstevel@tonic-gate 
280Sstevel@tonic-gate /*
290Sstevel@tonic-gate  * ibvti.h
300Sstevel@tonic-gate  *
310Sstevel@tonic-gate  * This file contains private verbs level transport interface extensions.
320Sstevel@tonic-gate  */
330Sstevel@tonic-gate #include <sys/ib/ibtl/ibti_common.h>
340Sstevel@tonic-gate #include <sys/ib/ibtl/ibtl_ci_types.h>
350Sstevel@tonic-gate 
360Sstevel@tonic-gate #ifdef __cplusplus
370Sstevel@tonic-gate extern "C" {
380Sstevel@tonic-gate #endif
390Sstevel@tonic-gate 
400Sstevel@tonic-gate #define	IBT_CM_NO_QP		IBT_CM_NO_CHAN		/* ibt_cm_reason_t */
410Sstevel@tonic-gate 
420Sstevel@tonic-gate #define	IBT_CM_SREP_QPN_VALID	IBT_CM_SREP_CHAN_VALID	/* ibt_sidr_status_t */
430Sstevel@tonic-gate #define	IBT_CM_SREP_NO_QP	IBT_CM_SREP_NO_CHAN	/* ibt_sidr_status_t */
440Sstevel@tonic-gate 
450Sstevel@tonic-gate #define	IBT_OCHAN_CM_RETRY	IBT_OCHAN_OPAQUE1 /* ibt_chan_open_flags_t */
460Sstevel@tonic-gate #define	IBT_OCHAN_STARTING_PSN	IBT_OCHAN_OPAQUE2 /* ibt_chan_open_flags_t */
470Sstevel@tonic-gate #define	IBT_OCHAN_LOCAL_CM_TM	IBT_OCHAN_OPAQUE3 /* ibt_chan_open_flags_t */
480Sstevel@tonic-gate #define	IBT_OCHAN_REMOTE_CM_TM	IBT_OCHAN_OPAQUE4 /* ibt_chan_open_flags_t */
490Sstevel@tonic-gate #define	IBT_OCHAN_RDC_EXISTS	IBT_OCHAN_OPAQUE5 /* ibt_chan_open_flags_t */
5011369SPramod.Gunjikar@Sun.COM #define	IBT_OCHAN_OFUV		IBT_OCHAN_OPAQUE6 /* ibt_chan_open_flags_t */
510Sstevel@tonic-gate 
520Sstevel@tonic-gate #define	oc_cm_retry_cnt		oc_opaque1	/* ibt_chan_open_args_t */
530Sstevel@tonic-gate 						/* The number of times the */
540Sstevel@tonic-gate 						/* CM will retry its MADs */
550Sstevel@tonic-gate 						/* when IBT_OCHAN_CM_RETRY */
560Sstevel@tonic-gate 						/* is set */
570Sstevel@tonic-gate #define	oc_starting_psn		oc_opaque2	/* ibt_chan_open_args_t */
580Sstevel@tonic-gate 						/* use oc_starting_psn when */
590Sstevel@tonic-gate 						/* IBT_OCHAN_STARTING_PSN is */
600Sstevel@tonic-gate 						/* set */
610Sstevel@tonic-gate 
620Sstevel@tonic-gate #define	oc_local_cm_time	oc_opaque3	/* ibt_chan_open_args_t */
630Sstevel@tonic-gate 						/* The maximum time in */
640Sstevel@tonic-gate 						/* microseconds that local */
650Sstevel@tonic-gate 						/* client takes to  respond */
660Sstevel@tonic-gate 						/* for a CM callback */
670Sstevel@tonic-gate 
680Sstevel@tonic-gate #define	oc_remote_cm_time	oc_opaque4	/* ibt_chan_open_args_t */
690Sstevel@tonic-gate 						/* The maximum time in */
700Sstevel@tonic-gate 						/* microseconds that remote */
710Sstevel@tonic-gate 						/* node takes to  respond */
720Sstevel@tonic-gate 						/* for a CM MAD */
730Sstevel@tonic-gate 
740Sstevel@tonic-gate #define	cm_eec_hdl		cm_opaque	/* ibt_cm_event_t */
750Sstevel@tonic-gate 
760Sstevel@tonic-gate #define	req_remote_eecn		req_opaque1	/* ibt_cm_req_rcv_t */
770Sstevel@tonic-gate #define	req_local_eecn		req_opaque2	/* ibt_cm_req_rcv_t */
780Sstevel@tonic-gate 
790Sstevel@tonic-gate #define	IBT_CM_RDC_EXISTS	0x4		/* ibt_cm_flags_t */
800Sstevel@tonic-gate 
810Sstevel@tonic-gate #define	ai_dlid			ai_opaque1	/* Local dest, or router LID */
820Sstevel@tonic-gate #define	ai_src_path		ai_opaque2	/* Source path bits */
830Sstevel@tonic-gate 
840Sstevel@tonic-gate 
850Sstevel@tonic-gate /*
860Sstevel@tonic-gate  * Note that variables of type ibt_qp_hdl_t (really ibt_channel_hdl_t)
870Sstevel@tonic-gate  * can be used in some of the IBTI interfaces, e.g., ibt_open_rc_channel().
880Sstevel@tonic-gate  */
890Sstevel@tonic-gate #define	ibt_qp_hdl_t		ibt_channel_hdl_t
900Sstevel@tonic-gate 
910Sstevel@tonic-gate 
920Sstevel@tonic-gate /*
930Sstevel@tonic-gate  * FUNCTION PROTOTYPES.
940Sstevel@tonic-gate  */
950Sstevel@tonic-gate /*
960Sstevel@tonic-gate  * ibt_alloc_ah()
970Sstevel@tonic-gate  *	Allocates and returns an address handle (ibt_ah_hdl_t).
980Sstevel@tonic-gate  */
990Sstevel@tonic-gate ibt_status_t ibt_alloc_ah(ibt_hca_hdl_t hca_hdl, ibt_ah_flags_t flags,
1000Sstevel@tonic-gate     ibt_pd_hdl_t pd, ibt_adds_vect_t *adds_vectp, ibt_ah_hdl_t *ah_p);
1010Sstevel@tonic-gate 
1020Sstevel@tonic-gate /*
1030Sstevel@tonic-gate  * ibt_free_ah()
1040Sstevel@tonic-gate  *	Release/de-allocate the specified handle.
1050Sstevel@tonic-gate  */
1060Sstevel@tonic-gate ibt_status_t ibt_free_ah(ibt_hca_hdl_t hca_hdl, ibt_ah_hdl_t ah);
1070Sstevel@tonic-gate 
1080Sstevel@tonic-gate /*
1090Sstevel@tonic-gate  * ibt_query_ah
1100Sstevel@tonic-gate  *	Obtain the address vector information for the specified address handle.
1110Sstevel@tonic-gate  */
1120Sstevel@tonic-gate ibt_status_t ibt_query_ah(ibt_hca_hdl_t hca_hdl, ibt_ah_hdl_t ah,
1130Sstevel@tonic-gate     ibt_pd_hdl_t *pd_p, ibt_adds_vect_t *adds_vectp);
1140Sstevel@tonic-gate 
1150Sstevel@tonic-gate /*
1160Sstevel@tonic-gate  * ibt_modify_ah
1170Sstevel@tonic-gate  *	Modify the address vector information for the specified address handle.
1180Sstevel@tonic-gate  */
1190Sstevel@tonic-gate ibt_status_t ibt_modify_ah(ibt_hca_hdl_t hca_hdl, ibt_ah_hdl_t ah,
1200Sstevel@tonic-gate     ibt_adds_vect_t *adds_vectp);
1210Sstevel@tonic-gate 
1220Sstevel@tonic-gate 
1230Sstevel@tonic-gate /*
1240Sstevel@tonic-gate  * ibt_alloc_qp()
1250Sstevel@tonic-gate  *	Allocate a QP with specified attributes.
1260Sstevel@tonic-gate  *
1270Sstevel@tonic-gate  * Note:
1280Sstevel@tonic-gate  *	QPs allocated by ibt_alloc_qp are in the RESET state.  The client
1290Sstevel@tonic-gate  *	needs to transition an RC QP into the INIT state if it is going to
1300Sstevel@tonic-gate  *	use ibt_open_rc_channel to establish the connection.
1310Sstevel@tonic-gate  *	The client needs to transition an UD QP into the RTS state.
1320Sstevel@tonic-gate  */
1330Sstevel@tonic-gate ibt_status_t ibt_alloc_qp(ibt_hca_hdl_t hca_hdl, ibt_qp_type_t type,
1340Sstevel@tonic-gate     ibt_qp_alloc_attr_t *qp_attr, ibt_chan_sizes_t *queue_sizes_p,
1350Sstevel@tonic-gate     ib_qpn_t *qpn_p, ibt_qp_hdl_t *ibt_qp_p);
1360Sstevel@tonic-gate 
1370Sstevel@tonic-gate /*
1380Sstevel@tonic-gate  * ibt_alloc_special_qp()
1390Sstevel@tonic-gate  *	Allocate a special QP with specified attributes.
1400Sstevel@tonic-gate  *
1410Sstevel@tonic-gate  * Note:
1420Sstevel@tonic-gate  *	QPs allocated by ibt_alloc_special_qp are in the RESET state.
1430Sstevel@tonic-gate  *	The client needs to transition an UD QP into the RTS state.
1440Sstevel@tonic-gate  */
1450Sstevel@tonic-gate ibt_status_t ibt_alloc_special_qp(ibt_hca_hdl_t hca_hdl, uint8_t port,
1460Sstevel@tonic-gate     ibt_sqp_type_t type, ibt_qp_alloc_attr_t *qp_attr,
1470Sstevel@tonic-gate     ibt_chan_sizes_t *queue_sizes_p, ibt_qp_hdl_t *ibt_qp_p);
1480Sstevel@tonic-gate 
1490Sstevel@tonic-gate /*
1500Sstevel@tonic-gate  * ibt_flush_qp()
1510Sstevel@tonic-gate  *	Transition a QP into error state to flush all outstanding
1520Sstevel@tonic-gate  *	work requests. Must be called before calling ibt_free_qp().
1530Sstevel@tonic-gate  *	Use ibt_close_rc_channel for RC QPs that have been opened
1540Sstevel@tonic-gate  *	successfully.
1550Sstevel@tonic-gate  */
1560Sstevel@tonic-gate ibt_status_t ibt_flush_qp(ibt_qp_hdl_t ibt_qp);
1570Sstevel@tonic-gate 
1580Sstevel@tonic-gate /*
1590Sstevel@tonic-gate  * ibt_initialize_qp()
1600Sstevel@tonic-gate  *	Transition a QP from RESET state into a usable state.
1610Sstevel@tonic-gate  *	An RC QP is transitioned into the INIT state, ready for
1620Sstevel@tonic-gate  *	a call to ibt_open_rc_channel().  A UD QP is transitioned
1630Sstevel@tonic-gate  *	all the way to the RTS state.
1640Sstevel@tonic-gate  */
1650Sstevel@tonic-gate ibt_status_t ibt_initialize_qp(ibt_qp_hdl_t ibt_qp,
1660Sstevel@tonic-gate     ibt_qp_info_t *modify_attrp);
1670Sstevel@tonic-gate 
1680Sstevel@tonic-gate 
1690Sstevel@tonic-gate /*
1700Sstevel@tonic-gate  * ibt_free_qp()
1710Sstevel@tonic-gate  *	De-allocate or free the resources associated with an existing QP.
1720Sstevel@tonic-gate  */
1730Sstevel@tonic-gate ibt_status_t ibt_free_qp(ibt_qp_hdl_t ibt_qp);
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate 
1760Sstevel@tonic-gate /*
1770Sstevel@tonic-gate  * ibt_query_qp()
1780Sstevel@tonic-gate  *	Query the attributes of an existing QP.
1790Sstevel@tonic-gate  */
1800Sstevel@tonic-gate ibt_status_t ibt_query_qp(ibt_qp_hdl_t ibt_qp, ibt_qp_query_attr_t *qp_attrp);
1810Sstevel@tonic-gate 
1820Sstevel@tonic-gate 
1830Sstevel@tonic-gate /*
1840Sstevel@tonic-gate  * ibt_modify_qp()
1850Sstevel@tonic-gate  *	Modify the attributes of an existing QP.
1860Sstevel@tonic-gate  */
1870Sstevel@tonic-gate ibt_status_t ibt_modify_qp(ibt_qp_hdl_t ibt_qp, ibt_cep_modify_flags_t flags,
1880Sstevel@tonic-gate     ibt_qp_info_t *qp_attr, ibt_queue_sizes_t *actual_sz);
1890Sstevel@tonic-gate 
1900Sstevel@tonic-gate /*
1910Sstevel@tonic-gate  * ibt_set_qp_private(), ibt_get_qp_private()
1920Sstevel@tonic-gate  *	Set/Get the client private data.
1930Sstevel@tonic-gate  */
1940Sstevel@tonic-gate void ibt_set_qp_private(ibt_qp_hdl_t ibt_qp, void *clnt_private);
1950Sstevel@tonic-gate void *ibt_get_qp_private(ibt_qp_hdl_t ibt_qp);
1960Sstevel@tonic-gate 
1970Sstevel@tonic-gate 
1980Sstevel@tonic-gate /*
1990Sstevel@tonic-gate  * ibt_qp_to_hca_guid
2000Sstevel@tonic-gate  *      A helper function to retrieve HCA GUID for the specified QP.
2010Sstevel@tonic-gate  */
2020Sstevel@tonic-gate ib_guid_t ibt_qp_to_hca_guid(ibt_qp_hdl_t ibt_qp);
2030Sstevel@tonic-gate 
2040Sstevel@tonic-gate 
2050Sstevel@tonic-gate /*
2060Sstevel@tonic-gate  * ibt_recover_ud_qp()
2070Sstevel@tonic-gate  *      Recover an UD QP which has transitioned to SQ Error state. The
2080Sstevel@tonic-gate  *      ibt_recover_ud_qp() transitions the QP from SQ Error state to
2090Sstevel@tonic-gate  *	Ready-To-Send QP state.
2100Sstevel@tonic-gate  *
2110Sstevel@tonic-gate  *      If a work request posted to a UD QP's send queue completes with
2120Sstevel@tonic-gate  *      an error (see ibt_wc_status_t), the QP gets transitioned to SQ
2130Sstevel@tonic-gate  *      Error state. In order to reuse this QP, ibt_recover_ud_qp() can
2140Sstevel@tonic-gate  *      be used to recover the QP to a usable (Ready-to-Send) state.
2150Sstevel@tonic-gate  */
2160Sstevel@tonic-gate ibt_status_t ibt_recover_ud_qp(ibt_qp_hdl_t ibt_qp);
2170Sstevel@tonic-gate 
2180Sstevel@tonic-gate 
2190Sstevel@tonic-gate /*
2200Sstevel@tonic-gate  * Datagram Domain Functions
2210Sstevel@tonic-gate  */
2220Sstevel@tonic-gate 
2230Sstevel@tonic-gate /*
2240Sstevel@tonic-gate  * ibt_ud_get_dqpn
2250Sstevel@tonic-gate  *	Finds the destination QPN at the specified destination that the
2260Sstevel@tonic-gate  *	specified service can be reached on. The IBTF CM initiates the
2270Sstevel@tonic-gate  *	service ID resolution protocol (SIDR) to determine a destination QPN.
2280Sstevel@tonic-gate  */
2290Sstevel@tonic-gate ibt_status_t ibt_ud_get_dqpn(ibt_ud_dest_attr_t *attr,
2300Sstevel@tonic-gate     ibt_execution_mode_t mode, ibt_ud_returns_t *returns);
2310Sstevel@tonic-gate 
2320Sstevel@tonic-gate /*
2330Sstevel@tonic-gate  * ibt_get_module_failure()
2340Sstevel@tonic-gate  *
2350Sstevel@tonic-gate  *	Used to obtain a special IBTF failure code for IB module specific
2360Sstevel@tonic-gate  *	failures, i.e. failures other than those defined in ibt_status_t.
2370Sstevel@tonic-gate  */
2380Sstevel@tonic-gate ibt_status_t ibt_get_module_failure(ibt_failure_type_t type, uint64_t ena);
2390Sstevel@tonic-gate 
2409913SShantkumar.Hiremath@Sun.COM ibt_status_t ibt_ofuvcm_get_req_data(void *, ibt_ofuvcm_req_data_t *);
2419913SShantkumar.Hiremath@Sun.COM 
2429913SShantkumar.Hiremath@Sun.COM ibt_status_t ibt_ofuvcm_proceed(ibt_cm_event_type_t, void *,
2439913SShantkumar.Hiremath@Sun.COM     ibt_cm_status_t, ibt_cm_proceed_reply_t *, void *,
2449913SShantkumar.Hiremath@Sun.COM     ibt_priv_data_len_t);
2459913SShantkumar.Hiremath@Sun.COM 
2460Sstevel@tonic-gate #ifdef __cplusplus
2470Sstevel@tonic-gate }
2480Sstevel@tonic-gate #endif
2490Sstevel@tonic-gate 
2500Sstevel@tonic-gate #endif /* _SYS_IB_IBTL_IBVTI_H */
251