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 ctl_table kranal_ctl_table[] = {
76 {1, "n_connd", &n_connd,
77 sizeof(int), 0444, NULL, &proc_dointvec},
78 {2, "min_reconnect_interval", &min_reconnect_interval,
79 sizeof(int), 0644, NULL, &proc_dointvec},
80 {3, "max_reconnect_interval", &max_reconnect_interval,
81 sizeof(int), 0644, NULL, &proc_dointvec},
83 sizeof(int), 0444, NULL, &proc_dointvec},
84 {5, "credits", &credits,
85 sizeof(int), 0444, NULL, &proc_dointvec},
86 {6, "peer_credits", &peer_credits,
87 sizeof(int), 0444, NULL, &proc_dointvec},
88 {7, "fma_cq_size", &fma_cq_size,
89 sizeof(int), 0444, NULL, &proc_dointvec},
90 {8, "timeout", &timeout,
91 sizeof(int), 0644, NULL, &proc_dointvec},
92 {9, "max_immediate", &max_immediate,
93 sizeof(int), 0644, NULL, &proc_dointvec},
97 static ctl_table kranal_top_ctl_table[] = {
98 {202, "ranal", NULL, 0, 0555, kranal_ctl_table},
103 kranal_tunables_init ()
105 kranal_tunables.kra_sysctl =
106 cfs_register_sysctl_table(kranal_top_ctl_table, 0);
108 if (kranal_tunables.kra_sysctl == NULL)
109 CWARN("Can't setup /proc tunables\n");
115 kranal_tunables_fini ()
117 if (kranal_tunables.kra_sysctl != NULL)
118 cfs_unregister_sysctl_table(kranal_tunables.kra_sysctl);
124 kranal_tunables_init ()
130 kranal_tunables_fini ()