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 char *ipif_basename = "ib";
27 CFS_MODULE_PARM(ipif_basename, "s", charp, 0444,
28 "IPoIB interface base name");
30 static char *service_name = "iiblnd";
31 CFS_MODULE_PARM(service_name, "s", charp, 0444,
34 static int service_number = 0x11b9a2;
35 CFS_MODULE_PARM(service_number, "i", int, 0444,
38 static int min_reconnect_interval = 1;
39 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
40 "minimum connection retry interval (seconds)");
42 static int max_reconnect_interval = 60;
43 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
44 "maximum connection retry interval (seconds)");
46 static int concurrent_peers = 1152;
47 CFS_MODULE_PARM(concurrent_peers, "i", int, 0444,
48 "maximum number of peers that may connect");
51 CFS_MODULE_PARM(cksum, "i", int, 0644,
52 "set non-zero to enable message (not RDMA) checksums");
54 static int timeout = 50;
55 CFS_MODULE_PARM(timeout, "i", int, 0644,
59 CFS_MODULE_PARM(ntx, "i", int, 0444,
60 "# of message descriptors");
62 static int credits = 128;
63 CFS_MODULE_PARM(credits, "i", int, 0444,
64 "# concurrent sends");
66 static int peer_credits = 8;
67 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
68 "# concurrent sends to 1 peer");
70 static int sd_retries = 8;
71 CFS_MODULE_PARM(sd_retries, "i", int, 0444,
72 "# times to retry SD queries");
74 static int keepalive = 100;
75 CFS_MODULE_PARM(keepalive, "i", int, 0644,
76 "Idle time in seconds before sending a keepalive");
78 static int concurrent_sends = IBNAL_RX_MSGS;
79 CFS_MODULE_PARM(concurrent_sends, "i", int, 0644,
80 "Send work queue sizing");
82 kib_tunables_t kibnal_tunables = {
83 .kib_ipif_basename = &ipif_basename,
84 .kib_service_name = &service_name,
85 .kib_service_number = &service_number,
86 .kib_min_reconnect_interval = &min_reconnect_interval,
87 .kib_max_reconnect_interval = &max_reconnect_interval,
88 .kib_concurrent_peers = &concurrent_peers,
90 .kib_timeout = &timeout,
91 .kib_keepalive = &keepalive,
93 .kib_credits = &credits,
94 .kib_peercredits = &peer_credits,
95 .kib_sd_retries = &sd_retries,
96 .kib_concurrent_sends = &concurrent_sends,
99 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
101 /* NB max_size specified for proc_dostring entries only needs to be big enough
102 * not to truncate the printout; it only needs to be the actual size of the
103 * string buffer if we allow writes (and we don't) */
105 static ctl_table kibnal_ctl_table[] = {
106 {1, "ipif_basename", &ipif_basename,
107 1024, 0444, NULL, &proc_dostring},
108 {2, "service_name", &service_name,
109 1024, 0444, NULL, &proc_dostring},
110 {3, "service_number", &service_number,
111 sizeof(int), 0444, NULL, &proc_dointvec},
112 {4, "min_reconnect_interval", &min_reconnect_interval,
113 sizeof(int), 0644, NULL, &proc_dointvec},
114 {5, "max_reconnect_interval", &max_reconnect_interval,
115 sizeof(int), 0644, NULL, &proc_dointvec},
116 {6, "concurrent_peers", &concurrent_peers,
117 sizeof(int), 0444, NULL, &proc_dointvec},
119 sizeof(int), 0644, NULL, &proc_dointvec},
120 {8, "timeout", &timeout,
121 sizeof(int), 0644, NULL, &proc_dointvec},
123 sizeof(int), 0444, NULL, &proc_dointvec},
124 {10, "credits", &credits,
125 sizeof(int), 0444, NULL, &proc_dointvec},
126 {11, "peer_credits", &peer_credits,
127 sizeof(int), 0444, NULL, &proc_dointvec},
128 {12, "sd_retries", &sd_retries,
129 sizeof(int), 0444, NULL, &proc_dointvec},
130 {13, "keepalive", &keepalive,
131 sizeof(int), 0644, NULL, &proc_dointvec},
132 {14, "concurrent_sends", &concurrent_sends,
133 sizeof(int), 0644, NULL, &proc_dointvec},
137 static ctl_table kibnal_top_ctl_table[] = {
138 {203, "openibnal", NULL, 0, 0555, kibnal_ctl_table},
143 kibnal_tunables_init ()
145 kibnal_tunables.kib_sysctl =
146 register_sysctl_table(kibnal_top_ctl_table, 0);
148 if (kibnal_tunables.kib_sysctl == NULL)
149 CWARN("Can't setup /proc tunables\n");
151 if (*kibnal_tunables.kib_concurrent_sends > IBNAL_RX_MSGS)
152 *kibnal_tunables.kib_concurrent_sends = IBNAL_RX_MSGS;
153 if (*kibnal_tunables.kib_concurrent_sends < IBNAL_MSG_QUEUE_SIZE)
154 *kibnal_tunables.kib_concurrent_sends = IBNAL_MSG_QUEUE_SIZE;
160 kibnal_tunables_fini ()
162 if (kibnal_tunables.kib_sysctl != NULL)
163 unregister_sysctl_table(kibnal_tunables.kib_sysctl);
169 kibnal_tunables_init ()
175 kibnal_tunables_fini ()