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.
24 #include "openiblnd.h"
26 static char *ipif_basename = "ib";
27 CFS_MODULE_PARM(ipif_basename, "s", charp, 0444,
28 "IPoIB interface base name");
30 static int n_connd = 4;
31 CFS_MODULE_PARM(n_connd, "i", int, 0444,
32 "# of connection daemons");
34 static int min_reconnect_interval = 1;
35 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
36 "minimum connection retry interval (seconds)");
38 static int max_reconnect_interval = 60;
39 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
40 "maximum connection retry interval (seconds)");
42 static int concurrent_peers = 1152;
43 CFS_MODULE_PARM(concurrent_peers, "i", int, 0444,
44 "maximum number of peers that may connect");
47 CFS_MODULE_PARM(cksum, "i", int, 0644,
48 "set non-zero to enable message (not RDMA) checksums");
50 static int timeout = 50;
51 CFS_MODULE_PARM(timeout, "i", int, 0644,
55 CFS_MODULE_PARM(ntx, "i", int, 0444,
56 "# of message descriptors");
58 static int credits = 256;
59 CFS_MODULE_PARM(credits, "i", int, 0444,
60 "# concurrent sends");
62 static int peer_credits = 16;
63 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
64 "# concurrent sends to 1 peer");
66 static int keepalive = 100;
67 CFS_MODULE_PARM(keepalive, "i", int, 0644,
68 "Idle time in seconds before sending a keepalive");
70 kib_tunables_t kibnal_tunables = {
71 .kib_ipif_basename = &ipif_basename,
72 .kib_n_connd = &n_connd,
73 .kib_min_reconnect_interval = &min_reconnect_interval,
74 .kib_max_reconnect_interval = &max_reconnect_interval,
75 .kib_concurrent_peers = &concurrent_peers,
77 .kib_timeout = &timeout,
79 .kib_credits = &credits,
80 .kib_peercredits = &peer_credits,
81 .kib_keepalive = &keepalive,
84 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
86 static ctl_table kibnal_ctl_table[] = {
87 {1, "ipif_basename", &ipif_basename,
88 1024, 0444, NULL, &proc_dostring},
89 {2, "n_connd", &n_connd,
90 sizeof(int), 0444, NULL, &proc_dointvec},
91 {3, "min_reconnect_interval", &min_reconnect_interval,
92 sizeof(int), 0644, NULL, &proc_dointvec},
93 {4, "max_reconnect_interval", &max_reconnect_interval,
94 sizeof(int), 0644, NULL, &proc_dointvec},
95 {5, "concurrent_peers", &concurrent_peers,
96 sizeof(int), 0444, NULL, &proc_dointvec},
98 sizeof(int), 0644, NULL, &proc_dointvec},
99 {7, "timeout", &timeout,
100 sizeof(int), 0644, NULL, &proc_dointvec},
102 sizeof(int), 0444, NULL, &proc_dointvec},
103 {9, "credits", &credits,
104 sizeof(int), 0444, NULL, &proc_dointvec},
105 {10, "peer_credits", &peer_credits,
106 sizeof(int), 0444, NULL, &proc_dointvec},
107 {11, "keepalive", &keepalive,
108 sizeof(int), 0644, NULL, &proc_dointvec},
112 static ctl_table kibnal_top_ctl_table[] = {
113 {203, "openibnal", NULL, 0, 0555, kibnal_ctl_table},
118 kibnal_tunables_init ()
120 kibnal_tunables.kib_sysctl =
121 register_sysctl_table(kibnal_top_ctl_table, 0);
123 if (kibnal_tunables.kib_sysctl == NULL)
124 CWARN("Can't setup /proc tunables\n");
130 kibnal_tunables_fini ()
132 if (kibnal_tunables.kib_sysctl != NULL)
133 unregister_sysctl_table(kibnal_tunables.kib_sysctl);
139 kibnal_tunables_init ()
145 kibnal_tunables_fini ()