1 /* 2 * CDDL HEADER START 3 * 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. 7 * 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. 12 * 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] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 #ifndef _SYS_IB_IBTL_IBTL_STATUS_H 27 #define _SYS_IB_IBTL_IBTL_STATUS_H 28 29 #pragma ident "%Z%%M% %I% %E% SMI" 30 31 /* 32 * ibtl_status.h 33 * 34 * Define global IBTL return codes. 35 */ 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 /* 42 * Mnemonics 43 * APM - Automatic Path Migration 44 * APR - Alternate Path Response 45 * AH - Address Handle 46 * CI - Channel Interface (HCA) 47 * CQ - Completion Queue 48 * DLID - Destination Local Id 49 * DS - Data Segment. 50 * GSI - General Service Interface 51 * GUID - Globally Unique Identifier 52 * HCA - Host Channel Adapter. 53 * L_KEY - Local Key 54 * LAP - Load Alternative Path 55 * MC - Multicast 56 * MCG - Multicast Group 57 * MR - Memory Region 58 * MW - Memory Window 59 * MTU - Maximum Transfer Unit 60 * NAK - Negative Acknowledge 61 * P_KEY - Partition Key 62 * PD - Protection Domain 63 * PSN - Packet Serial Number 64 * QP - Queue Pair 65 * QPN - Queue Pair Number 66 * R_KEY - Remote Key 67 * RC - Reliable Connected 68 * RDMA - Remote DMA 69 * RNR - Receiver Not Ready 70 * RQ - Receive Work Queue 71 * SGL - Scatter/Gather List 72 * SL - Service Level 73 * SMI - Subnet Management Interface 74 * SQ - Send Work Queue 75 * UC - Unreliable Connected 76 * UD - Unreliable Datagram 77 * VA - Virtual Address 78 * WR - Work Request 79 * WC - Work Completion 80 * WRC - Work Request Completion 81 */ 82 83 /* 84 * IBTF Immediate status codes. 85 */ 86 typedef enum ibt_status_e { 87 /* 88 * Generic Status codes. 89 */ 90 IBT_SUCCESS = 0, /* Operation Successful */ 91 IBT_FAILURE = 1, /* Undefined IBTF Failure */ 92 IBT_NOT_SUPPORTED = 2, /* Feature not supported */ 93 IBT_ILLEGAL_OP = 3, /* Operation not supported */ 94 IBT_INVALID_PARAM = 4, /* Invalid argument specified */ 95 IBT_INSUFF_KERNEL_RESOURCE = 5, /* Not enough Kernel Resource */ 96 IBT_CM_FAILURE = 6, /* A call to CM returned */ 97 /* look into detailed error */ 98 /* code for actual failure */ 99 IBT_CM_SERVICE_EXISTS = 7, /* For the given parameters */ 100 /* serviceId already exists */ 101 IBT_APM_NOT_SUPPORTED = 8, /* Can not satisfy a request */ 102 /* for APM */ 103 IBT_INSUFF_DATA = 11, /* Requested number of */ 104 /* paths/records are not */ 105 /* available. */ 106 IBT_NO_HCAS_AVAILABLE = 12, /* No HCAs have attached. */ 107 IBT_PATH_RECORDS_NOT_FOUND = 13, /* Path records not found. */ 108 IBT_SERVICE_RECORDS_NOT_FOUND = 14, /* Service records not found. */ 109 IBT_MCG_RECORDS_NOT_FOUND = 15, /* MCG records not found. */ 110 IBT_PATH_PKT_LT_TOO_HIGH = 16, /* Path's packet life time */ 111 /* is too high. */ 112 IBT_CM_SERVICE_BUSY = 17, /* Service still has bindings */ 113 IBT_STATIC_RATE_INVALID = 18, /* Invalid Static Rate */ 114 IBT_SGID_INVALID = 19, /* Invalid SGID or SGID index */ 115 IBT_NODE_RECORDS_NOT_FOUND = 20, /* NODEInfo records not found */ 116 IBT_GIDS_NOT_FOUND = 21, /* Companion GIDs not found */ 117 IBT_INCONSISTENT_AR = 22, /* Address Record contradicts */ 118 /* an existing Address Record */ 119 IBT_AR_NOT_REGISTERED = 23, /* Address Record is not */ 120 /* currently registered */ 121 IBT_MULTIPLE_AR = 24, /* Multiple records exist for */ 122 /* what should be a unique */ 123 /* query result. One of the */ 124 /* records was returned. */ 125 IBT_DEST_IP_GID_NOT_FOUND = 25, /* No IP to GID Mapping */ 126 IBT_SRC_IP_NOT_FOUND = 26, /* SRC IP Endpoint not found */ 127 128 /* 129 * Resource Errors 130 */ 131 IBT_INSUFF_RESOURCE = 100, /* Not enough resources */ 132 IBT_HCA_CQ_EXCEEDED = 101, /* CQ capacity requested */ 133 /* exceeds HCA capability */ 134 IBT_HCA_WR_EXCEEDED = 102, /* Requested WRs exceed limit */ 135 IBT_HCA_SGL_EXCEEDED = 103, /* Requested SGL entries */ 136 /* exceed HCA max limit */ 137 IBT_ERR_OPAQUE1 = 104, 138 IBT_HCA_MCG_CHAN_EXCEEDED = 105, /* Requested Channel exceeds */ 139 /* HCA multicast groups */ 140 /* channel limit */ 141 IBT_HCA_IN_USE = 106, /* HCA already open (in use) */ 142 IBT_HCA_RESOURCES_NOT_FREED = 107, /* HCA resources still in use */ 143 IBT_HCA_BUSY_DETACHING = 108, /* HCA detach in progress */ 144 IBT_HCA_BUSY_CLOSING = 109, /* This client is in the */ 145 /* process of closing this */ 146 /* HCA */ 147 148 /* 149 * Host Channel Adapter (HCA) Attribute Errors. 150 */ 151 IBT_HCA_INVALID = 200, /* Invalid HCA GUID */ 152 IBT_HCA_HDL_INVALID = 201, /* Invalid HCA Handle */ 153 IBT_HCA_PORT_MTU_EXCEEDED = 202, /* MTU of HCA port exceeded */ 154 IBT_HCA_PORT_INVALID = 203, /* Invalid HCA physical port */ 155 IBT_HCA_CNTR_INVALID = 204, /* Invalid Counter Specified */ 156 IBT_HCA_CNTR_VAL_INVALID = 205, /* Invalid Counter value */ 157 IBT_HCA_PORT_NOT_ACTIVE = 206, /* Port is down */ 158 IBT_HCA_SRQ_NOT_SUPPORTED = 207, /* Shared Receive Queue */ 159 /* not supported */ 160 IBT_HCA_RESIZE_SRQ_NOT_SUPPORTED = 208, /* SRQ Resize not supported */ 161 IBT_HCA_PAGE_MODE = 209, /* Not opened in page mode */ 162 IBT_HCA_BLOCK_MODE = 210, /* HCA does not support Block */ 163 /* mode or Not opened in */ 164 /* Block mode */ 165 IBT_HCA_BMM_NOT_SUPPORTED = 211, /* Base Memory Management */ 166 /* Extensions not supported */ 167 IBT_HCA_BQM_NOT_SUPPORTED = 212, /* Base Queue Management */ 168 /* Extensions not supported */ 169 IBT_HCA_ZBVA_NOT_SUPPORTED = 213, /* Zero Based Virtual */ 170 /* Addresses not supported */ 171 IBT_HCA_MR_MPB_SZ_NOT_SUPPORTED = 214, /* Multiple physical buffer */ 172 /* sizes per MR not supported */ 173 IBT_HCA_TYPE_2_MW_NOT_SUPPORTED = 215, 174 175 IBT_HCA_LIF_NOT_SUPPORTED = 216, /* Local Invalidate Fencing */ 176 /* not supported */ 177 IBT_HCA_FMR_NOT_SUPPORTED = 217, /* Fast Memory Registration */ 178 /* not supported */ 179 /* 180 * Address errors 181 */ 182 IBT_UD_DEST_HDL_INVALID = 300, /* Invalid Address Handle */ 183 184 /* 185 * Channel Errors 186 */ 187 IBT_CHAN_HDL_INVALID = 400, /* Invalid channel Handle */ 188 IBT_CHAN_ATTR_RO = 401, /* Cannot Change channel */ 189 /* Attribute */ 190 IBT_CHAN_STATE_INVALID = 402, /* Invalid channel State */ 191 IBT_CHAN_SRV_TYPE_INVALID = 403, /* Invalid channel Service */ 192 /* Type */ 193 IBT_CHAN_IN_USE = 404, /* SMI/GSI channel in use */ 194 IBT_CHAN_ATOMICS_NOT_SUPPORTED = 405, /* Atomics not supported */ 195 IBT_ERR_OPAQUE2 = 406, 196 IBT_ERR_OPAQUE3 = 407, 197 IBT_CHAN_OP_TYPE_INVALID = 408, /* Invalid Operation Type */ 198 IBT_CHAN_SGL_FORMAT_INVALID = 409, /* Invalid SG List format */ 199 IBT_CHAN_SGL_LEN_INVALID = 410, /* Invalid SG List length */ 200 IBT_CHAN_APM_STATE_INVALID = 411, /* Invalid Path Migration */ 201 /* State */ 202 IBT_CHAN_SPECIAL_TYPE_INVALID = 412, /* Invalid Special channel */ 203 IBT_CHAN_SZ_INSUFFICIENT = 413, /* The Size of the WQ is too */ 204 /* small, there are more */ 205 /* outstanding entries than */ 206 /* than the requested size. */ 207 IBT_CHAN_FULL = 414, /* Too many WRs posted */ 208 IBT_CHAN_SRQ = 415, /* Handle used on a channel */ 209 /* that is associated with an */ 210 /* SRQ */ 211 IBT_CHAN_TYPE_2A_MW_BOUND = 416, /* Channel still has a type */ 212 /* 2A memory window bound */ 213 214 /* 215 * Completion Queue (CQ) errors 216 */ 217 IBT_CQ_HDL_INVALID = 500, /* Invalid CQ Handle */ 218 IBT_CQ_SZ_INSUFFICIENT = 501, /* The Size of the CQ is too */ 219 /* small, there are more */ 220 /* outstanding completions */ 221 /* than the requested size. */ 222 IBT_CQ_BUSY = 502, /* WQ(s) Still Reference CQ */ 223 IBT_CQ_EMPTY = 503, /* Completion Queue Empty */ 224 IBT_CQ_NOTIFY_TYPE_INVALID = 504, /* Invalid notification type */ 225 IBT_CQ_INVALID_PRIORITY = 505, /* Invalid CQ Priority */ 226 227 /* 228 * Reserved for future use. 229 */ 230 IBT_ERR_OPAQUE4 = 600, 231 IBT_ERR_OPAQUE5 = 601, 232 IBT_ERR_OPAQUE6 = 602, 233 IBT_ERR_OPAQUE7 = 700, 234 IBT_ERR_OPAQUE8 = 701, 235 IBT_ERR_OPAQUE9 = 702, 236 IBT_ERR_OPAQUE10 = 703, 237 238 /* 239 * Memory operation errors 240 */ 241 IBT_MR_VA_INVALID = 800, /* Invalid Virtual Address */ 242 IBT_MR_LEN_INVALID = 801, /* Invalid Memory Length */ 243 IBT_MR_PHYSBUF_INVALID = 802, /* Invalid Physical Buffer */ 244 /* List */ 245 IBT_MR_OFFSET_INVALID = 803, /* Invalid Memory Offset */ 246 IBT_MR_LKEY_INVALID = 804, /* Invalid Memory L_KEY */ 247 IBT_MR_RKEY_INVALID = 805, /* Invalid Memory R_KEY */ 248 IBT_MR_HDL_INVALID = 806, /* Invalid Memory Region */ 249 /* Handle */ 250 IBT_MR_ACCESS_REQ_INVALID = 807, /* Invalid Access Control */ 251 /* Specifier */ 252 IBT_MR_IN_USE = 808, /* Mem region in Use */ 253 IBT_MW_HDL_INVALID = 809, /* Invalid Memory Window */ 254 /* Handle */ 255 IBT_MW_TYPE_INVALID = 810, 256 IBT_MA_HDL_INVALID = 811, /* Invalid Memory Area Hdl */ 257 258 /* 259 * Multicast errors 260 */ 261 IBT_MC_OPAQUE = 900, /* Invalid MLID */ 262 IBT_MC_MGID_INVALID = 901, /* Invalid MGID */ 263 IBT_MC_GROUP_INVALID = 902, /* Invalid MC Group */ 264 265 /* 266 * Partition table errors. 267 */ 268 IBT_PKEY_IX_ILLEGAL = 1000, /* P_Key index Out of range */ 269 IBT_PKEY_IX_INVALID = 1001, /* P_Key index specifies */ 270 /* invalid entry in table */ 271 /* 272 * Protection Domain errors 273 */ 274 IBT_PD_HDL_INVALID = 1100, /* Invalid protection domain */ 275 IBT_PD_IN_USE = 1101, /* Protection Domain in Use */ 276 277 /* 278 * Shared Receive Queue errors 279 */ 280 IBT_SRQ_HDL_INVALID = 1200, /* Invalid SRQ Handle */ 281 IBT_SRQ_ERROR_STATE = 1201, /* SRQ in Error State */ 282 IBT_SRQ_LIMIT_EXCEEDED = 1202, /* SRQ Limit exceeds max SRQ */ 283 /* size */ 284 IBT_SRQ_SZ_INSUFFICIENT = 1203, /* The Size of the WQ is too */ 285 /* small, there are more */ 286 /* outstanding entries than */ 287 IBT_SRQ_IN_USE = 1204, /* SRQ Still has QPs */ 288 /* associated with it */ 289 /* 290 * FMR Errors 291 */ 292 IBT_FMR_POOL_HDL_INVALID = 1300, /* Invalid FMR Pool handle */ 293 IBT_FMR_POOL_IN_USE = 1301, /* FMR Pool in use. */ 294 IBT_PBL_TOO_SMALL = 1302 295 296 } ibt_status_t; 297 298 /* 299 * Work Request Completion Return Status. 300 * 301 * Refer InfiniBand Architecture Release Volume 1: 302 * Section 11.6.2 Completion Return Status. 303 * 304 * NOTE: this was converted from an enum to a uint8_t to save space. 305 */ 306 typedef uint8_t ibt_wc_status_t; 307 #define IBT_WC_SUCCESS 0 /* WR Completed Successfully */ 308 #define IBT_WC_LOCAL_LEN_ERR 10 /* Data in WR posted to local */ 309 /* queue too big */ 310 #define IBT_WC_LOCAL_CHAN_OP_ERR 11 /* Internal consistency error */ 311 #define IBT_WC_LOCAL_PROTECT_ERR 13 /* Memory Region violation */ 312 /* for posted WR */ 313 #define IBT_WC_WR_FLUSHED_ERR 14 /* WR was in process when the */ 314 /* chan went to error state */ 315 #define IBT_WC_MEM_WIN_BIND_ERR 15 /* Consumer had insufficient */ 316 /* access rights */ 317 318 /* 319 * Errors that are only reported for Reliable Queue Pairs. 320 */ 321 #define IBT_WC_BAD_RESPONSE_ERR 20 /* An unexpected transport */ 322 /* layer opcode was returned */ 323 /* by the responder */ 324 #define IBT_WC_LOCAL_ACCESS_ERR 21 /* A protection error */ 325 /* occurred on a local data */ 326 /* buffer during the */ 327 /* processing of a RDMA Write */ 328 /* with Immediate Data */ 329 /* operation sent from the */ 330 /* remote node */ 331 /* data buffer */ 332 #define IBT_WC_REMOTE_INVALID_REQ_ERR 22 /* Responder detected invalid */ 333 /* message on the channel */ 334 #define IBT_WC_REMOTE_ACCESS_ERR 23 /* Protection Error on remote */ 335 /* data buffer */ 336 #define IBT_WC_REMOTE_OP_ERR 24 /* Operation could not be */ 337 /* completed by the responder */ 338 #define IBT_WC_TRANS_TIMEOUT_ERR 25 /* Local transport retry */ 339 /* counter exceeded */ 340 #define IBT_WC_RNR_NAK_TIMEOUT_ERR 26 /* RNR NAK retry counter */ 341 /* exceeded */ 342 #ifdef __cplusplus 343 } 344 #endif 345 346 #endif /* _SYS_IB_IBTL_IBTL_STATUS_H */ 347