1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2004 Cluster File Systems, Inc.
5 * Author: Eric Barton <eric@bartonsoftware.com>
7 * This file is part of Lustre, http://www.lustre.org.
9 * Lustre is free software; you can redistribute it and/or
10 * modify it under the terms of version 2 of the GNU General Public
11 * License as published by the Free Software Foundation.
13 * Lustre is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with Lustre; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 static char *ipif_basename = "ib";
27 CFS_MODULE_PARM(ipif_basename, "s", charp, 0444,
28 "IPoIB interface base name");
30 static char *service_name = "iiblnd";
31 CFS_MODULE_PARM(service_name, "s", charp, 0444,
34 static int service_number = 0x11b9a2;
35 CFS_MODULE_PARM(service_number, "i", int, 0444,
38 static int min_reconnect_interval = 1;
39 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
40 "minimum connection retry interval (seconds)");
42 static int max_reconnect_interval = 60;
43 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
44 "maximum connection retry interval (seconds)");
46 static int concurrent_peers = 1152;
47 CFS_MODULE_PARM(concurrent_peers, "i", int, 0444,
48 "maximum number of peers that may connect");
51 CFS_MODULE_PARM(cksum, "i", int, 0644,
52 "set non-zero to enable message (not RDMA) checksums");
54 static int timeout = 50;
55 CFS_MODULE_PARM(timeout, "i", int, 0644,
59 CFS_MODULE_PARM(ntx, "i", int, 0444,
60 "# of message descriptors");
62 static int credits = 128;
63 CFS_MODULE_PARM(credits, "i", int, 0444,
64 "# concurrent sends");
66 static int peer_credits = 8;
67 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
68 "# concurrent sends to 1 peer");
70 static int sd_retries = 8;
71 CFS_MODULE_PARM(sd_retries, "i", int, 0444,
72 "# times to retry SD queries");
74 static int keepalive = 100;
75 CFS_MODULE_PARM(keepalive, "i", int, 0644,
76 "Idle time in seconds before sending a keepalive");
78 static int concurrent_sends = IBNAL_RX_MSGS;
79 CFS_MODULE_PARM(concurrent_sends, "i", int, 0644,
80 "Send work queue sizing");
82 kib_tunables_t kibnal_tunables = {
83 .kib_ipif_basename = &ipif_basename,
84 .kib_service_name = &service_name,
85 .kib_service_number = &service_number,
86 .kib_min_reconnect_interval = &min_reconnect_interval,
87 .kib_max_reconnect_interval = &max_reconnect_interval,
88 .kib_concurrent_peers = &concurrent_peers,
90 .kib_timeout = &timeout,
91 .kib_keepalive = &keepalive,
93 .kib_credits = &credits,
94 .kib_peercredits = &peer_credits,
95 .kib_sd_retries = &sd_retries,
96 .kib_concurrent_sends = &concurrent_sends,
99 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
101 /* NB max_size specified for proc_dostring entries only needs to be big enough
102 * not to truncate the printout; it only needs to be the actual size of the
103 * string buffer if we allow writes (and we don't) */
105 static cfs_sysctl_table_t kibnal_ctl_table[] = {
108 .procname = "ipif_basename",
109 .data = &ipif_basename,
112 .proc_handler = &proc_dostring
116 .procname = "service_name",
117 .data = &service_name,
120 .proc_handler = &proc_dostring
124 .procname = "service_number",
125 .data = &service_number,
126 .maxlen = sizeof(int),
128 .proc_handler = &proc_dointvec
132 .procname = "min_reconnect_interval",
133 .data = &min_reconnect_interval,
134 .maxlen = sizeof(int),
136 .proc_handler = &proc_dointvec
140 .procname = "max_reconnect_interval",
141 .data = &max_reconnect_interval,
142 .maxlen = sizeof(int),
144 .proc_handler = &proc_dointvec
148 .procname = "concurrent_peers",
149 .data = &concurrent_peers,
150 .maxlen = sizeof(int),
152 .proc_handler = &proc_dointvec
158 .maxlen = sizeof(int),
160 .proc_handler = &proc_dointvec
164 .procname = "timeout",
166 .maxlen = sizeof(int),
168 .proc_handler = &proc_dointvec
174 .maxlen = sizeof(int),
176 .proc_handler = &proc_dointvec
180 .procname = "credits",
182 .maxlen = sizeof(int),
184 .proc_handler = &proc_dointvec
188 .procname = "peer_credits",
189 .data = &peer_credits,
190 .maxlen = sizeof(int),
192 .proc_handler = &proc_dointvec
196 .procname = "sd_retries",
198 .maxlen = sizeof(int),
200 .proc_handler = &proc_dointvec
204 .procname = "keepalive",
206 .maxlen = sizeof(int),
208 .proc_handler = &proc_dointvec
212 .procname = "concurrent_sends",
213 .data = &concurrent_sends,
214 .maxlen = sizeof(int),
216 .proc_handler = &proc_dointvec
221 static cfs_sysctl_table_t kibnal_top_ctl_table[] = {
224 .procname = "openibnal",
228 .child = kibnal_ctl_table
234 kibnal_tunables_init ()
236 kibnal_tunables.kib_sysctl =
237 cfs_register_sysctl_table(kibnal_top_ctl_table, 0);
239 if (kibnal_tunables.kib_sysctl == NULL)
240 CWARN("Can't setup /proc tunables\n");
242 if (*kibnal_tunables.kib_concurrent_sends > IBNAL_RX_MSGS)
243 *kibnal_tunables.kib_concurrent_sends = IBNAL_RX_MSGS;
244 if (*kibnal_tunables.kib_concurrent_sends < IBNAL_MSG_QUEUE_SIZE)
245 *kibnal_tunables.kib_concurrent_sends = IBNAL_MSG_QUEUE_SIZE;
251 kibnal_tunables_fini ()
253 if (kibnal_tunables.kib_sysctl != NULL)
254 cfs_unregister_sysctl_table(kibnal_tunables.kib_sysctl);
260 kibnal_tunables_init ()
266 kibnal_tunables_fini ()