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 [sun.com URL with a
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 static cfs_sysctl_table_t kibnal_ctl_table[] = {
125 .procname = "ipif_basename",
126 .data = &ipif_basename,
129 .proc_handler = &proc_dostring
133 .procname = "service_name",
134 .data = &service_name,
137 .proc_handler = &proc_dostring
141 .procname = "service_number",
142 .data = &service_number,
143 .maxlen = sizeof(int),
145 .proc_handler = &proc_dointvec
149 .procname = "min_reconnect_interval",
150 .data = &min_reconnect_interval,
151 .maxlen = sizeof(int),
153 .proc_handler = &proc_dointvec
157 .procname = "max_reconnect_interval",
158 .data = &max_reconnect_interval,
159 .maxlen = sizeof(int),
161 .proc_handler = &proc_dointvec
165 .procname = "concurrent_peers",
166 .data = &concurrent_peers,
167 .maxlen = sizeof(int),
169 .proc_handler = &proc_dointvec
175 .maxlen = sizeof(int),
177 .proc_handler = &proc_dointvec
181 .procname = "timeout",
183 .maxlen = sizeof(int),
185 .proc_handler = &proc_dointvec
191 .maxlen = sizeof(int),
193 .proc_handler = &proc_dointvec
197 .procname = "credits",
199 .maxlen = sizeof(int),
201 .proc_handler = &proc_dointvec
205 .procname = "peer_credits",
206 .data = &peer_credits,
207 .maxlen = sizeof(int),
209 .proc_handler = &proc_dointvec
213 .procname = "sd_retries",
215 .maxlen = sizeof(int),
217 .proc_handler = &proc_dointvec
221 .procname = "keepalive",
223 .maxlen = sizeof(int),
225 .proc_handler = &proc_dointvec
229 .procname = "concurrent_sends",
230 .data = &concurrent_sends,
231 .maxlen = sizeof(int),
233 .proc_handler = &proc_dointvec
238 static cfs_sysctl_table_t kibnal_top_ctl_table[] = {
241 .procname = "iibnal",
245 .child = kibnal_ctl_table
251 kibnal_tunables_init ()
253 kibnal_tunables.kib_sysctl =
254 cfs_register_sysctl_table(kibnal_top_ctl_table, 0);
256 if (kibnal_tunables.kib_sysctl == NULL)
257 CWARN("Can't setup /proc tunables\n");
259 if (*kibnal_tunables.kib_concurrent_sends > IBNAL_RX_MSGS)
260 *kibnal_tunables.kib_concurrent_sends = IBNAL_RX_MSGS;
261 if (*kibnal_tunables.kib_concurrent_sends < IBNAL_MSG_QUEUE_SIZE)
262 *kibnal_tunables.kib_concurrent_sends = IBNAL_MSG_QUEUE_SIZE;
268 kibnal_tunables_fini ()
270 if (kibnal_tunables.kib_sysctl != NULL)
271 cfs_unregister_sysctl_table(kibnal_tunables.kib_sysctl);
277 kibnal_tunables_init ()
283 kibnal_tunables_fini ()