2 * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
\r
4 * This software is available to you under the OpenIB.org BSD license
\r
7 * Redistribution and use in source and binary forms, with or
\r
8 * without modification, are permitted provided that the following
\r
9 * conditions are met:
\r
11 * - Redistributions of source code must retain the above
\r
12 * copyright notice, this list of conditions and the following
\r
15 * - Redistributions in binary form must reproduce the above
\r
16 * copyright notice, this list of conditions and the following
\r
17 * disclaimer in the documentation and/or other materials
\r
18 * provided with the distribution.
\r
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
21 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
23 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
24 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
25 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
26 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
33 /* Message sizes. */
\r
34 /* TODO: these sizes are arbitrary */
\r
35 #define IB_MAX_MSG_SIZE 0xFFFFFFFF //(32*1024*1024)
\r
36 #define IB_MAX_RDMA_SIZE 0xFFFFFFFF //(16*1024*1024)
\r
37 #define IB_RDMA_THRESHOLD_SIZE (4*1024)
\r
38 /* TODO: Change back */
\r
39 //#define IB_RDMA_THRESHOLD_SIZE (16*1024)
\r
41 /* Number of work completion to poll at a time */
\r
42 #define WC_LIST_SIZE 8
\r
44 /* QP creation parameters */
\r
45 #define QP_ATTRIB_RESPONDER_RESOURCES 4
\r
46 #define QP_ATTRIB_INITIATOR_DEPTH 4
\r
47 #define QP_ATTRIB_RETRY_COUNT 6
\r
48 #define QP_ATTRIB_RNR_RETRY 7
\r
49 #define QP_ATTRIB_RNR_NAK_TIMEOUT 8 /* 16 ms */
\r
51 #define QP_ATTRIB_SQ_DEPTH 16
\r
54 * Only the RDMA calls can have more than one SGE - the send and receive always
\r
55 * have just one. For send and receives, the switch always uses its internal
\r
56 * buffers. For RDMAs the switch will issue requests with at most 4 SGEs.
\r
57 * We support twice that for good measure.
\r
59 #define QP_ATTRIB_SQ_SGE 8
\r
61 /* Our indexes are single-byte, so make sure we don't screw up. */
\r
62 C_ASSERT( QP_ATTRIB_SQ_DEPTH <= 256 );
\r
65 * TODO: During testing, the switch has been observed to post
\r
66 * 12 receive buffers. It would be nice to know what the max is.
\r
68 #define QP_ATTRIB_RQ_DEPTH 16
\r
69 #define QP_ATTRIB_RQ_SGE 1
\r
71 /* Our indexes are single-byte, so make sure we don't screw up. */
\r
72 C_ASSERT( QP_ATTRIB_RQ_DEPTH <= 256 );
\r
74 /* Number of entries in a CQ */
\r
76 * TODO: Workaround until MTHCA driver supports resize CQ, pre-allocate
\r
77 * for 100 QPs per CQ.
\r
79 #define IB_CQ_SIZE (QP_ATTRIB_SQ_DEPTH + QP_ATTRIB_RQ_DEPTH)
\r
80 #define IB_INIT_CQ_SIZE (IB_CQ_SIZE * 500)
\r
83 #define CM_MIN_LOCAL_TIMEOUT (18)
\r
84 #define CM_LOCAL_TIMEOUT (1)
\r
85 #define CM_MIN_REMOTE_TIMEOUT (18)
\r
86 #define CM_REMOTE_TIMEOUT (2)
\r
87 #define CM_RETRIES 4
\r
89 /* Base service ID for listen */
\r
90 #define BASE_LISTEN_ID (CL_CONST64(0xb6e36efb8eda0000))
\r