2 * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
\r
3 * Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
\r
5 * This software is available to you under the OpenIB.org BSD license
\r
8 * Redistribution and use in source and binary forms, with or
\r
9 * without modification, are permitted provided that the following
\r
10 * conditions are met:
\r
12 * - Redistributions of source code must retain the above
\r
13 * copyright notice, this list of conditions and the following
\r
16 * - Redistributions in binary form must reproduce the above
\r
17 * copyright notice, this list of conditions and the following
\r
18 * disclaimer in the documentation and/or other materials
\r
19 * provided with the distribution.
\r
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
25 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
26 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
36 * Defines string to decode ib_api_status_t return values.
\r
43 #include <iba/ib_types.h>
\r
46 /* ib_api_status_t values above converted to text for easier printing. */
\r
47 static const char* const __ib_error_str[] =
\r
50 "IB_INSUFFICIENT_RESOURCES",
\r
51 "IB_INSUFFICIENT_MEMORY",
\r
52 "IB_INVALID_PARAMETER",
\r
53 "IB_INVALID_SETTING",
\r
58 "IB_INVALID_PERMISSION",
\r
61 "IB_MAX_MCAST_QPS_REACHED",
\r
62 "IB_INVALID_QP_STATE",
\r
63 "IB_INVALID_APM_STATE",
\r
64 "IB_INVALID_PORT_STATE",
\r
70 "IB_INVALID_MAX_WRS",
\r
71 "IB_INVALID_MAX_SGE",
\r
72 "IB_INVALID_CQ_SIZE",
\r
73 "IB_INVALID_SRQ_SIZE",
\r
74 "IB_INVALID_SERVICE_TYPE",
\r
78 "IB_INVALID_CA_HANDLE",
\r
79 "IB_INVALID_AV_HANDLE",
\r
80 "IB_INVALID_CQ_HANDLE",
\r
81 "IB_INVALID_QP_HANDLE",
\r
82 "IB_INVALID_SRQ_HANDLE",
\r
83 "IB_INVALID_PD_HANDLE",
\r
84 "IB_INVALID_MR_HANDLE",
\r
85 "IB_INVALID_FMR_HANDLE",
\r
86 "IB_INVALID_MW_HANDLE",
\r
87 "IB_INVALID_MCAST_HANDLE",
\r
88 "IB_INVALID_CALLBACK",
\r
89 "IB_INVALID_AL_HANDLE",
\r
90 "IB_INVALID_HANDLE",
\r
93 "IB_VERBS_PROCESSING_DONE",
\r
94 "IB_INVALID_WR_TYPE",
\r
95 "IB_QP_IN_TIMEWAIT",
\r
96 "IB_EE_IN_TIMEWAIT",
\r
108 IN ib_api_status_t status )
\r
110 if( status > IB_UNKNOWN_ERROR )
\r
111 status = IB_UNKNOWN_ERROR;
\r
112 return( __ib_error_str[status] );
\r
116 /* ib_async_event_t values above converted to text for easier printing. */
\r
117 static const char* const __ib_async_event_str[] =
\r
119 "IB_AE_DUMMY", /*place holder*/
\r
121 "IB_AE_SQ_DRAINED",
\r
127 "IB_AE_LOCAL_FATAL",
\r
132 "IB_AE_SYSIMG_GUID_TRAP",
\r
133 "IB_AE_BUF_OVERRUN",
\r
134 "IB_AE_LINK_INTEGRITY",
\r
135 "IB_AE_FLOW_CTRL_ERROR",
\r
137 "IB_AE_QP_APM_ERROR",
\r
138 "IB_AE_WQ_REQ_ERROR",
\r
139 "IB_AE_WQ_ACCESS_ERROR",
\r
140 "IB_AE_PORT_ACTIVE", /* ACTIVE STATE */
\r
141 "IB_AE_PORT_DOWN", /* INIT", ARMED", DOWN */
\r
147 ib_get_async_event_str(
\r
148 IN ib_async_event_t event )
\r
150 if( event > IB_AE_UNKNOWN )
\r
151 event = IB_AE_UNKNOWN;
\r
152 return( __ib_async_event_str[event] );
\r
156 static const char* const __ib_wc_status_str[] =
\r
159 "IB_WCS_LOCAL_LEN_ERR",
\r
160 "IB_WCS_LOCAL_OP_ERR",
\r
161 "IB_WCS_LOCAL_PROTECTION_ERR",
\r
162 "IB_WCS_WR_FLUSHED_ERR",
\r
163 "IB_WCS_MEM_WINDOW_BIND_ERR",
\r
164 "IB_WCS_REM_ACCESS_ERR",
\r
165 "IB_WCS_REM_OP_ERR",
\r
166 "IB_WCS_RNR_RETRY_ERR",
\r
167 "IB_WCS_TIMEOUT_RETRY_ERR",
\r
168 "IB_WCS_REM_INVALID_REQ_ERR",
\r
169 "IB_WCS_BAD_RESP_ERR",
\r
170 "IB_WCS_LOCAL_ACCESS_ERR",
\r
171 "IB_WCS_GENERAL_ERR",
\r
172 "IB_WCS_UNMATCHED_RESPONSE", /* InfiniBand Access Layer */
\r
173 "IB_WCS_CANCELED", /* InfiniBand Access Layer */
\r
179 ib_get_wc_status_str(
\r
180 IN ib_wc_status_t wc_status )
\r
182 if( wc_status > IB_WCS_UNKNOWN )
\r
183 wc_status = IB_WCS_UNKNOWN;
\r
184 return( __ib_wc_status_str[wc_status] );
\r
188 static const char* const __ib_wc_type_str[] =
\r
191 "IB_WC_RDMA_WRITE",
\r
196 "IB_WC_COMPARE_SWAP",
\r
197 "IB_WC_RECV_RDMA_WRITE"
\r
203 ib_get_wc_type_str(
\r
204 IN ib_wc_type_t wc_type )
\r
206 if( wc_type > IB_WC_UNKNOWN )
\r
207 wc_type = IB_WC_UNKNOWN;
\r
208 return( __ib_wc_type_str[wc_type] );
\r
212 static const char* const __ib_wr_type_str[] =
\r
214 "WR_DUMMY", /*place holder*/
\r
225 ib_get_wr_type_str(
\r
226 IN uint8_t wr_type )
\r
228 if( wr_type > WR_UNKNOWN )
\r
229 wr_type = WR_UNKNOWN;
\r
230 return( __ib_wr_type_str[wr_type] );
\r
233 static const char* const __ib_qp_type_str[] =
\r
235 "IB_QPT_RELIABLE_CONN"
\r
236 "IB_QPT_UNRELIABLE_CONN",
\r
238 "IB_QPT_UNRELIABLE_DGRM",
\r
242 "IB_QPT_RAW_ETHER",
\r
244 "IB_QPT_QP0_ALIAS",
\r
245 "IB_QPT_QP1_ALIAS",
\r
252 ib_get_qp_type_str(
\r
253 IN uint8_t qp_type )
\r
255 if( qp_type > IB_QPT_UNKNOWN )
\r
256 qp_type = IB_QPT_UNKNOWN;
\r
257 return( __ib_qp_type_str[qp_type] );
\r