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
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
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 (c) 2007, 2010, Oracle and/or its affiliates. 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
93 #ifndef HAVE_SYSCTL_UNNUMBERED
107 #define KRANAL_N_CONND CTL_UNNUMBERED
108 #define KRANAL_RECONNECT_MIN CTL_UNNUMBERED
109 #define KRANAL_RECONNECT_MAX CTL_UNNUMBERED
110 #define KRANAL_NTX CTL_UNNUMBERED
111 #define KRANAL_CREDITS CTL_UNNUMBERED
112 #define KRANAL_PEERCREDITS CTL_UNNUMBERED
113 #define KRANAL_FMA_CQ_SIZE CTL_UNNUMBERED
114 #define KRANAL_TIMEOUT CTL_UNNUMBERED
115 #define KRENAL_IMMEDIATE_MAX CTL_UNNUMBERED
118 static cfs_sysctl_table_t kranal_ctl_table[] = {
120 .ctl_name = KRANAL_N_CONND,
121 .procname = "n_connd",
123 .maxlen = sizeof(int),
125 .proc_handler = &proc_dointvec
128 .ctl_name = KRANAL_RECONNECT_MIN,
129 .procname = "min_reconnect_interval",
130 .data = &min_reconnect_interval,
131 .maxlen = sizeof(int),
133 .proc_handler = &proc_dointvec
136 .ctl_name = KRANAL_RECONNECT_MAX,
137 .procname = "max_reconnect_interval",
138 .data = &max_reconnect_interval,
139 .maxlen = sizeof(int),
141 .proc_handler = &proc_dointvec
144 .ctl_name = KRANAL_NTX,
147 .maxlen = sizeof(int),
149 .proc_handler = &proc_dointvec
152 .ctl_name = KRANAL_CREDITS,
153 .procname = "credits",
155 .maxlen = sizeof(int),
157 .proc_handler = &proc_dointvec
160 .ctl_name = KRANAL_PEERCREDITS,
161 .procname = "peer_credits",
162 .data = &peer_credits,
163 .maxlen = sizeof(int),
165 .proc_handler = &proc_dointvec
168 .ctl_name = KRANAL_FMA_CQ_SIZE,
169 .procname = "fma_cq_size",
170 .data = &fma_cq_size,
171 .maxlen = sizeof(int),
173 .proc_handler = &proc_dointvec
176 .ctl_name = KRANAL_TIMEOUT,
177 .procname = "timeout",
179 .maxlen = sizeof(int),
181 .proc_handler = &proc_dointvec
184 .ctl_name = KRANAL_IMMEDIATE_MAX,
185 .procname = "max_immediate",
186 .data = &max_immediate,
187 .maxlen = sizeof(int),
189 .proc_handler = &proc_dointvec
194 static cfs_sysctl_table_t kranal_top_ctl_table[] = {
196 .ctl_name = CTL_KRANAL,
201 .child = kranal_ctl_table
207 kranal_tunables_init ()
209 kranal_tunables.kra_sysctl =
210 cfs_register_sysctl_table(kranal_top_ctl_table, 0);
212 if (kranal_tunables.kra_sysctl == NULL)
213 CWARN("Can't setup /proc tunables\n");
219 kranal_tunables_fini ()
221 if (kranal_tunables.kra_sysctl != NULL)
222 cfs_unregister_sysctl_table(kranal_tunables.kra_sysctl);
228 kranal_tunables_init ()
234 kranal_tunables_fini ()