2 * Copyright 2010 Tilera Corporation. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation, version 2.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
11 * NON INFRINGEMENT. See the GNU General Public License for
16 * Error codes returned from NetIO routines.
19 #ifndef __NETIO_ERRORS_H__
20 #define __NETIO_ERRORS_H__
25 * @brief The error codes returned by NetIO functions.
27 * NetIO functions return 0 (defined as ::NETIO_NO_ERROR) on success, and
28 * a negative value if an error occurs.
30 * In cases where a NetIO function failed due to a error reported by
31 * system libraries, the error code will be the negation of the
32 * system errno at the time of failure. The @ref netio_strerror()
33 * function will deliver error strings for both NetIO and system error
39 /** The set of all NetIO errors. */
42 /** Operation successfully completed. */
45 /** A packet was successfully retrieved from an input queue. */
48 /** Largest NetIO error number. */
51 /** The tile is not registered with the IPP. */
52 NETIO_NOT_REGISTERED
= -701,
54 /** No packet was available to retrieve from the input queue. */
57 /** The requested function is not implemented. */
58 NETIO_NOT_IMPLEMENTED
= -703,
60 /** On a registration operation, the target queue already has the maximum
61 * number of tiles registered for it, and no more may be added. On a
62 * packet send operation, the output queue is full and nothing more can
63 * be queued until some of the queued packets are actually transmitted. */
64 NETIO_QUEUE_FULL
= -704,
66 /** The calling process or thread is not bound to exactly one CPU. */
67 NETIO_BAD_AFFINITY
= -705,
69 /** Cannot allocate memory on requested controllers. */
70 NETIO_CANNOT_HOME
= -706,
72 /** On a registration operation, the IPP specified is not configured
73 * to support the options requested; for instance, the application
74 * wants a specific type of tagged headers which the configured IPP
75 * doesn't support. Or, the supplied configuration information is
76 * not self-consistent, or is out of range; for instance, specifying
77 * both NETIO_RECV and NETIO_NO_RECV, or asking for more than
78 * NETIO_MAX_SEND_BUFFERS to be preallocated. On a VLAN or bucket
79 * configure operation, the number of items, or the base item, was
82 NETIO_BAD_CONFIG
= -707,
84 /** Too many tiles have registered to transmit packets. */
85 NETIO_TOOMANY_XMIT
= -708,
87 /** Packet transmission was attempted on a queue which was registered
88 with transmit disabled. */
89 NETIO_UNREG_XMIT
= -709,
91 /** This tile is already registered with the IPP. */
92 NETIO_ALREADY_REGISTERED
= -710,
94 /** The Ethernet link is down. The application should try again later. */
95 NETIO_LINK_DOWN
= -711,
97 /** An invalid memory buffer has been specified. This may be an unmapped
98 * virtual address, or one which does not meet alignment requirements.
99 * For netio_input_register(), this error may be returned when multiple
100 * processes specify different memory regions to be used for NetIO
101 * buffers. That can happen if these processes specify explicit memory
102 * regions with the ::NETIO_FIXED_BUFFER_VA flag, or if tmc_cmem_init()
103 * has not been called by a common ancestor of the processes.
107 /** Cannot combine user-managed shared memory and cache coherence. */
108 NETIO_BAD_CACHE_CONFIG
= -713,
110 /** Smallest NetIO error number. */
111 NETIO_ERR_MIN
= -713,
114 /** Used internally to mean that no response is needed; never returned to
116 NETIO_NO_RESPONSE
= 1
122 #endif /* __NETIO_ERRORS_H__ */