4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
31 * This file is part of Lustre, http://www.lustre.org/
32 * Lustre is a trademark of Sun Microsystems, Inc.
34 * lnet/klnds/ralnd/ralnd_modparams.c
36 * Author: Eric Barton <eric@bartonsoftware.com>
41 static int n_connd = 4;
42 CFS_MODULE_PARM(n_connd, "i", int, 0444,
43 "# of connection daemons");
45 static int min_reconnect_interval = 1;
46 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
47 "minimum connection retry interval (seconds)");
49 static int max_reconnect_interval = 60;
50 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
51 "maximum connection retry interval (seconds)");
54 CFS_MODULE_PARM(ntx, "i", int, 0444,
55 "# of transmit descriptors");
57 static int credits = 128;
58 CFS_MODULE_PARM(credits, "i", int, 0444,
59 "# concurrent sends");
61 static int peer_credits = 32;
62 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
63 "# concurrent sends to 1 peer");
65 static int fma_cq_size = 8192;
66 CFS_MODULE_PARM(fma_cq_size, "i", int, 0444,
67 "size of the completion queue");
69 static int timeout = 30;
70 CFS_MODULE_PARM(timeout, "i", int, 0644,
71 "communications timeout (seconds)");
73 static int max_immediate = (2<<10);
74 CFS_MODULE_PARM(max_immediate, "i", int, 0644,
75 "immediate/RDMA breakpoint");
77 kra_tunables_t kranal_tunables = {
78 .kra_n_connd = &n_connd,
79 .kra_min_reconnect_interval = &min_reconnect_interval,
80 .kra_max_reconnect_interval = &max_reconnect_interval,
82 .kra_credits = &credits,
83 .kra_peercredits = &peer_credits,
84 .kra_fma_cq_size = &fma_cq_size,
85 .kra_timeout = &timeout,
86 .kra_max_immediate = &max_immediate,
89 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
91 #ifndef HAVE_SYSCTL_UNNUMBERED
105 #define KRANAL_N_CONND CTL_UNNUMBERED
106 #define KRANAL_RECONNECT_MIN CTL_UNNUMBERED
107 #define KRANAL_RECONNECT_MAX CTL_UNNUMBERED
108 #define KRANAL_NTX CTL_UNNUMBERED
109 #define KRANAL_CREDITS CTL_UNNUMBERED
110 #define KRANAL_PEERCREDITS CTL_UNNUMBERED
111 #define KRANAL_FMA_CQ_SIZE CTL_UNNUMBERED
112 #define KRANAL_TIMEOUT CTL_UNNUMBERED
113 #define KRENAL_IMMEDIATE_MAX CTL_UNNUMBERED
116 static cfs_sysctl_table_t kranal_ctl_table[] = {
118 .ctl_name = KRANAL_N_CONND,
119 .procname = "n_connd",
121 .maxlen = sizeof(int),
123 .proc_handler = &proc_dointvec
126 .ctl_name = KRANAL_RECONNECT_MIN,
127 .procname = "min_reconnect_interval",
128 .data = &min_reconnect_interval,
129 .maxlen = sizeof(int),
131 .proc_handler = &proc_dointvec
134 .ctl_name = KRANAL_RECONNECT_MAX,
135 .procname = "max_reconnect_interval",
136 .data = &max_reconnect_interval,
137 .maxlen = sizeof(int),
139 .proc_handler = &proc_dointvec
142 .ctl_name = KRANAL_NTX,
145 .maxlen = sizeof(int),
147 .proc_handler = &proc_dointvec
150 .ctl_name = KRANAL_CREDITS,
151 .procname = "credits",
153 .maxlen = sizeof(int),
155 .proc_handler = &proc_dointvec
158 .ctl_name = KRANAL_PEERCREDITS,
159 .procname = "peer_credits",
160 .data = &peer_credits,
161 .maxlen = sizeof(int),
163 .proc_handler = &proc_dointvec
166 .ctl_name = KRANAL_FMA_CQ_SIZE,
167 .procname = "fma_cq_size",
168 .data = &fma_cq_size,
169 .maxlen = sizeof(int),
171 .proc_handler = &proc_dointvec
174 .ctl_name = KRANAL_TIMEOUT,
175 .procname = "timeout",
177 .maxlen = sizeof(int),
179 .proc_handler = &proc_dointvec
182 .ctl_name = KRANAL_IMMEDIATE_MAX,
183 .procname = "max_immediate",
184 .data = &max_immediate,
185 .maxlen = sizeof(int),
187 .proc_handler = &proc_dointvec
192 static cfs_sysctl_table_t kranal_top_ctl_table[] = {
194 .ctl_name = CTL_KRANAL,
199 .child = kranal_ctl_table
205 kranal_tunables_init ()
207 kranal_tunables.kra_sysctl =
208 cfs_register_sysctl_table(kranal_top_ctl_table, 0);
210 if (kranal_tunables.kra_sysctl == NULL)
211 CWARN("Can't setup /proc tunables\n");
217 kranal_tunables_fini ()
219 if (kranal_tunables.kra_sysctl != NULL)
220 cfs_unregister_sysctl_table(kranal_tunables.kra_sysctl);
226 kranal_tunables_init ()
232 kranal_tunables_fini ()