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/ralnd/ralnd_modparams.c
38 * Author: Eric Barton <eric@bartonsoftware.com>
43 static int n_connd = 4;
44 CFS_MODULE_PARM(n_connd, "i", int, 0444,
45 "# of connection daemons");
47 static int min_reconnect_interval = 1;
48 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
49 "minimum connection retry interval (seconds)");
51 static int max_reconnect_interval = 60;
52 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
53 "maximum connection retry interval (seconds)");
56 CFS_MODULE_PARM(ntx, "i", int, 0444,
57 "# of transmit descriptors");
59 static int credits = 128;
60 CFS_MODULE_PARM(credits, "i", int, 0444,
61 "# concurrent sends");
63 static int peer_credits = 32;
64 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
65 "# concurrent sends to 1 peer");
67 static int fma_cq_size = 8192;
68 CFS_MODULE_PARM(fma_cq_size, "i", int, 0444,
69 "size of the completion queue");
71 static int timeout = 30;
72 CFS_MODULE_PARM(timeout, "i", int, 0644,
73 "communications timeout (seconds)");
75 static int max_immediate = (2<<10);
76 CFS_MODULE_PARM(max_immediate, "i", int, 0644,
77 "immediate/RDMA breakpoint");
79 kra_tunables_t kranal_tunables = {
80 .kra_n_connd = &n_connd,
81 .kra_min_reconnect_interval = &min_reconnect_interval,
82 .kra_max_reconnect_interval = &max_reconnect_interval,
84 .kra_credits = &credits,
85 .kra_peercredits = &peer_credits,
86 .kra_fma_cq_size = &fma_cq_size,
87 .kra_timeout = &timeout,
88 .kra_max_immediate = &max_immediate,
91 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
92 static cfs_sysctl_table_t kranal_ctl_table[] = {
95 .procname = "n_connd",
97 .maxlen = sizeof(int),
99 .proc_handler = &proc_dointvec
103 .procname = "min_reconnect_interval",
104 .data = &min_reconnect_interval,
105 .maxlen = sizeof(int),
107 .proc_handler = &proc_dointvec
111 .procname = "max_reconnect_interval",
112 .data = &max_reconnect_interval,
113 .maxlen = sizeof(int),
115 .proc_handler = &proc_dointvec
121 .maxlen = sizeof(int),
123 .proc_handler = &proc_dointvec
127 .procname = "credits",
129 .maxlen = sizeof(int),
131 .proc_handler = &proc_dointvec
135 .procname = "peer_credits",
136 .data = &peer_credits,
137 .maxlen = sizeof(int),
139 .proc_handler = &proc_dointvec
143 .procname = "fma_cq_size",
144 .data = &fma_cq_size,
145 .maxlen = sizeof(int),
147 .proc_handler = &proc_dointvec
151 .procname = "timeout",
153 .maxlen = sizeof(int),
155 .proc_handler = &proc_dointvec
159 .procname = "max_immediate",
160 .data = &max_immediate,
161 .maxlen = sizeof(int),
163 .proc_handler = &proc_dointvec
168 static cfs_sysctl_table_t kranal_top_ctl_table[] = {
175 .child = kranal_ctl_table
181 kranal_tunables_init ()
183 kranal_tunables.kra_sysctl =
184 cfs_register_sysctl_table(kranal_top_ctl_table, 0);
186 if (kranal_tunables.kra_sysctl == NULL)
187 CWARN("Can't setup /proc tunables\n");
193 kranal_tunables_fini ()
195 if (kranal_tunables.kra_sysctl != NULL)
196 cfs_unregister_sysctl_table(kranal_tunables.kra_sysctl);
202 kranal_tunables_init ()
208 kranal_tunables_fini ()