xref: /illumos-gate/usr/src/uts/common/sys/ib/ibtl/ibtl_status.h (revision b1d7ec75953cd517f5b7c3d9cb427ff8ec5d7d07)
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 (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 #ifndef	_SYS_IB_IBTL_IBTL_STATUS_H
26 #define	_SYS_IB_IBTL_IBTL_STATUS_H
27 
28 /*
29  * ibtl_status.h
30  *
31  * Define global IBTL return codes.
32  */
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * Mnemonics
40  *   APM   - Automatic Path Migration
41  *   APR   - Alternate Path Response
42  *   AH    - Address Handle
43  *   CI    - Channel Interface (HCA)
44  *   CQ    - Completion Queue
45  *   DLID  - Destination Local Id
46  *   DS    - Data Segment.
47  *   GSI   - General Service Interface
48  *   GUID  - Globally Unique Identifier
49  *   HCA   - Host Channel Adapter.
50  *   L_KEY - Local Key
51  *   LAP   - Load Alternative Path
52  *   MC    - Multicast
53  *   MCG   - Multicast Group
54  *   MR    - Memory Region
55  *   MW    - Memory Window
56  *   MTU   - Maximum Transfer Unit
57  *   NAK   - Negative Acknowledge
58  *   P_KEY - Partition Key
59  *   PD    - Protection Domain
60  *   PSN   - Packet Serial Number
61  *   QP    - Queue Pair
62  *   QPN   - Queue Pair Number
63  *   R_KEY - Remote Key
64  *   RC    - Reliable Connected
65  *   RDMA  - Remote DMA
66  *   RNR   - Receiver Not Ready
67  *   RQ    - Receive Work Queue
68  *   SGL   - Scatter/Gather List
69  *   SL    - Service Level
70  *   SMI   - Subnet Management Interface
71  *   SQ    - Send Work Queue
72  *   UC    - Unreliable Connected
73  *   UD    - Unreliable Datagram
74  *   VA    - Virtual Address
75  *   WR    - Work Request
76  *   WC    - Work Completion
77  *   WRC   - Work Request Completion
78  */
79 
80 /*
81  * IBTF Immediate status codes.
82  */
83 typedef enum ibt_status_e {
84 	/*
85 	 * Generic Status codes.
86 	 */
87 	IBT_SUCCESS			= 0,	/* Operation Successful */
88 	IBT_FAILURE			= 1,	/* Undefined IBTF Failure */
89 	IBT_NOT_SUPPORTED		= 2,	/* Feature not supported */
90 	IBT_ILLEGAL_OP			= 3,	/* Operation not supported */
91 	IBT_INVALID_PARAM		= 4,	/* Invalid argument specified */
92 	IBT_INSUFF_KERNEL_RESOURCE	= 5,	/* Not enough Kernel Resource */
93 	IBT_CM_FAILURE			= 6,	/* A call to CM returned */
94 						/* look into detailed error */
95 						/* code for actual failure */
96 	IBT_CM_SERVICE_EXISTS		= 7,	/* For the given parameters */
97 						/* serviceId already exists */
98 	IBT_APM_NOT_SUPPORTED		= 8,	/* Can not satisfy a request */
99 						/* for APM */
100 	IBT_IBMF_TIMEOUT		= 10,	/* IBMF call returned with */
101 						/* TIMEOUT error code. */
102 	IBT_INSUFF_DATA			= 11,	/* Requested number of */
103 						/* paths/records are not */
104 						/* available. */
105 	IBT_NO_HCAS_AVAILABLE		= 12,	/* No HCAs have attached. */
106 	IBT_PATH_RECORDS_NOT_FOUND	= 13,	/* Path records not found. */
107 	IBT_SERVICE_RECORDS_NOT_FOUND	= 14,	/* Service records not found. */
108 	IBT_MCG_RECORDS_NOT_FOUND	= 15,	/* MCG records not found. */
109 	IBT_PATH_PKT_LT_TOO_HIGH	= 16,	/* Path's packet life time */
110 						/* is too high. */
111 	IBT_CM_SERVICE_BUSY		= 17,	/* Service still has bindings */
112 	IBT_STATIC_RATE_INVALID		= 18,	/* Invalid Static Rate */
113 	IBT_SGID_INVALID		= 19,	/* Invalid SGID or SGID index */
114 	IBT_NODE_RECORDS_NOT_FOUND	= 20,	/* NODEInfo records not found */
115 	IBT_GIDS_NOT_FOUND		= 21,	/* Companion GIDs not found */
116 	IBT_INCONSISTENT_AR		= 22,	/* Address Record contradicts */
117 						/* an existing Address Record */
118 	IBT_AR_NOT_REGISTERED		= 23,	/* Address Record is not */
119 						/* currently registered */
120 	IBT_MULTIPLE_AR			= 24,	/* Multiple records exist for */
121 						/* what should be a unique */
122 						/* query result. One of the */
123 						/* records was returned. */
124 	IBT_DEST_IP_GID_NOT_FOUND	= 25,	/* No IP to GID Mapping */
125 	IBT_SRC_IP_NOT_FOUND		= 26,	/* SRC IP Endpoint not found */
126 	IBT_NO_SUCH_OBJECT		= 27,	/* No such object */
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 	IBT_CHAN_WQE_SZ_INSUFF		= 417,	/* inline-data/LSO too large */
214 
215 	/*
216 	 * Completion Queue (CQ) errors
217 	 */
218 	IBT_CQ_HDL_INVALID		= 500,	/* Invalid CQ Handle */
219 	IBT_CQ_SZ_INSUFFICIENT		= 501,  /* The Size of the CQ is too */
220 						/* small, there are more */
221 						/* outstanding completions */
222 						/* than the requested size. */
223 	IBT_CQ_BUSY			= 502,	/* WQ(s) Still Reference CQ */
224 	IBT_CQ_EMPTY			= 503,	/* Completion Queue Empty */
225 	IBT_CQ_NOTIFY_TYPE_INVALID	= 504,	/* Invalid notification type */
226 	IBT_CQ_INVALID_PRIORITY		= 505,	/* Invalid CQ Priority */
227 
228 	/*
229 	 * Reserved for future use.
230 	 */
231 	IBT_ERR_OPAQUE4			= 600,
232 	IBT_ERR_OPAQUE5			= 601,
233 	IBT_ERR_OPAQUE6			= 602,
234 	IBT_ERR_OPAQUE7			= 700,
235 	IBT_ERR_OPAQUE8			= 701,
236 	IBT_ERR_OPAQUE9 		= 702,
237 	IBT_ERR_OPAQUE10		= 703,
238 
239 	/*
240 	 * Memory operation errors
241 	 */
242 	IBT_MR_VA_INVALID		= 800,	/* Invalid Virtual Address */
243 	IBT_MR_LEN_INVALID		= 801,	/* Invalid Memory Length */
244 	IBT_MR_PHYSBUF_INVALID 		= 802,	/* Invalid Physical Buffer */
245 						/* List */
246 	IBT_MR_OFFSET_INVALID		= 803,	/* Invalid Memory Offset */
247 	IBT_MR_LKEY_INVALID		= 804,	/* Invalid Memory L_KEY */
248 	IBT_MR_RKEY_INVALID		= 805,	/* Invalid Memory R_KEY */
249 	IBT_MR_HDL_INVALID 		= 806,	/* Invalid Memory Region */
250 						/* Handle */
251 	IBT_MR_ACCESS_REQ_INVALID 	= 807,	/* Invalid Access Control */
252 						/* Specifier */
253 	IBT_MR_IN_USE			= 808,	/* Mem region in Use */
254 	IBT_MW_HDL_INVALID 		= 809,	/* Invalid Memory Window */
255 						/* Handle */
256 	IBT_MW_TYPE_INVALID		= 810,
257 	IBT_MA_HDL_INVALID		= 811,  /* Invalid Memory Area Hdl */
258 	IBT_SGL_TOO_SMALL		= 812,
259 	IBT_MI_HDL_INVALID		= 813,
260 
261 	/*
262 	 * Multicast errors
263 	 */
264 	IBT_MC_OPAQUE			= 900,	/* Invalid MLID */
265 	IBT_MC_MGID_INVALID		= 901,	/* Invalid MGID */
266 	IBT_MC_GROUP_INVALID		= 902,	/* Invalid MC Group */
267 
268 	/*
269 	 * Partition table errors.
270 	 */
271 	IBT_PKEY_IX_ILLEGAL		= 1000,	/* P_Key index Out of range */
272 	IBT_PKEY_IX_INVALID		= 1001,	/* P_Key index specifies */
273 						/* invalid entry in table */
274 	/*
275 	 * Protection Domain errors
276 	 */
277 	IBT_PD_HDL_INVALID		= 1100,	/* Invalid protection domain */
278 	IBT_PD_IN_USE			= 1101,	/* Protection Domain in Use */
279 	IBT_MEM_ALLOC_HDL_INVALID	= 1102,	/* Invalid MEM handle */
280 
281 	/*
282 	 * Shared Receive Queue errors
283 	 */
284 	IBT_SRQ_HDL_INVALID		= 1200,	/* Invalid SRQ Handle */
285 	IBT_SRQ_ERROR_STATE		= 1201, /* SRQ in Error State */
286 	IBT_SRQ_LIMIT_EXCEEDED		= 1202, /* SRQ Limit exceeds max SRQ */
287 						/* size */
288 	IBT_SRQ_SZ_INSUFFICIENT		= 1203,	/* The Size of the WQ is too */
289 						/* small, there are more */
290 						/* outstanding entries than */
291 	IBT_SRQ_IN_USE			= 1204,	/* SRQ Still has QPs */
292 						/* associated with it */
293 	/*
294 	 * FMR Errors
295 	 */
296 	IBT_FMR_POOL_HDL_INVALID	= 1300,	/* Invalid FMR Pool handle */
297 	IBT_FMR_POOL_IN_USE		= 1301,	/* FMR Pool in use. */
298 	IBT_PBL_TOO_SMALL		= 1302
299 } ibt_status_t;
300 
301 /*
302  * Work Request Completion Return Status.
303  *
304  * Refer InfiniBand Architecture Release Volume 1:
305  * Section 11.6.2 Completion Return Status.
306  *
307  * NOTE: this was converted from an enum to a uint8_t to save space.
308  */
309 typedef uint8_t ibt_wc_status_t;
310 #define	IBT_WC_SUCCESS			0	/* WR Completed Successfully */
311 #define	IBT_WC_LOCAL_LEN_ERR		10	/* Data in WR posted to local */
312 						/* queue too big */
313 #define	IBT_WC_LOCAL_CHAN_OP_ERR	11	/* Internal consistency error */
314 #define	IBT_WC_LOCAL_PROTECT_ERR	13	/* Memory Region violation */
315 						/* for posted WR */
316 #define	IBT_WC_WR_FLUSHED_ERR		14	/* WR was in process when the */
317 						/* chan went to error state */
318 #define	IBT_WC_MEM_WIN_BIND_ERR		15	/* Consumer had insufficient */
319 						/* access rights */
320 
321 	/*
322 	 * Errors that are only reported for Reliable Queue Pairs.
323 	 */
324 #define	IBT_WC_BAD_RESPONSE_ERR		20	/* An unexpected transport */
325 						/* layer opcode was returned */
326 						/* by the responder */
327 #define	IBT_WC_LOCAL_ACCESS_ERR		21	/* A protection error */
328 						/* occurred on a local data */
329 						/* buffer during the */
330 						/* processing of a RDMA Write */
331 						/* with Immediate Data */
332 						/* operation sent from the */
333 						/* remote node */
334 						/* data buffer */
335 #define	IBT_WC_REMOTE_INVALID_REQ_ERR	22	/* Responder detected invalid */
336 						/* message on the channel */
337 #define	IBT_WC_REMOTE_ACCESS_ERR	23	/* Protection Error on remote */
338 						/* data buffer */
339 #define	IBT_WC_REMOTE_OP_ERR		24	/* Operation could not be */
340 						/* completed by the responder */
341 #define	IBT_WC_TRANS_TIMEOUT_ERR	25	/* Local transport retry */
342 						/* counter exceeded */
343 #define	IBT_WC_RNR_NAK_TIMEOUT_ERR	26	/* RNR NAK retry counter */
344 						/* exceeded */
345 #ifdef	__cplusplus
346 }
347 #endif
348 
349 #endif /* _SYS_IB_IBTL_IBTL_STATUS_H */
350