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_SERVICE_TYPE",
\r
77 "IB_INVALID_CA_HANDLE",
\r
78 "IB_INVALID_AV_HANDLE",
\r
79 "IB_INVALID_CQ_HANDLE",
\r
80 "IB_INVALID_QP_HANDLE",
\r
81 "IB_INVALID_PD_HANDLE",
\r
82 "IB_INVALID_MR_HANDLE",
\r
83 "IB_INVALID_MW_HANDLE",
\r
84 "IB_INVALID_MCAST_HANDLE",
\r
85 "IB_INVALID_CALLBACK",
\r
86 "IB_INVALID_AL_HANDLE",
\r
87 "IB_INVALID_HANDLE",
\r
89 "IB_REMOTE_ERROR", /* Infiniband Access Layer */
\r
90 "IB_VERBS_PROCESSING_DONE",
\r
91 "IB_INVALID_WR_TYPE",
\r
92 "IB_QP_IN_TIMEWAIT",
\r
93 "IB_EE_IN_TIMEWAIT",
\r
105 IN ib_api_status_t status )
\r
107 if( status > IB_UNKNOWN_ERROR )
\r
108 status = IB_UNKNOWN_ERROR;
\r
109 return( __ib_error_str[status] );
\r
113 /* ib_async_event_t values above converted to text for easier printing. */
\r
114 static const char* const __ib_async_event_str[] =
\r
116 "IB_AE_DUMMY", /*place holder*/
\r
118 "IB_AE_SQ_DRAINED",
\r
124 "IB_AE_LOCAL_FATAL",
\r
129 "IB_AE_SYSIMG_GUID_TRAP",
\r
130 "IB_AE_BUF_OVERRUN",
\r
131 "IB_AE_LINK_INTEGRITY",
\r
132 "IB_AE_FLOW_CTRL_ERROR",
\r
134 "IB_AE_QP_APM_ERROR",
\r
135 "IB_AE_WQ_REQ_ERROR",
\r
136 "IB_AE_WQ_ACCESS_ERROR",
\r
137 "IB_AE_PORT_ACTIVE", /* ACTIVE STATE */
\r
138 "IB_AE_PORT_DOWN", /* INIT", ARMED", DOWN */
\r
144 ib_get_async_event_str(
\r
145 IN ib_async_event_t event )
\r
147 if( event > IB_AE_UNKNOWN )
\r
148 event = IB_AE_UNKNOWN;
\r
149 return( __ib_async_event_str[event] );
\r
153 static const char* const __ib_wc_status_str[] =
\r
156 "IB_WCS_LOCAL_LEN_ERR",
\r
157 "IB_WCS_LOCAL_OP_ERR",
\r
158 "IB_WCS_LOCAL_PROTECTION_ERR",
\r
159 "IB_WCS_WR_FLUSHED_ERR",
\r
160 "IB_WCS_MEM_WINDOW_BIND_ERR",
\r
161 "IB_WCS_REM_ACCESS_ERR",
\r
162 "IB_WCS_REM_OP_ERR",
\r
163 "IB_WCS_RNR_RETRY_ERR",
\r
164 "IB_WCS_TIMEOUT_RETRY_ERR",
\r
165 "IB_WCS_REM_INVALID_REQ_ERR",
\r
166 "IB_WCS_UNMATCHED_RESPONSE", /* InfiniBand Access Layer */
\r
167 "IB_WCS_CANCELED", /* InfiniBand Access Layer */
\r
173 ib_get_wc_status_str(
\r
174 IN ib_wc_status_t wc_status )
\r
176 if( wc_status > IB_WCS_UNKNOWN )
\r
177 wc_status = IB_WCS_UNKNOWN;
\r
178 return( __ib_wc_status_str[wc_status] );
\r
182 static const char* const __ib_wc_type_str[] =
\r
185 "IB_WC_RDMA_WRITE",
\r
190 "IB_WC_COMPARE_SWAP",
\r
191 "IB_WC_RECV_RDMA_WRITE"
\r
197 ib_get_wc_type_str(
\r
198 IN ib_wc_type_t wc_type )
\r
200 if( wc_type > IB_WC_UNKNOWN )
\r
201 wc_type = IB_WC_UNKNOWN;
\r
202 return( __ib_wc_type_str[wc_type] );
\r
206 static const char* const __ib_wr_type_str[] =
\r
208 "WR_DUMMY", /*place holder*/
\r
219 ib_get_wr_type_str(
\r
220 IN uint8_t wr_type )
\r
222 if( wr_type > WR_UNKNOWN )
\r
223 wr_type = WR_UNKNOWN;
\r
224 return( __ib_wr_type_str[wr_type] );
\r