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.
24 #include "openiblnd.h"
26 static char *ipif_basename = "ib";
27 CFS_MODULE_PARM(ipif_basename, "s", charp, 0444,
28 "IPoIB interface base name");
30 static int n_connd = 4;
31 CFS_MODULE_PARM(n_connd, "i", int, 0444,
32 "# of connection daemons");
34 static int min_reconnect_interval = 1;
35 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
36 "minimum connection retry interval (seconds)");
38 static int max_reconnect_interval = 60;
39 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
40 "maximum connection retry interval (seconds)");
42 static int concurrent_peers = 1152;
43 CFS_MODULE_PARM(concurrent_peers, "i", int, 0444,
44 "maximum number of peers that may connect");
47 CFS_MODULE_PARM(cksum, "i", int, 0644,
48 "set non-zero to enable message (not RDMA) checksums");
50 static int timeout = 50;
51 CFS_MODULE_PARM(timeout, "i", int, 0644,
55 CFS_MODULE_PARM(ntx, "i", int, 0444,
56 "# of message descriptors");
58 static int credits = 256;
59 CFS_MODULE_PARM(credits, "i", int, 0444,
60 "# concurrent sends");
62 static int peer_credits = 16;
63 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
64 "# concurrent sends to 1 peer");
66 static int keepalive = 100;
67 CFS_MODULE_PARM(keepalive, "i", int, 0644,
68 "Idle time in seconds before sending a keepalive");
70 kib_tunables_t kibnal_tunables = {
71 .kib_ipif_basename = &ipif_basename,
72 .kib_n_connd = &n_connd,
73 .kib_min_reconnect_interval = &min_reconnect_interval,
74 .kib_max_reconnect_interval = &max_reconnect_interval,
75 .kib_concurrent_peers = &concurrent_peers,
77 .kib_timeout = &timeout,
79 .kib_credits = &credits,
80 .kib_peercredits = &peer_credits,
81 .kib_keepalive = &keepalive,
84 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
86 static cfs_sysctl_table_t kibnal_ctl_table[] = {
89 .procname = "ipif_basename",
90 .data = &ipif_basename,
93 .proc_handler = &proc_dostring
97 .procname = "n_connd",
99 .maxlen = sizeof(int),
101 .proc_handler = &proc_dointvec
105 .procname = "min_reconnect_interval",
106 .data = &min_reconnect_interval,
107 .maxlen = sizeof(int),
109 .proc_handler = &proc_dointvec
113 .procname = "max_reconnect_interval",
114 .data = &max_reconnect_interval,
115 .maxlen = sizeof(int),
117 .proc_handler = &proc_dointvec
121 .procname = "concurrent_peers",
122 .data = &concurrent_peers,
123 .maxlen = sizeof(int),
125 .proc_handler = &proc_dointvec
131 .maxlen = sizeof(int),
133 .proc_handler = &proc_dointvec
137 .procname = "timeout",
139 .maxlen = sizeof(int),
141 .proc_handler = &proc_dointvec
147 .maxlen = sizeof(int),
149 .proc_handler = &proc_dointvec
153 .procname = "credits",
155 .maxlen = sizeof(int),
157 .proc_handler = &proc_dointvec
161 .procname = "peer_credits",
162 .data = &peer_credits,
163 .maxlen = sizeof(int),
165 .proc_handler = &proc_dointvec
169 .procname = "keepalive",
171 .maxlen = sizeof(int),
173 .proc_handler = &proc_dointvec
178 static cfs_sysctl_table_t kibnal_top_ctl_table[] = {
181 .procname = "openibnal",
185 .child = kibnal_ctl_table
191 kibnal_tunables_init ()
193 kibnal_tunables.kib_sysctl =
194 cfs_register_sysctl_table(kibnal_top_ctl_table, 0);
196 if (kibnal_tunables.kib_sysctl == NULL)
197 CWARN("Can't setup /proc tunables\n");
203 kibnal_tunables_fini ()
205 if (kibnal_tunables.kib_sysctl != NULL)
206 cfs_unregister_sysctl_table(kibnal_tunables.kib_sysctl);
212 kibnal_tunables_init ()
218 kibnal_tunables_fini ()