xref: /illumos-gate/usr/src/uts/common/io/ib/clients/rdsv3/ib_sysctl.c (revision b27516f55237249607f754e6e42e865f12456675)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
23  */
24 
25 /*
26  * Copyright (c) 2006 Oracle.  All rights reserved.
27  *
28  * This software is available to you under a choice of one of two
29  * licenses.  You may choose to be licensed under the terms of the GNU
30  * General Public License (GPL) Version 2, available from the file
31  * COPYING in the main directory of this source tree, or the
32  * OpenIB.org BSD license below:
33  *
34  *     Redistribution and use in source and binary forms, with or
35  *     without modification, are permitted provided that the following
36  *     conditions are met:
37  *
38  *      - Redistributions of source code must retain the above
39  *        copyright notice, this list of conditions and the following
40  *        disclaimer.
41  *
42  *      - Redistributions in binary form must reproduce the above
43  *        copyright notice, this list of conditions and the following
44  *        disclaimer in the documentation and/or other materials
45  *        provided with the distribution.
46  *
47  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
48  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
49  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
50  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
51  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
52  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
53  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54  * SOFTWARE.
55  *
56  */
57 #include <sys/ib/clients/rdsv3/ib.h>
58 #include <sys/ib/clients/rdsv3/rdsv3_debug.h>
59 
60 unsigned long rdsv3_ib_sysctl_max_send_wr = RDSV3_IB_DEFAULT_SEND_WR;
61 unsigned long rdsv3_ib_sysctl_max_recv_wr = RDSV3_IB_DEFAULT_RECV_WR;
62 unsigned long rdsv3_ib_sysctl_max_recv_allocation =
63 	(512 * 1024 * 1024) / RDSV3_FRAG_SIZE;
64 /* hardware will fail CQ creation long before this */
65 
66 unsigned long rdsv3_ib_sysctl_max_unsig_wrs = 16;
67 
68 unsigned long rdsv3_ib_sysctl_max_unsig_bytes = (16 << 20);
69 
70 /*
71  * This sysctl does nothing.
72  *
73  * Backwards compatibility with RDS 3.0 wire protocol
74  * disables initial FC credit exchange.
75  * If it's ever possible to drop 3.0 support,
76  * setting this to 1 and moving init/refill of send/recv
77  * rings from ib_cm_connect_complete() back into ib_setup_qp()
78  * will cause credits to be added before protocol negotiation.
79  */
80 unsigned int rdsv3_ib_sysctl_flow_control = 0;
81 
82 void
83 rdsv3_ib_sysctl_exit(void)
84 {
85 }
86 
87 int
88 rdsv3_ib_sysctl_init(void)
89 {
90 	RDSV3_DPRINTF2("rdsv3_ib_sysctl_init",
91 	    "rdsv3_ib_sysctl_max_send_wr = 0x%lx "
92 	    "rdsv3_ib_sysctl_max_recv_wr = 0x%lx "
93 	    "rdsv3_ib_sysctl_max_recv_allocation = 0x%lx "
94 	    "rdsv3_ib_sysctl_max_unsig_wrs = 0x%lx "
95 	    "rdsv3_ib_sysctl_max_unsig_bytes = 0x%lx "
96 	    "rdsv3_ib_sysctl_flow_control = 0x%x",
97 	    rdsv3_ib_sysctl_max_send_wr,
98 	    rdsv3_ib_sysctl_max_recv_wr,
99 	    rdsv3_ib_sysctl_max_recv_allocation,
100 	    rdsv3_ib_sysctl_max_unsig_wrs,
101 	    rdsv3_ib_sysctl_max_unsig_bytes,
102 	    rdsv3_ib_sysctl_flow_control);
103 	return (0);
104 }
105