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 int n_connd = 4;
27 CFS_MODULE_PARM(n_connd, "i", int, 0444,
28 "# of connection daemons");
30 static int min_reconnect_interval = 1;
31 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
32 "minimum connection retry interval (seconds)");
34 static int max_reconnect_interval = 60;
35 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
36 "maximum connection retry interval (seconds)");
39 CFS_MODULE_PARM(ntx, "i", int, 0444,
40 "# of transmit descriptors");
42 static int credits = 128;
43 CFS_MODULE_PARM(credits, "i", int, 0444,
44 "# concurrent sends");
46 static int peer_credits = 32;
47 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
48 "# concurrent sends to 1 peer");
50 static int fma_cq_size = 8192;
51 CFS_MODULE_PARM(fma_cq_size, "i", int, 0444,
52 "size of the completion queue");
54 static int timeout = 30;
55 CFS_MODULE_PARM(timeout, "i", int, 0644,
56 "communications timeout (seconds)");
58 static int max_immediate = (2<<10);
59 CFS_MODULE_PARM(max_immediate, "i", int, 0644,
60 "immediate/RDMA breakpoint");
62 kra_tunables_t kranal_tunables = {
63 .kra_n_connd = &n_connd,
64 .kra_min_reconnect_interval = &min_reconnect_interval,
65 .kra_max_reconnect_interval = &max_reconnect_interval,
67 .kra_credits = &credits,
68 .kra_peercredits = &peer_credits,
69 .kra_fma_cq_size = &fma_cq_size,
70 .kra_timeout = &timeout,
71 .kra_max_immediate = &max_immediate,
74 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
75 static cfs_sysctl_table_t kranal_ctl_table[] = {
78 .procname = "n_connd",
80 .maxlen = sizeof(int),
82 .proc_handler = &proc_dointvec
86 .procname = "min_reconnect_interval",
87 .data = &min_reconnect_interval,
88 .maxlen = sizeof(int),
90 .proc_handler = &proc_dointvec
94 .procname = "max_reconnect_interval",
95 .data = &max_reconnect_interval,
96 .maxlen = sizeof(int),
98 .proc_handler = &proc_dointvec
104 .maxlen = sizeof(int),
106 .proc_handler = &proc_dointvec
110 .procname = "credits",
112 .maxlen = sizeof(int),
114 .proc_handler = &proc_dointvec
118 .procname = "peer_credits",
119 .data = &peer_credits,
120 .maxlen = sizeof(int),
122 .proc_handler = &proc_dointvec
126 .procname = "fma_cq_size",
127 .data = &fma_cq_size,
128 .maxlen = sizeof(int),
130 .proc_handler = &proc_dointvec
134 .procname = "timeout",
136 .maxlen = sizeof(int),
138 .proc_handler = &proc_dointvec
142 .procname = "max_immediate",
143 .data = &max_immediate,
144 .maxlen = sizeof(int),
146 .proc_handler = &proc_dointvec
151 static cfs_sysctl_table_t kranal_top_ctl_table[] = {
158 .child = kranal_ctl_table
164 kranal_tunables_init ()
166 kranal_tunables.kra_sysctl =
167 cfs_register_sysctl_table(kranal_top_ctl_table, 0);
169 if (kranal_tunables.kra_sysctl == NULL)
170 CWARN("Can't setup /proc tunables\n");
176 kranal_tunables_fini ()
178 if (kranal_tunables.kra_sysctl != NULL)
179 cfs_unregister_sysctl_table(kranal_tunables.kra_sysctl);
185 kranal_tunables_init ()
191 kranal_tunables_fini ()