netio_errors.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * Copyright 2010 Tilera Corporation. All Rights Reserved.
  3. *
  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.
  7. *
  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
  12. * more details.
  13. */
  14. /**
  15. * Error codes returned from NetIO routines.
  16. */
  17. #ifndef __NETIO_ERRORS_H__
  18. #define __NETIO_ERRORS_H__
  19. /**
  20. * @addtogroup error
  21. *
  22. * @brief The error codes returned by NetIO functions.
  23. *
  24. * NetIO functions return 0 (defined as ::NETIO_NO_ERROR) on success, and
  25. * a negative value if an error occurs.
  26. *
  27. * In cases where a NetIO function failed due to a error reported by
  28. * system libraries, the error code will be the negation of the
  29. * system errno at the time of failure. The @ref netio_strerror()
  30. * function will deliver error strings for both NetIO and system error
  31. * codes.
  32. *
  33. * @{
  34. */
  35. /** The set of all NetIO errors. */
  36. typedef enum
  37. {
  38. /** Operation successfully completed. */
  39. NETIO_NO_ERROR = 0,
  40. /** A packet was successfully retrieved from an input queue. */
  41. NETIO_PKT = 0,
  42. /** Largest NetIO error number. */
  43. NETIO_ERR_MAX = -701,
  44. /** The tile is not registered with the IPP. */
  45. NETIO_NOT_REGISTERED = -701,
  46. /** No packet was available to retrieve from the input queue. */
  47. NETIO_NOPKT = -702,
  48. /** The requested function is not implemented. */
  49. NETIO_NOT_IMPLEMENTED = -703,
  50. /** On a registration operation, the target queue already has the maximum
  51. * number of tiles registered for it, and no more may be added. On a
  52. * packet send operation, the output queue is full and nothing more can
  53. * be queued until some of the queued packets are actually transmitted. */
  54. NETIO_QUEUE_FULL = -704,
  55. /** The calling process or thread is not bound to exactly one CPU. */
  56. NETIO_BAD_AFFINITY = -705,
  57. /** Cannot allocate memory on requested controllers. */
  58. NETIO_CANNOT_HOME = -706,
  59. /** On a registration operation, the IPP specified is not configured
  60. * to support the options requested; for instance, the application
  61. * wants a specific type of tagged headers which the configured IPP
  62. * doesn't support. Or, the supplied configuration information is
  63. * not self-consistent, or is out of range; for instance, specifying
  64. * both NETIO_RECV and NETIO_NO_RECV, or asking for more than
  65. * NETIO_MAX_SEND_BUFFERS to be preallocated. On a VLAN or bucket
  66. * configure operation, the number of items, or the base item, was
  67. * out of range.
  68. */
  69. NETIO_BAD_CONFIG = -707,
  70. /** Too many tiles have registered to transmit packets. */
  71. NETIO_TOOMANY_XMIT = -708,
  72. /** Packet transmission was attempted on a queue which was registered
  73. with transmit disabled. */
  74. NETIO_UNREG_XMIT = -709,
  75. /** This tile is already registered with the IPP. */
  76. NETIO_ALREADY_REGISTERED = -710,
  77. /** The Ethernet link is down. The application should try again later. */
  78. NETIO_LINK_DOWN = -711,
  79. /** An invalid memory buffer has been specified. This may be an unmapped
  80. * virtual address, or one which does not meet alignment requirements.
  81. * For netio_input_register(), this error may be returned when multiple
  82. * processes specify different memory regions to be used for NetIO
  83. * buffers. That can happen if these processes specify explicit memory
  84. * regions with the ::NETIO_FIXED_BUFFER_VA flag, or if tmc_cmem_init()
  85. * has not been called by a common ancestor of the processes.
  86. */
  87. NETIO_FAULT = -712,
  88. /** Cannot combine user-managed shared memory and cache coherence. */
  89. NETIO_BAD_CACHE_CONFIG = -713,
  90. /** Smallest NetIO error number. */
  91. NETIO_ERR_MIN = -713,
  92. #ifndef __DOXYGEN__
  93. /** Used internally to mean that no response is needed; never returned to
  94. * an application. */
  95. NETIO_NO_RESPONSE = 1
  96. #endif
  97. } netio_error_t;
  98. /** @} */
  99. #endif /* __NETIO_ERRORS_H__ */