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/openiblnd/openiblnd_modparams.c
38 * Author: Eric Barton <eric@bartonsoftware.com>
41 #include "openiblnd.h"
43 static char *ipif_basename = "ib";
44 CFS_MODULE_PARM(ipif_basename, "s", charp, 0444,
45 "IPoIB interface base name");
47 static int n_connd = 4;
48 CFS_MODULE_PARM(n_connd, "i", int, 0444,
49 "# of connection daemons");
51 static int min_reconnect_interval = 1;
52 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
53 "minimum connection retry interval (seconds)");
55 static int max_reconnect_interval = 60;
56 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
57 "maximum connection retry interval (seconds)");
59 static int concurrent_peers = 1152;
60 CFS_MODULE_PARM(concurrent_peers, "i", int, 0444,
61 "maximum number of peers that may connect");
64 CFS_MODULE_PARM(cksum, "i", int, 0644,
65 "set non-zero to enable message (not RDMA) checksums");
67 static int timeout = 50;
68 CFS_MODULE_PARM(timeout, "i", int, 0644,
72 CFS_MODULE_PARM(ntx, "i", int, 0444,
73 "# of message descriptors");
75 static int credits = 256;
76 CFS_MODULE_PARM(credits, "i", int, 0444,
77 "# concurrent sends");
79 static int peer_credits = 16;
80 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
81 "# concurrent sends to 1 peer");
83 static int keepalive = 100;
84 CFS_MODULE_PARM(keepalive, "i", int, 0644,
85 "Idle time in seconds before sending a keepalive");
87 kib_tunables_t kibnal_tunables = {
88 .kib_ipif_basename = &ipif_basename,
89 .kib_n_connd = &n_connd,
90 .kib_min_reconnect_interval = &min_reconnect_interval,
91 .kib_max_reconnect_interval = &max_reconnect_interval,
92 .kib_concurrent_peers = &concurrent_peers,
94 .kib_timeout = &timeout,
96 .kib_credits = &credits,
97 .kib_peercredits = &peer_credits,
98 .kib_keepalive = &keepalive,
101 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
103 static cfs_sysctl_table_t kibnal_ctl_table[] = {
106 .procname = "ipif_basename",
107 .data = &ipif_basename,
110 .proc_handler = &proc_dostring
114 .procname = "n_connd",
116 .maxlen = sizeof(int),
118 .proc_handler = &proc_dointvec
122 .procname = "min_reconnect_interval",
123 .data = &min_reconnect_interval,
124 .maxlen = sizeof(int),
126 .proc_handler = &proc_dointvec
130 .procname = "max_reconnect_interval",
131 .data = &max_reconnect_interval,
132 .maxlen = sizeof(int),
134 .proc_handler = &proc_dointvec
138 .procname = "concurrent_peers",
139 .data = &concurrent_peers,
140 .maxlen = sizeof(int),
142 .proc_handler = &proc_dointvec
148 .maxlen = sizeof(int),
150 .proc_handler = &proc_dointvec
154 .procname = "timeout",
156 .maxlen = sizeof(int),
158 .proc_handler = &proc_dointvec
164 .maxlen = sizeof(int),
166 .proc_handler = &proc_dointvec
170 .procname = "credits",
172 .maxlen = sizeof(int),
174 .proc_handler = &proc_dointvec
178 .procname = "peer_credits",
179 .data = &peer_credits,
180 .maxlen = sizeof(int),
182 .proc_handler = &proc_dointvec
186 .procname = "keepalive",
188 .maxlen = sizeof(int),
190 .proc_handler = &proc_dointvec
195 static cfs_sysctl_table_t kibnal_top_ctl_table[] = {
198 .procname = "openibnal",
202 .child = kibnal_ctl_table
208 kibnal_tunables_init ()
210 kibnal_tunables.kib_sysctl =
211 cfs_register_sysctl_table(kibnal_top_ctl_table, 0);
213 if (kibnal_tunables.kib_sysctl == NULL)
214 CWARN("Can't setup /proc tunables\n");
220 kibnal_tunables_fini ()
222 if (kibnal_tunables.kib_sysctl != NULL)
223 cfs_unregister_sysctl_table(kibnal_tunables.kib_sysctl);
229 kibnal_tunables_init ()
235 kibnal_tunables_fini ()