1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*0Sstevel@tonic-gate * Use is subject to license terms. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef _SYS_IB_IBTL_IBVTI_H 28*0Sstevel@tonic-gate #define _SYS_IB_IBTL_IBVTI_H 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate /* 33*0Sstevel@tonic-gate * ibvti.h 34*0Sstevel@tonic-gate * 35*0Sstevel@tonic-gate * This file contains private verbs level transport interface extensions. 36*0Sstevel@tonic-gate */ 37*0Sstevel@tonic-gate #include <sys/ib/ibtl/ibti_common.h> 38*0Sstevel@tonic-gate #include <sys/ib/ibtl/ibtl_ci_types.h> 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate #ifdef __cplusplus 41*0Sstevel@tonic-gate extern "C" { 42*0Sstevel@tonic-gate #endif 43*0Sstevel@tonic-gate 44*0Sstevel@tonic-gate #define IBT_CM_NO_QP IBT_CM_NO_CHAN /* ibt_cm_reason_t */ 45*0Sstevel@tonic-gate 46*0Sstevel@tonic-gate #define IBT_CM_SREP_QPN_VALID IBT_CM_SREP_CHAN_VALID /* ibt_sidr_status_t */ 47*0Sstevel@tonic-gate #define IBT_CM_SREP_NO_QP IBT_CM_SREP_NO_CHAN /* ibt_sidr_status_t */ 48*0Sstevel@tonic-gate 49*0Sstevel@tonic-gate #define IBT_OCHAN_CM_RETRY IBT_OCHAN_OPAQUE1 /* ibt_chan_open_flags_t */ 50*0Sstevel@tonic-gate #define IBT_OCHAN_STARTING_PSN IBT_OCHAN_OPAQUE2 /* ibt_chan_open_flags_t */ 51*0Sstevel@tonic-gate #define IBT_OCHAN_LOCAL_CM_TM IBT_OCHAN_OPAQUE3 /* ibt_chan_open_flags_t */ 52*0Sstevel@tonic-gate #define IBT_OCHAN_REMOTE_CM_TM IBT_OCHAN_OPAQUE4 /* ibt_chan_open_flags_t */ 53*0Sstevel@tonic-gate #define IBT_OCHAN_RDC_EXISTS IBT_OCHAN_OPAQUE5 /* ibt_chan_open_flags_t */ 54*0Sstevel@tonic-gate 55*0Sstevel@tonic-gate #define oc_cm_retry_cnt oc_opaque1 /* ibt_chan_open_args_t */ 56*0Sstevel@tonic-gate /* The number of times the */ 57*0Sstevel@tonic-gate /* CM will retry its MADs */ 58*0Sstevel@tonic-gate /* when IBT_OCHAN_CM_RETRY */ 59*0Sstevel@tonic-gate /* is set */ 60*0Sstevel@tonic-gate #define oc_starting_psn oc_opaque2 /* ibt_chan_open_args_t */ 61*0Sstevel@tonic-gate /* use oc_starting_psn when */ 62*0Sstevel@tonic-gate /* IBT_OCHAN_STARTING_PSN is */ 63*0Sstevel@tonic-gate /* set */ 64*0Sstevel@tonic-gate 65*0Sstevel@tonic-gate #define oc_local_cm_time oc_opaque3 /* ibt_chan_open_args_t */ 66*0Sstevel@tonic-gate /* The maximum time in */ 67*0Sstevel@tonic-gate /* microseconds that local */ 68*0Sstevel@tonic-gate /* client takes to respond */ 69*0Sstevel@tonic-gate /* for a CM callback */ 70*0Sstevel@tonic-gate 71*0Sstevel@tonic-gate #define oc_remote_cm_time oc_opaque4 /* ibt_chan_open_args_t */ 72*0Sstevel@tonic-gate /* The maximum time in */ 73*0Sstevel@tonic-gate /* microseconds that remote */ 74*0Sstevel@tonic-gate /* node takes to respond */ 75*0Sstevel@tonic-gate /* for a CM MAD */ 76*0Sstevel@tonic-gate 77*0Sstevel@tonic-gate #define cm_eec_hdl cm_opaque /* ibt_cm_event_t */ 78*0Sstevel@tonic-gate 79*0Sstevel@tonic-gate #define req_remote_eecn req_opaque1 /* ibt_cm_req_rcv_t */ 80*0Sstevel@tonic-gate #define req_local_eecn req_opaque2 /* ibt_cm_req_rcv_t */ 81*0Sstevel@tonic-gate 82*0Sstevel@tonic-gate #define IBT_CM_RDC_EXISTS 0x4 /* ibt_cm_flags_t */ 83*0Sstevel@tonic-gate 84*0Sstevel@tonic-gate #define ai_dlid ai_opaque1 /* Local dest, or router LID */ 85*0Sstevel@tonic-gate #define ai_src_path ai_opaque2 /* Source path bits */ 86*0Sstevel@tonic-gate 87*0Sstevel@tonic-gate 88*0Sstevel@tonic-gate /* 89*0Sstevel@tonic-gate * Note that variables of type ibt_qp_hdl_t (really ibt_channel_hdl_t) 90*0Sstevel@tonic-gate * can be used in some of the IBTI interfaces, e.g., ibt_open_rc_channel(). 91*0Sstevel@tonic-gate */ 92*0Sstevel@tonic-gate #define ibt_qp_hdl_t ibt_channel_hdl_t 93*0Sstevel@tonic-gate 94*0Sstevel@tonic-gate /* 95*0Sstevel@tonic-gate * ibt_cq_priority_t 96*0Sstevel@tonic-gate * VTI clients have full control over CQ priorities. 97*0Sstevel@tonic-gate */ 98*0Sstevel@tonic-gate #define IBT_CQ_PRI_1 IBT_CQ_OPAQUE_1 /* Lowest priority */ 99*0Sstevel@tonic-gate #define IBT_CQ_PRI_2 IBT_CQ_OPAQUE_2 100*0Sstevel@tonic-gate #define IBT_CQ_PRI_3 IBT_CQ_OPAQUE_3 101*0Sstevel@tonic-gate #define IBT_CQ_PRI_4 IBT_CQ_OPAQUE_4 102*0Sstevel@tonic-gate #define IBT_CQ_PRI_5 IBT_CQ_OPAQUE_5 103*0Sstevel@tonic-gate #define IBT_CQ_PRI_6 IBT_CQ_OPAQUE_6 104*0Sstevel@tonic-gate #define IBT_CQ_PRI_7 IBT_CQ_OPAQUE_7 105*0Sstevel@tonic-gate #define IBT_CQ_PRI_8 IBT_CQ_OPAQUE_8 106*0Sstevel@tonic-gate #define IBT_CQ_PRI_9 IBT_CQ_OPAQUE_9 107*0Sstevel@tonic-gate #define IBT_CQ_PRI_10 IBT_CQ_OPAQUE_10 108*0Sstevel@tonic-gate #define IBT_CQ_PRI_11 IBT_CQ_OPAQUE_11 109*0Sstevel@tonic-gate #define IBT_CQ_PRI_12 IBT_CQ_OPAQUE_12 110*0Sstevel@tonic-gate #define IBT_CQ_PRI_13 IBT_CQ_OPAQUE_13 111*0Sstevel@tonic-gate #define IBT_CQ_PRI_14 IBT_CQ_OPAQUE_14 112*0Sstevel@tonic-gate #define IBT_CQ_PRI_15 IBT_CQ_OPAQUE_15 113*0Sstevel@tonic-gate #define IBT_CQ_PRI_16 IBT_CQ_OPAQUE_16 /* Highest priority */ 114*0Sstevel@tonic-gate 115*0Sstevel@tonic-gate /* 116*0Sstevel@tonic-gate * FUNCTION PROTOTYPES. 117*0Sstevel@tonic-gate */ 118*0Sstevel@tonic-gate /* 119*0Sstevel@tonic-gate * ibt_alloc_ah() 120*0Sstevel@tonic-gate * Allocates and returns an address handle (ibt_ah_hdl_t). 121*0Sstevel@tonic-gate * 122*0Sstevel@tonic-gate * hca_hdl The IBT HCA handle returned to the client 123*0Sstevel@tonic-gate * on an ibt_open_hca() call. 124*0Sstevel@tonic-gate * 125*0Sstevel@tonic-gate * flags IBT_AH_NO_FLAGS, IBT_AH_USER_MAP and IBT_AH_DEFER_ALLOC 126*0Sstevel@tonic-gate * 127*0Sstevel@tonic-gate * pd Is a protection domain to associate with this handle. 128*0Sstevel@tonic-gate * 129*0Sstevel@tonic-gate * adds_vectp Points to an ibt_adds_vect_t struct. 130*0Sstevel@tonic-gate * 131*0Sstevel@tonic-gate * ah_p The address to store the allocated address handle. 132*0Sstevel@tonic-gate * 133*0Sstevel@tonic-gate */ 134*0Sstevel@tonic-gate ibt_status_t ibt_alloc_ah(ibt_hca_hdl_t hca_hdl, ibt_ah_flags_t flags, 135*0Sstevel@tonic-gate ibt_pd_hdl_t pd, ibt_adds_vect_t *adds_vectp, ibt_ah_hdl_t *ah_p); 136*0Sstevel@tonic-gate 137*0Sstevel@tonic-gate /* 138*0Sstevel@tonic-gate * ibt_free_ah() 139*0Sstevel@tonic-gate * Release/de-allocate the specified handle. 140*0Sstevel@tonic-gate * 141*0Sstevel@tonic-gate * hca_hdl The IBT HCA handle. 142*0Sstevel@tonic-gate * 143*0Sstevel@tonic-gate * ah The address handle. 144*0Sstevel@tonic-gate */ 145*0Sstevel@tonic-gate ibt_status_t ibt_free_ah(ibt_hca_hdl_t hca_hdl, ibt_ah_hdl_t ah); 146*0Sstevel@tonic-gate 147*0Sstevel@tonic-gate /* 148*0Sstevel@tonic-gate * ibt_query_ah 149*0Sstevel@tonic-gate * Obtain the address vector information for the specified address handle. 150*0Sstevel@tonic-gate * 151*0Sstevel@tonic-gate * hca_hdl The IBT HCA handle returned to the client 152*0Sstevel@tonic-gate * on an ibt_open_hca() call. 153*0Sstevel@tonic-gate * 154*0Sstevel@tonic-gate * ah The address handle. 155*0Sstevel@tonic-gate * 156*0Sstevel@tonic-gate * pd_p The protection domain handle of the PD with which this 157*0Sstevel@tonic-gate * address handle is associated. 158*0Sstevel@tonic-gate * 159*0Sstevel@tonic-gate * adds_vectp Points to an ibt_adds_vect_t struct. 160*0Sstevel@tonic-gate * 161*0Sstevel@tonic-gate */ 162*0Sstevel@tonic-gate ibt_status_t ibt_query_ah(ibt_hca_hdl_t hca_hdl, ibt_ah_hdl_t ah, 163*0Sstevel@tonic-gate ibt_pd_hdl_t *pd_p, ibt_adds_vect_t *adds_vectp); 164*0Sstevel@tonic-gate 165*0Sstevel@tonic-gate /* 166*0Sstevel@tonic-gate * ibt_modify_ah 167*0Sstevel@tonic-gate * Modify the address vector information for the specified address handle. 168*0Sstevel@tonic-gate * 169*0Sstevel@tonic-gate * hca_hdl The IBT HCA handle returned to the client on an 170*0Sstevel@tonic-gate * ibt_open_hca() call. 171*0Sstevel@tonic-gate * 172*0Sstevel@tonic-gate * ah The address handle. 173*0Sstevel@tonic-gate * 174*0Sstevel@tonic-gate * adds_vectp Points to an ibt_adds_vect_t struct. The new address 175*0Sstevel@tonic-gate * vector information is specified is this returned struct. 176*0Sstevel@tonic-gate */ 177*0Sstevel@tonic-gate ibt_status_t ibt_modify_ah(ibt_hca_hdl_t hca_hdl, ibt_ah_hdl_t ah, 178*0Sstevel@tonic-gate ibt_adds_vect_t *adds_vectp); 179*0Sstevel@tonic-gate 180*0Sstevel@tonic-gate 181*0Sstevel@tonic-gate /* 182*0Sstevel@tonic-gate * ibt_alloc_qp() 183*0Sstevel@tonic-gate * Allocate a QP with specified attributes. 184*0Sstevel@tonic-gate * 185*0Sstevel@tonic-gate * hca_hdl Specifies the QP's HCA. 186*0Sstevel@tonic-gate * 187*0Sstevel@tonic-gate * type Specifies the type of QP to alloc in ibt_alloc_qp() 188*0Sstevel@tonic-gate * 189*0Sstevel@tonic-gate * qp_attr Specifies the ibt_qp_alloc_attr_t that are needed to 190*0Sstevel@tonic-gate * allocate a QP. All allocated QP's are returned in the 191*0Sstevel@tonic-gate * RESET state. 192*0Sstevel@tonic-gate * 193*0Sstevel@tonic-gate * queue_sizes_p NULL or a pointer to ibt_chan_sizes_s struct to return 194*0Sstevel@tonic-gate * new channel sizes. 195*0Sstevel@tonic-gate * cs_sq Returned new SendQ size. 196*0Sstevel@tonic-gate * cs_rq Returned new RecvQ size. 197*0Sstevel@tonic-gate * cs_sq_sgl Returned Max SGL elements in a SQ WR. 198*0Sstevel@tonic-gate * cs_rq_sgl Returned Max SGL elements in a RQ WR. 199*0Sstevel@tonic-gate * 200*0Sstevel@tonic-gate * qpn_p NULL or a pointer to return QP Number of the 201*0Sstevel@tonic-gate * allocated QP. 202*0Sstevel@tonic-gate * 203*0Sstevel@tonic-gate * ibt_qp_p The address to store the handle of the allocated QP. 204*0Sstevel@tonic-gate * 205*0Sstevel@tonic-gate * Note: 206*0Sstevel@tonic-gate * QPs allocated by ibt_alloc_qp are in the RESET state. The client 207*0Sstevel@tonic-gate * needs to transition an RC QP into the INIT state if it is going to 208*0Sstevel@tonic-gate * use ibt_open_rc_channel to establish the connection. 209*0Sstevel@tonic-gate * The client needs to transition an UD QP into the RTS state. 210*0Sstevel@tonic-gate */ 211*0Sstevel@tonic-gate ibt_status_t ibt_alloc_qp(ibt_hca_hdl_t hca_hdl, ibt_qp_type_t type, 212*0Sstevel@tonic-gate ibt_qp_alloc_attr_t *qp_attr, ibt_chan_sizes_t *queue_sizes_p, 213*0Sstevel@tonic-gate ib_qpn_t *qpn_p, ibt_qp_hdl_t *ibt_qp_p); 214*0Sstevel@tonic-gate 215*0Sstevel@tonic-gate /* 216*0Sstevel@tonic-gate * ibt_alloc_special_qp() 217*0Sstevel@tonic-gate * Allocate a special QP with specified attributes. 218*0Sstevel@tonic-gate * 219*0Sstevel@tonic-gate * hca_hdl Specifies the QP's HCA. 220*0Sstevel@tonic-gate * 221*0Sstevel@tonic-gate * port Specifies the Port on the HCA. 222*0Sstevel@tonic-gate * 223*0Sstevel@tonic-gate * type Specifies the type of Special QP to alloc. 224*0Sstevel@tonic-gate * 225*0Sstevel@tonic-gate * qp_attr Specifies the ibt_qp_alloc_attr_t that are needed to 226*0Sstevel@tonic-gate * allocate a Special QP. All allocated QP's are returned 227*0Sstevel@tonic-gate * in the RESET state. 228*0Sstevel@tonic-gate * 229*0Sstevel@tonic-gate * queue_sizes_p NULL or a pointer to ibt_chan_sizes_s struct to return 230*0Sstevel@tonic-gate * new channel sizes. 231*0Sstevel@tonic-gate * cs_sq Returned new SendQ size. 232*0Sstevel@tonic-gate * cs_rq Returned new RecvQ size. 233*0Sstevel@tonic-gate * cs_sq_sgl Returned Max SGL elements in a SQ WR. 234*0Sstevel@tonic-gate * cs_rq_sgl Returned Max SGL elements in a RQ WR. 235*0Sstevel@tonic-gate * 236*0Sstevel@tonic-gate * ibt_qp_p The address to store the handle of the allocated QP. 237*0Sstevel@tonic-gate * 238*0Sstevel@tonic-gate * Note: 239*0Sstevel@tonic-gate * QPs allocated by ibt_alloc_special_qp are in the RESET state. 240*0Sstevel@tonic-gate * The client needs to transition an UD QP into the RTS state. 241*0Sstevel@tonic-gate */ 242*0Sstevel@tonic-gate ibt_status_t ibt_alloc_special_qp(ibt_hca_hdl_t hca_hdl, uint8_t port, 243*0Sstevel@tonic-gate ibt_sqp_type_t type, ibt_qp_alloc_attr_t *qp_attr, 244*0Sstevel@tonic-gate ibt_chan_sizes_t *queue_sizes_p, ibt_qp_hdl_t *ibt_qp_p); 245*0Sstevel@tonic-gate 246*0Sstevel@tonic-gate /* 247*0Sstevel@tonic-gate * ibt_flush_qp() 248*0Sstevel@tonic-gate * Transition a QP into error state to flush all outstanding 249*0Sstevel@tonic-gate * work requests. Must be called before calling ibt_free_qp(). 250*0Sstevel@tonic-gate * Use ibt_close_rc_channel for RC QPs that have been opened 251*0Sstevel@tonic-gate * successfully. 252*0Sstevel@tonic-gate * 253*0Sstevel@tonic-gate * ibt_qp The ibt_qp_hdl_t of previously allocated QP. 254*0Sstevel@tonic-gate */ 255*0Sstevel@tonic-gate ibt_status_t ibt_flush_qp(ibt_qp_hdl_t ibt_qp); 256*0Sstevel@tonic-gate 257*0Sstevel@tonic-gate /* 258*0Sstevel@tonic-gate * ibt_initialize_qp() 259*0Sstevel@tonic-gate * Transition a QP from RESET state into a usable state. 260*0Sstevel@tonic-gate * An RC QP is transitioned into the INIT state, ready for 261*0Sstevel@tonic-gate * a call to ibt_open_rc_channel(). A UD QP is transitioned 262*0Sstevel@tonic-gate * all the way to the RTS state. 263*0Sstevel@tonic-gate * 264*0Sstevel@tonic-gate * ibt_qp The ibt_qp_hdl_t of previously allocated QP. 265*0Sstevel@tonic-gate * 266*0Sstevel@tonic-gate * modify_attrp Points to an ibt_qp_info_t struct that contains all 267*0Sstevel@tonic-gate * the attributes of the specified QP that a client is 268*0Sstevel@tonic-gate * allowed to modify after a QP has been allocated. 269*0Sstevel@tonic-gate */ 270*0Sstevel@tonic-gate ibt_status_t ibt_initialize_qp(ibt_qp_hdl_t ibt_qp, 271*0Sstevel@tonic-gate ibt_qp_info_t *modify_attrp); 272*0Sstevel@tonic-gate 273*0Sstevel@tonic-gate 274*0Sstevel@tonic-gate /* 275*0Sstevel@tonic-gate * ibt_free_qp() 276*0Sstevel@tonic-gate * De-allocate or free the resources associated with an existing QP. 277*0Sstevel@tonic-gate * 278*0Sstevel@tonic-gate * ibt_qp The ibt_qp_hdl_t of previously allocated QP. 279*0Sstevel@tonic-gate */ 280*0Sstevel@tonic-gate ibt_status_t ibt_free_qp(ibt_qp_hdl_t ibt_qp); 281*0Sstevel@tonic-gate 282*0Sstevel@tonic-gate 283*0Sstevel@tonic-gate /* 284*0Sstevel@tonic-gate * ibt_query_qp() 285*0Sstevel@tonic-gate * Query the attributes of an existing QP. 286*0Sstevel@tonic-gate * 287*0Sstevel@tonic-gate * ibt_qp The ibt_qp_hdl_t of previously allocated QP. 288*0Sstevel@tonic-gate * 289*0Sstevel@tonic-gate * qp_attrp Specifies the ibt_qp_query_attr_t contains all the 290*0Sstevel@tonic-gate * attributes of the specified QP. 291*0Sstevel@tonic-gate */ 292*0Sstevel@tonic-gate ibt_status_t ibt_query_qp(ibt_qp_hdl_t ibt_qp, ibt_qp_query_attr_t *qp_attrp); 293*0Sstevel@tonic-gate 294*0Sstevel@tonic-gate 295*0Sstevel@tonic-gate /* 296*0Sstevel@tonic-gate * ibt_modify_qp() 297*0Sstevel@tonic-gate * Modify the attributes of an existing QP. 298*0Sstevel@tonic-gate * 299*0Sstevel@tonic-gate * ibt_qp The ibt_qp_hdl_t of previously allocated QP. 300*0Sstevel@tonic-gate * 301*0Sstevel@tonic-gate * flags Specifies which attributes in ibt_qp_mod_attr_t 302*0Sstevel@tonic-gate * are to be modified. 303*0Sstevel@tonic-gate * 304*0Sstevel@tonic-gate * qp_attr Points to an ibt_qp_info_t struct that contains all 305*0Sstevel@tonic-gate * the attributes of the specified QP that a client is 306*0Sstevel@tonic-gate * allowed to modify after a QP has been allocated. 307*0Sstevel@tonic-gate * 308*0Sstevel@tonic-gate * actual_sz NULL or a pointer to ibt_queue_size_s struct to 309*0Sstevel@tonic-gate * return new queue sizes. 310*0Sstevel@tonic-gate * sq_sz Returned new SendQ size. 311*0Sstevel@tonic-gate * rq_sz Returned new RecvQ size. 312*0Sstevel@tonic-gate */ 313*0Sstevel@tonic-gate ibt_status_t ibt_modify_qp(ibt_qp_hdl_t ibt_qp, ibt_cep_modify_flags_t flags, 314*0Sstevel@tonic-gate ibt_qp_info_t *qp_attr, ibt_queue_sizes_t *actual_sz); 315*0Sstevel@tonic-gate 316*0Sstevel@tonic-gate /* 317*0Sstevel@tonic-gate * ibt_set_qp_private(), ibt_get_qp_private() 318*0Sstevel@tonic-gate * Set/Get the client private data. 319*0Sstevel@tonic-gate * 320*0Sstevel@tonic-gate * ibt_qp The ibt_qp_hdl_t of the allocated QP. 321*0Sstevel@tonic-gate * 322*0Sstevel@tonic-gate * clnt_private The client private data. 323*0Sstevel@tonic-gate */ 324*0Sstevel@tonic-gate void ibt_set_qp_private(ibt_qp_hdl_t ibt_qp, void *clnt_private); 325*0Sstevel@tonic-gate void *ibt_get_qp_private(ibt_qp_hdl_t ibt_qp); 326*0Sstevel@tonic-gate 327*0Sstevel@tonic-gate 328*0Sstevel@tonic-gate /* 329*0Sstevel@tonic-gate * ibt_qp_to_hca_guid 330*0Sstevel@tonic-gate * A helper function to retrieve HCA GUID for the specified QP. 331*0Sstevel@tonic-gate * 332*0Sstevel@tonic-gate * ibt_qp The ibt_qp_hdl_t of the allocated QP. 333*0Sstevel@tonic-gate * 334*0Sstevel@tonic-gate * hca_guid Returned HCA GUID on which the specified QP is 335*0Sstevel@tonic-gate * allocated. Valid if it is non-NULL on return. 336*0Sstevel@tonic-gate */ 337*0Sstevel@tonic-gate ib_guid_t ibt_qp_to_hca_guid(ibt_qp_hdl_t ibt_qp); 338*0Sstevel@tonic-gate 339*0Sstevel@tonic-gate 340*0Sstevel@tonic-gate /* 341*0Sstevel@tonic-gate * ibt_recover_ud_qp() 342*0Sstevel@tonic-gate * Recover an UD QP which has transitioned to SQ Error state. The 343*0Sstevel@tonic-gate * ibt_recover_ud_qp() transitions the QP from SQ Error state to 344*0Sstevel@tonic-gate * Ready-To-Send QP state. 345*0Sstevel@tonic-gate * 346*0Sstevel@tonic-gate * If a work request posted to a UD QP's send queue completes with 347*0Sstevel@tonic-gate * an error (see ibt_wc_status_t), the QP gets transitioned to SQ 348*0Sstevel@tonic-gate * Error state. In order to reuse this QP, ibt_recover_ud_qp() can 349*0Sstevel@tonic-gate * be used to recover the QP to a usable (Ready-to-Send) state. 350*0Sstevel@tonic-gate * 351*0Sstevel@tonic-gate * ibt_qp An UD QP handle which is in SQError state. 352*0Sstevel@tonic-gate */ 353*0Sstevel@tonic-gate ibt_status_t ibt_recover_ud_qp(ibt_qp_hdl_t ibt_qp); 354*0Sstevel@tonic-gate 355*0Sstevel@tonic-gate 356*0Sstevel@tonic-gate /* 357*0Sstevel@tonic-gate * Datagram Domain Functions 358*0Sstevel@tonic-gate */ 359*0Sstevel@tonic-gate 360*0Sstevel@tonic-gate /* 361*0Sstevel@tonic-gate * ibt_ud_get_dqpn 362*0Sstevel@tonic-gate * Finds the destination QPN at the specified destination that the 363*0Sstevel@tonic-gate * specified service can be reached on. The IBTF CM initiates the 364*0Sstevel@tonic-gate * service ID resolution protocol (SIDR) to determine a destination QPN. 365*0Sstevel@tonic-gate * 366*0Sstevel@tonic-gate * attr A pointer to an ibt_ud_dest_attr_t struct input arg. 367*0Sstevel@tonic-gate * 368*0Sstevel@tonic-gate * mode IBT_BLOCKING Do not return until completed. 369*0Sstevel@tonic-gate * "returns" must not be NULL. 370*0Sstevel@tonic-gate * IBT_NONBLOCKING Return as soon as possible. 371*0Sstevel@tonic-gate * This requires that the client 372*0Sstevel@tonic-gate * supplies a UD CM handler to 373*0Sstevel@tonic-gate * be called when this completes. 374*0Sstevel@tonic-gate * "returns" must be NULL. 375*0Sstevel@tonic-gate * 376*0Sstevel@tonic-gate * returns If the function is called in blocking mode, "returns" 377*0Sstevel@tonic-gate * is a pointer to an ibt_ud_returns_t struct, containing: 378*0Sstevel@tonic-gate * 379*0Sstevel@tonic-gate * ud_status Indicates if the UD destination handle 380*0Sstevel@tonic-gate * was allocated successfully. If the 381*0Sstevel@tonic-gate * handle was not allocated the status 382*0Sstevel@tonic-gate * code gives an indication why not. 383*0Sstevel@tonic-gate * ud_redirect A ibt_redirect_info_s struct, valid 384*0Sstevel@tonic-gate * for a ud_status of 385*0Sstevel@tonic-gate * IBT_CM_SREP_REDIRECT. The remote 386*0Sstevel@tonic-gate * destination could not provide the 387*0Sstevel@tonic-gate * service requested in dest_attrs. The 388*0Sstevel@tonic-gate * request was redirected to a new 389*0Sstevel@tonic-gate * destination, the details of which are 390*0Sstevel@tonic-gate * returned in ud_redirect. 391*0Sstevel@tonic-gate * ud_dqpn Returned destination QPN. 392*0Sstevel@tonic-gate * ud_qkey Q_Key for destination QPN. 393*0Sstevel@tonic-gate * ud_priv_data_len The length (in bytes) of the buffer 394*0Sstevel@tonic-gate * pointed to by ud_priv_data. 395*0Sstevel@tonic-gate * ud_priv_data A pointer to the caller's buffer 396*0Sstevel@tonic-gate * where private data from the 397*0Sstevel@tonic-gate * destination node is returned. 398*0Sstevel@tonic-gate */ 399*0Sstevel@tonic-gate ibt_status_t ibt_ud_get_dqpn(ibt_ud_dest_attr_t *attr, 400*0Sstevel@tonic-gate ibt_execution_mode_t mode, ibt_ud_returns_t *returns); 401*0Sstevel@tonic-gate 402*0Sstevel@tonic-gate /* 403*0Sstevel@tonic-gate * ibt_get_module_failure() 404*0Sstevel@tonic-gate * 405*0Sstevel@tonic-gate * Used to obtain a special IBTF failure code for IB module specific 406*0Sstevel@tonic-gate * failures, i.e. failures other than those defined in ibt_status_t. 407*0Sstevel@tonic-gate * 408*0Sstevel@tonic-gate * type Identifies the failing IB module. 409*0Sstevel@tonic-gate * 410*0Sstevel@tonic-gate * ena '0' or the data for Fault Management Architecture (ENA). 411*0Sstevel@tonic-gate */ 412*0Sstevel@tonic-gate ibt_status_t ibt_get_module_failure(ibt_failure_type_t type, uint64_t ena); 413*0Sstevel@tonic-gate 414*0Sstevel@tonic-gate #ifdef __cplusplus 415*0Sstevel@tonic-gate } 416*0Sstevel@tonic-gate #endif 417*0Sstevel@tonic-gate 418*0Sstevel@tonic-gate #endif /* _SYS_IB_IBTL_IBVTI_H */ 419