aboutsummaryrefslogtreecommitdiff
path: root/arch/tile/include/hv/netio_errors.h
blob: e1591bff61b5ce7600349f40d800633954d62e23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
 * Copyright 2010 Tilera Corporation. All Rights Reserved.
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation, version 2.
 *
 *   This program is distributed in the hope that it will be useful, but
 *   WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
 *   NON INFRINGEMENT.  See the GNU General Public License for
 *   more details.
 */

/**
 * Error codes returned from NetIO routines.
 */

#ifndef __NETIO_ERRORS_H__
#define __NETIO_ERRORS_H__

/**
 * @addtogroup error
 *
 * @brief The error codes returned by NetIO functions.
 *
 * NetIO functions return 0 (defined as ::NETIO_NO_ERROR) on success, and
 * a negative value if an error occurs.
 *
 * In cases where a NetIO function failed due to a error reported by
 * system libraries, the error code will be the negation of the
 * system errno at the time of failure.  The @ref netio_strerror()
 * function will deliver error strings for both NetIO and system error
 * codes.
 *
 * @{
 */

/** The set of all NetIO errors. */
typedef enum
{
  /** Operation successfully completed. */
  NETIO_NO_ERROR        = 0,

  /** A packet was successfully retrieved from an input queue. */
  NETIO_PKT             = 0,

  /** Largest NetIO error number. */
  NETIO_ERR_MAX         = -701,

  /** The tile is not registered with the IPP. */
  NETIO_NOT_REGISTERED  = -701,

  /** No packet was available to retrieve from the input queue. */
  NETIO_NOPKT           = -702,

  /** The requested function is not implemented. */
  NETIO_NOT_IMPLEMENTED = -703,

  /** On a registration operation, the target queue already has the maximum
   *  number of tiles registered for it, and no more may be added.  On a
   *  packet send operation, the output queue is full and nothing more can
   *  be queued until some of the queued packets are actually transmitted. */
  NETIO_QUEUE_FULL      = -704,

  /** The calling process or thread is not bound to exactly one CPU. */
  NETIO_BAD_AFFINITY    = -705,

  /** Cannot allocate memory on requested controllers. */
  NETIO_CANNOT_HOME     = -706,

  /** On a registration operation, the IPP specified is not configured
   *  to support the options requested; for instance, the application
   *  wants a specific type of tagged headers which the configured IPP
   *  doesn't support.  Or, the supplied configuration information is
   *  not self-consistent, or is out of range; for instance, specifying
   *  both NETIO_RECV and NETIO_NO_RECV, or asking for more than
   *  NETIO_MAX_SEND_BUFFERS to be preallocated.  On a VLAN or bucket
   *  configure operation, the number of items, or the base item, was
   *  out of range.
   */
  NETIO_BAD_CONFIG      = -707,

  /** Too many tiles have registered to transmit packets. */
  NETIO_TOOMANY_XMIT    = -708,

  /** Packet transmission was attempted on a queue which was registered
      with transmit disabled. */
  NETIO_UNREG_XMIT      = -709,

  /** This tile is already registered with the IPP. */
  NETIO_ALREADY_REGISTERED = -710,

  /** The Ethernet link is down. The application should try again later. */
  NETIO_LINK_DOWN       = -711,

  /** An invalid memory buffer has been specified.  This may be an unmapped
   * virtual address, or one which does not meet alignment requirements.
   * For netio_input_register(), this error may be returned when multiple
   * processes specify different memory regions to be used for NetIO
   * buffers.  That can happen if these processes specify explicit memory
   * regions with the ::NETIO_FIXED_BUFFER_VA flag, or if tmc_cmem_init()
   * has not been called by a common ancestor of the processes.
   */
  NETIO_FAULT           = -712,

  /** Cannot combine user-managed shared memory and cache coherence. */
  NETIO_BAD_CACHE_CONFIG = -713,

  /** Smallest NetIO error number. */
  NETIO_ERR_MIN         = -713,

#ifndef __DOXYGEN__
  /** Used internally to mean that no response is needed; never returned to
   *  an application. */
  NETIO_NO_RESPONSE     = 1
#endif
} netio_error_t;

/** @} */

#endif /* __NETIO_ERRORS_H__ */