1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lnet/klnds/iiblnd/iiblnd_modparams.c
38 * Author: Eric Barton <eric@bartonsoftware.com>
43 static char *ipif_basename = "ib";
44 CFS_MODULE_PARM(ipif_basename, "s", charp, 0444,
45 "IPoIB interface base name");
47 static char *service_name = "iiblnd";
48 CFS_MODULE_PARM(service_name, "s", charp, 0444,
51 static int service_number = 0x11b9a2;
52 CFS_MODULE_PARM(service_number, "i", int, 0444,
55 static int min_reconnect_interval = 1;
56 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
57 "minimum connection retry interval (seconds)");
59 static int max_reconnect_interval = 60;
60 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
61 "maximum connection retry interval (seconds)");
63 static int concurrent_peers = 1152;
64 CFS_MODULE_PARM(concurrent_peers, "i", int, 0444,
65 "maximum number of peers that may connect");
68 CFS_MODULE_PARM(cksum, "i", int, 0644,
69 "set non-zero to enable message (not RDMA) checksums");
71 static int timeout = 50;
72 CFS_MODULE_PARM(timeout, "i", int, 0644,
76 CFS_MODULE_PARM(ntx, "i", int, 0444,
77 "# of message descriptors");
79 static int credits = 128;
80 CFS_MODULE_PARM(credits, "i", int, 0444,
81 "# concurrent sends");
83 static int peer_credits = 8;
84 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
85 "# concurrent sends to 1 peer");
87 static int sd_retries = 8;
88 CFS_MODULE_PARM(sd_retries, "i", int, 0444,
89 "# times to retry SD queries");
91 static int keepalive = 100;
92 CFS_MODULE_PARM(keepalive, "i", int, 0644,
93 "Idle time in seconds before sending a keepalive");
95 static int concurrent_sends = IBNAL_RX_MSGS;
96 CFS_MODULE_PARM(concurrent_sends, "i", int, 0644,
97 "Send work queue sizing");
99 kib_tunables_t kibnal_tunables = {
100 .kib_ipif_basename = &ipif_basename,
101 .kib_service_name = &service_name,
102 .kib_service_number = &service_number,
103 .kib_min_reconnect_interval = &min_reconnect_interval,
104 .kib_max_reconnect_interval = &max_reconnect_interval,
105 .kib_concurrent_peers = &concurrent_peers,
107 .kib_timeout = &timeout,
108 .kib_keepalive = &keepalive,
110 .kib_credits = &credits,
111 .kib_peercredits = &peer_credits,
112 .kib_sd_retries = &sd_retries,
113 .kib_concurrent_sends = &concurrent_sends,
116 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
118 /* NB max_size specified for proc_dostring entries only needs to be big enough
119 * not to truncate the printout; it only needs to be the actual size of the
120 * string buffer if we allow writes (and we don't) */
122 #ifdef HAVE_SYSCTL_UNNUMBERED
125 IIBLND_IPIF_BASENAME = 1,
127 IIBLND_SERVICE_NUMBER,
128 IIBLND_RECONNECT_MIN,
129 IIBLND_RECONNECT_MAX,
130 IIBLND_CONCURRENT_PEERS,
138 IIBLND_CONCURRENT_SENDS
143 #define IIBLND_IPIF_BASENAME CTL_UNNUMBERED
144 #define IIBLND_SERVICE_NAME CTL_UNNUMBERED
145 #define IIBLND_SERVICE_NUMBER CTL_UNNUMBERED
146 #define IIBLND_RECONNECT_MIN CTL_UNNUMBERED
147 #define IIBLND_RECONNECT_MAX CTL_UNNUMBERED
148 #define IIBLND_CONCURRENT_PEERS CTL_UNNUMBERED
149 #define IIBLND_CKSUM CTL_UNNUMBERED
150 #define IIBLND_TIMEOUT CTL_UNNUMBERED
151 #define IIBLND_NTX CTL_UNNUMBERED
152 #define IIBLND_CREDITS CTL_UNNUMBERED
153 #define IIBLND_PEER_CREDITS CTL_UNNUMBERED
154 #define IIBLND_SD_RETRIES CTL_UNNUMBERED
155 #define IIBLND_KEEPALIVE CTL_UNNUMBERED
156 #define IIBLND_CONCURRENT_SENDS CTL_UNNUMBERED
160 static cfs_sysctl_table_t kibnal_ctl_table[] = {
162 .ctl_name = IBBLND_IPIF_BASENAME,
163 .procname = "ipif_basename",
164 .data = &ipif_basename,
167 .proc_handler = &proc_dostring
170 .ctl_name = IIBLND_SERVICE_NAME,
171 .procname = "service_name",
172 .data = &service_name,
175 .proc_handler = &proc_dostring
178 .ctl_name = IIBLND_SERVICE_NUMBER,
179 .procname = "service_number",
180 .data = &service_number,
181 .maxlen = sizeof(int),
183 .proc_handler = &proc_dointvec
186 .ctl_name = IIBLND_RECONNECT_MIN,
187 .procname = "min_reconnect_interval",
188 .data = &min_reconnect_interval,
189 .maxlen = sizeof(int),
191 .proc_handler = &proc_dointvec
194 .ctl_name = IIBLND_RECONNECT_MAX,
195 .procname = "max_reconnect_interval",
196 .data = &max_reconnect_interval,
197 .maxlen = sizeof(int),
199 .proc_handler = &proc_dointvec
202 .ctl_name = IIBLND_CONCURRENT_PEERS,
203 .procname = "concurrent_peers",
204 .data = &concurrent_peers,
205 .maxlen = sizeof(int),
207 .proc_handler = &proc_dointvec
210 .ctl_name = IIBLND_CKSUM,
213 .maxlen = sizeof(int),
215 .proc_handler = &proc_dointvec
218 .ctl_name = IIBLND_TIMEOUT,
219 .procname = "timeout",
221 .maxlen = sizeof(int),
223 .proc_handler = &proc_dointvec
226 .ctl_name = IIBLND_NTX,
229 .maxlen = sizeof(int),
231 .proc_handler = &proc_dointvec
234 .ctl_name = IIBLND_CREDITS,
235 .procname = "credits",
237 .maxlen = sizeof(int),
239 .proc_handler = &proc_dointvec
242 .ctl_name = IIBLND_PEER_CREDITS,
243 .procname = "peer_credits",
244 .data = &peer_credits,
245 .maxlen = sizeof(int),
247 .proc_handler = &proc_dointvec
250 .ctl_name = IIBLND_SD_RETRIES,
251 .procname = "sd_retries",
253 .maxlen = sizeof(int),
255 .proc_handler = &proc_dointvec
258 .ctl_name = IIBLND_KEEPALIVE,
259 .procname = "keepalive",
261 .maxlen = sizeof(int),
263 .proc_handler = &proc_dointvec
266 .ctl_name = IIBLND_CONCURRENT_SENDS,
267 .procname = "concurrent_sends",
268 .data = &concurrent_sends,
269 .maxlen = sizeof(int),
271 .proc_handler = &proc_dointvec
276 static cfs_sysctl_table_t kibnal_top_ctl_table[] = {
278 .ctl_name = CTL_IIBLND,
279 .procname = "iibnal",
283 .child = kibnal_ctl_table
289 kibnal_tunables_init ()
291 kibnal_tunables.kib_sysctl =
292 cfs_register_sysctl_table(kibnal_top_ctl_table, 0);
294 if (kibnal_tunables.kib_sysctl == NULL)
295 CWARN("Can't setup /proc tunables\n");
297 if (*kibnal_tunables.kib_concurrent_sends > IBNAL_RX_MSGS)
298 *kibnal_tunables.kib_concurrent_sends = IBNAL_RX_MSGS;
299 if (*kibnal_tunables.kib_concurrent_sends < IBNAL_MSG_QUEUE_SIZE)
300 *kibnal_tunables.kib_concurrent_sends = IBNAL_MSG_QUEUE_SIZE;
306 kibnal_tunables_fini ()
308 if (kibnal_tunables.kib_sysctl != NULL)
309 cfs_unregister_sysctl_table(kibnal_tunables.kib_sysctl);
315 kibnal_tunables_init ()
321 kibnal_tunables_fini ()