Debian Codegraph @

dat/include/dat2/dat_error.h

raw
1 /*
2 * Copyright (c) 2002-2006, Network Appliance, Inc. All rights reserved.
3 *
4 * This Software is licensed under all of the following licenses:
5 *
6 * 1) under the terms of the "Common Public License 1.0" a copy of which is
7 * in the file LICENSE.txt in the root directory. The license is also
8 * available from the Open Source Initiative, see
9 * http://www.opensource.org/licenses/cpl.php.
10 *
11 * 2) under the terms of the "The BSD License" a copy of which is in the file
12 * LICENSE2.txt in the root directory. The license is also available from
13 * the Open Source Initiative, see
14 * http://www.opensource.org/licenses/bsd-license.php.
15 *
16 * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
17 * copy of which is in the file LICENSE3.txt in the root directory. The
18 * license is also available from the Open Source Initiative, see
19 * http://www.opensource.org/licenses/gpl-license.php.
20 *
21 * Licensee has the right to choose one of the above licenses.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions are
25 * met:
26 *
27 * Redistributions of source code must retain both the above copyright
28 * notice and one of the license notices.
29 *
30 * Redistributions in binary form must reproduce both the above copyright
31 * notice, one of the license notices in the documentation
32 * and/or other materials provided with the distribution.
33 *
34 * Neither the name of Network Appliance, Inc. nor the names of other DAT
35 * Collaborative contributors may be used to endorse or promote
36 * products derived from this software without specific prior written
37 * permission.
38 */
39
40 /***********************************************************
41 *
42 * HEADER: dat_error.h
43 *
44 * PURPOSE: DAT return codes
45 *
46 * Description: Header file for "DAPL: Direct Access Programming
47 * Library, Version: 2.0"
48 *
49 * Mapping rules:
50 * Error types are compound types, as mapped out below.
51 *
52 *********************************************************/
53
54 #ifndef _DAT_ERROR_H_
55 #define _DAT_ERROR_H_
56
57 /*
58 *
59 * All return codes are actually a 3-way tuple:
60 *
61 * type: DAT_RETURN_CLASS DAT_RETURN_TYPE DAT_RETURN_SUBTYPE
62 * bits: 31-30 29-16 15-0
63 *
64 * 3 2 1
65 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
66 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
67 * | C | DAT_RETURN_TYPE | DAT_RETURN_SUBTYPE |
68 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
69 *
70 */
71
72 /*
73 * Class Bits
74 */
75 #define DAT_CLASS_ERROR 0x80000000
76 #define DAT_CLASS_WARNING 0x40000000
77 #define DAT_CLASS_SUCCESS 0x00000000
78 /*
79 * DAT Error bits
80 */
81 #define DAT_TYPE_MASK 0x3fff0000 /* mask for DAT_TYPE_STATUS bits */
82 #define DAT_SUBTYPE_MASK 0x0000FFFF /* mask for DAT_SUBTYPE_STATUS bits */
83
84 /*
85 * Determining the success of an operation is best done with a macro;
86 * each of these returns a boolean value.
87 */
88 #define DAT_IS_WARNING(status) ((DAT_UINT32)(status) & DAT_CLASS_WARNING)
89
90 #define DAT_GET_TYPE(status) ((DAT_UINT32)(status) & DAT_TYPE_MASK)
91 #define DAT_GET_SUBTYPE(status) ((DAT_UINT32)(status) & DAT_SUBTYPE_MASK)
92
93 /*
94 * DAT return types. The ERROR bit is enabled for these definitions
95 */
96 typedef enum dat_return_type
97 {
98 /* The operation was successful. */
99 DAT_SUCCESS = 0x00000000,
100
101 /* The operation was aborted because IA was closed or EVD was *
102 * destroyed. */
103 DAT_ABORT = 0x00010000,
104
105 /* The specified Connection Qualifier was in use. */
106 DAT_CONN_QUAL_IN_USE = 0x00020000,
107
108 /* The operation failed due to resource limitations. */
109 DAT_INSUFFICIENT_RESOURCES = 0x00030000,
110
111 /* Provider internal error. This error can be returned by any *
112 * operation when the Provider has detected an internal error.*
113 * This error does not mask any error caused by the Consumer. */
114 DAT_INTERNAL_ERROR = 0x00040000,
115
116 /* One of the DAT handles was invalid. */
117 DAT_INVALID_HANDLE = 0x00050000,
118
119 /* One of the parameters was invalid. */
120 DAT_INVALID_PARAMETER = 0x00060000,
121
122 /* One of the parameters was invalid for this operation. There*
123 * are Event Streams associated with the Event Dispatcher *
124 * feeding it. */
125 DAT_INVALID_STATE = 0x00070000,
126
127 /* The size of the receiving buffer is too small for sending *
128 * buffer data. The size of the local buffer is too small for*
129 * the data of the remote buffer. */
130 DAT_LENGTH_ERROR = 0x00080000,
131
132 /* The requested Model was not supported by the Provider. */
133 DAT_MODEL_NOT_SUPPORTED = 0x00090000,
134
135 /* The specified IA name was not found in the list of *
136 * registered Providers. */
137 DAT_PROVIDER_NOT_FOUND = 0x000A0000,
138
139 /* Protection violation for local or remote memory access *
140 * Protection Zone mismatch between an LMR of one of the *
141 * local_iov segments and the local Endpoint. */
142 DAT_PRIVILEGES_VIOLATION = 0x000B0000,
143
144 /* Privileges violation for local or remote memory access. One*
145 * of the LMRs used in local_iov was either invalid or did not*
146 * have local read privileges. */
147 DAT_PROTECTION_VIOLATION = 0x000C0000,
148
149 /* The operation timed out without a notification. */
150 DAT_QUEUE_EMPTY = 0x000D0000,
151
152 /* The Event Dispatcher queue is full. */
153 DAT_QUEUE_FULL = 0x000E0000,
154
155 /* The operation timed out. uDAPL ONLY */
156 DAT_TIMEOUT_EXPIRED = 0x000F0000,
157
158 /* The provider name was already registered */
159 DAT_PROVIDER_ALREADY_REGISTERED = 0x00100000,
160
161 /* The provider is "in-use" and cannot be closed at this time */
162 DAT_PROVIDER_IN_USE = 0x00110000,
163
164 /* The requested remote address is not valid or not reachable */
165 DAT_INVALID_ADDRESS = 0x00120000,
166
167 /* [Unix only] dat_evd_wait or dat_cno_wait has been *
168 * interrupted. */
169 DAT_INTERRUPTED_CALL = 0x00130000,
170
171 /* No Connection Qualifiers are available */
172 DAT_CONN_QUAL_UNAVAILABLE = 0x00140000,
173
174 /* kDAPL reserved LMR */
175 DAT_RESERVED_LMR = 0x00150000, /* kdapl only */
176
177 /* The specified IP Port was in use. */
178 DAT_PORT_IN_USE = 0x00160000,
179 /* The specified COMM not supported. */
180 DAT_COMM_NOT_SUPPORTED = 0x00170000,
181
182 #ifdef DAT_EXTENSIONS
183 /* The DAT extensions support. */
184 DAT_EXTENSION_BASE = 0x10000000,
185 /* range 0x10000000 - 0x3FFF0000 is reserved for extensions */
186 #endif /* DAT_EXTENSIONS */
187
188 /* Provider does not support the operation yet. */
189 DAT_NOT_IMPLEMENTED = 0x3FFF0000
190 } DAT_RETURN_TYPE;
191
192 typedef DAT_UINT32 DAT_RETURN;
193
194 /* Backward compatibility with DAT 1.0 */
195 #define DAT_NAME_NOT_FOUND DAT_PROVIDER_NOT_FOUND
196
197 /*
198 * DAT_RETURN_SUBTYPE listing
199 */
200
201 typedef enum dat_return_subtype
202 {
203 /* First element is no subtype */
204 DAT_NO_SUBTYPE,
205 /* ABORT sub types */
206 /* call was interrupted by a signal, or otherwise */
207 DAT_SUB_INTERRUPTED,
208
209 /* DAT_CONN_QUAL_IN_USE has no subtypes */
210
211 /* INSUFFICIENT_RESOURCES subtypes */
212 DAT_RESOURCE_MEMORY,
213 DAT_RESOURCE_DEVICE,
214 DAT_RESOURCE_TEP, /* transport endpoint, e.g. QP */
215 DAT_RESOURCE_TEVD, /* transport EVD, e.g. CQ */
216 DAT_RESOURCE_PROTECTION_DOMAIN,
217 DAT_RESOURCE_MEMORY_REGION, /* HCA memory for LMR or RMR */
218 DAT_RESOURCE_ERROR_HANDLER,
219 DAT_RESOURCE_CREDITS, /* e.g outstanding RDMA Read credit as target */
220 DAT_RESOURCE_SRQ,
221
222 /* DAT_INTERNAL_ERROR has no subtypes */
223
224 /* INVALID_HANDLE subtypes */
225
226 DAT_INVALID_HANDLE_IA,
227 DAT_INVALID_HANDLE_EP,
228 DAT_INVALID_HANDLE_LMR,
229 DAT_INVALID_HANDLE_RMR,
230 DAT_INVALID_HANDLE_PZ,
231 DAT_INVALID_HANDLE_PSP,
232 DAT_INVALID_HANDLE_RSP,
233 DAT_INVALID_HANDLE_CR,
234 DAT_INVALID_HANDLE_CNO,
235 DAT_INVALID_HANDLE_EVD_CR,
236 DAT_INVALID_HANDLE_EVD_REQUEST,
237 DAT_INVALID_HANDLE_EVD_RECV,
238 DAT_INVALID_HANDLE_EVD_CONN,
239 DAT_INVALID_HANDLE_EVD_ASYNC,
240 DAT_INVALID_HANDLE_SRQ,
241 DAT_INVALID_HANDLE_CSP,
242 DAT_INVALID_HANDLE1,
243 DAT_INVALID_HANDLE2,
244 DAT_INVALID_HANDLE3,
245 DAT_INVALID_HANDLE4,
246 DAT_INVALID_HANDLE5,
247 DAT_INVALID_HANDLE6,
248 DAT_INVALID_HANDLE7,
249 DAT_INVALID_HANDLE8,
250 DAT_INVALID_HANDLE9,
251 DAT_INVALID_HANDLE10,
252
253 /* DAT_INVALID_PARAMETER subtypes */
254 DAT_INVALID_ARG1,
255 DAT_INVALID_ARG2,
256 DAT_INVALID_ARG3,
257 DAT_INVALID_ARG4,
258 DAT_INVALID_ARG5,
259 DAT_INVALID_ARG6,
260 DAT_INVALID_ARG7,
261 DAT_INVALID_ARG8,
262 DAT_INVALID_ARG9,
263 DAT_INVALID_ARG10,
264
265 /* DAT_INVALID_EP_STATE subtypes */
266 DAT_INVALID_STATE_EP_UNCONNECTED,
267 DAT_INVALID_STATE_EP_ACTCONNPENDING,
268 DAT_INVALID_STATE_EP_PASSCONNPENDING,
269 DAT_INVALID_STATE_EP_TENTCONNPENDING,
270 DAT_INVALID_STATE_EP_CONNECTED,
271 DAT_INVALID_STATE_EP_DISCONNECTED,
272 DAT_INVALID_STATE_EP_RESERVED,
273 DAT_INVALID_STATE_EP_COMPLPENDING,
274 DAT_INVALID_STATE_EP_DISCPENDING,
275 DAT_INVALID_STATE_EP_PROVIDERCONTROL,
276 DAT_INVALID_STATE_EP_NOTREADY,
277 DAT_INVALID_STATE_EP_RECV_WATERMARK,
278 DAT_INVALID_STATE_EP_PZ,
279 DAT_INVALID_STATE_EP_EVD_REQUEST,
280 DAT_INVALID_STATE_EP_EVD_RECV,
281 DAT_INVALID_STATE_EP_EVD_CONNECT,
282 DAT_INVALID_STATE_EP_UNCONFIGURED,
283 DAT_INVALID_STATE_EP_UNCONFRESERVED,
284 DAT_INVALID_STATE_EP_UNCONFPASSIVE,
285 DAT_INVALID_STATE_EP_UNCONFTENTATIVE,
286 DAT_INVALID_STATE_CNO_IN_USE,
287 DAT_INVALID_STATE_CNO_DEAD,
288
289 /* EVD states. Enabled/Disabled, Waitable/Unwaitable, *
290 * and Notify/Solicited/Threshold are 3 orthogonal *
291 * bands of EVD state.The Threshold one is uDAPL specific. */
292 DAT_INVALID_STATE_EVD_OPEN,
293 /* EVD can be either in enabled or disabled but not both *
294 * or neither at the same time */
295 DAT_INVALID_STATE_EVD_ENABLED,
296 DAT_INVALID_STATE_EVD_DISABLED,
297 /* EVD can be either in waitable or unwaitable but not *
298 * both or neither at the same time */
299 DAT_INVALID_STATE_EVD_WAITABLE,
300 DAT_INVALID_STATE_EVD_UNWAITABLE,
301 /* Do not release an EVD if it is in use */
302 DAT_INVALID_STATE_EVD_IN_USE,
303
304 /* EVD can be either in notify or solicited or threshold *
305 * but not any pair, or all, or none at the same time. *
306 * The threshold one is for uDAPL only */
307 DAT_INVALID_STATE_EVD_CONFIG_NOTIFY,
308 DAT_INVALID_STATE_EVD_CONFIG_SOLICITED,
309 DAT_INVALID_STATE_EVD_CONFIG_THRESHOLD,
310 DAT_INVALID_STATE_EVD_WAITER,
311 DAT_INVALID_STATE_EVD_ASYNC, /* Async EVD required */
312 DAT_INVALID_STATE_IA_IN_USE,
313 DAT_INVALID_STATE_LMR_IN_USE,
314 DAT_INVALID_STATE_LMR_FREE,
315 DAT_INVALID_STATE_PZ_IN_USE,
316 DAT_INVALID_STATE_PZ_FREE,
317
318 /* DAT_INVALID_STATE_SRQ subtypes */
319 DAT_INVALID_STATE_SRQ_OPERATIONAL,
320 DAT_INVALID_STATE_SRQ_ERROR,
321 DAT_INVALID_STATE_SRQ_IN_USE,
322 DAT_INVALID_STATE_SRQ_SHUTDOWN,
323
324 /* DAT_LENGTH_ERROR has no subtypes */
325
326 /* DAT_MODEL_NOT_SUPPORTED has no subtypes */
327
328 /* DAT_PRIVILEGES_VIOLATION subtypes */
329 DAT_PRIVILEGES_READ,
330 DAT_PRIVILEGES_WRITE,
331 DAT_PRIVILEGES_RDMA_READ,
332 DAT_PRIVILEGES_RDMA_WRITE,
333
334 /* DAT_PROTECTION_VIOLATION subtypes */
335 DAT_PROTECTION_READ,
336 DAT_PROTECTION_WRITE,
337 DAT_PROTECTION_RDMA_READ,
338 DAT_PROTECTION_RDMA_WRITE,
339
340 /* DAT_QUEUE_EMPTY has no subtypes */
341
342 /* DAT_QUEUE_FULL has no subtypes */
343
344 /* DAT_TIMEOUT_EXPIRED has no subtypes */
345
346 /* DAT_PROVIDER_ALREADY_REGISTERED has no subtypes */
347
348 /* DAT_PROVIDER_IN_USE has no subtypes */
349
350 /* DAT_INVALID_ADDRESS subtypes */
351
352 /* Unsupported addresses - those that are not Malformed, but *
353 * are incorrect for use in DAT (regardless of local routing *
354 * capabilities): IPv6 Multicast Addresses (ff/8) IPv4 *
355 * Broadcast/Multicast Addresses */
356
357 DAT_INVALID_ADDRESS_UNSUPPORTED,
358 /* Unreachable addresses - A Provider might know that certain *
359 * addresses are unreachable immediately. One example would be *
360 * an IPv6 addresses on an IPv4-only system. This can also be *
361 * returned if it is known that there is no route to the host. *
362 * A Provider is not obligated to check for this condition. */
363 DAT_INVALID_ADDRESS_UNREACHABLE,
364 /* Malformed addresses -- these cannot be valid in any context.*
365 * Those listed in RFC1884 section 2.3 as "Reserved" or *
366 * "Unassigned". */
367 DAT_INVALID_ADDRESS_MALFORMED,
368
369 /* DAT_INTERRUPTED_CALL has no subtypes */
370
371 /* DAT_CONN_QUAL_UNAVAILABLE has no subtypes */
372
373 /* DAT_PROVIDER_NOT_FOUND subtypes. Erratta to the 1.1 spec */
374
375 DAT_NAME_NOT_REGISTERED,
376 DAT_MAJOR_NOT_FOUND,
377 DAT_MINOR_NOT_FOUND,
378 DAT_THREAD_SAFETY_NOT_FOUND
379 } DAT_RETURN_SUBTYPE;
380
381 #endif /* _DAT_ERROR_H_ */