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 service_number = 0x11b9a2;
27 CFS_MODULE_PARM(service_number, "i", int, 0444,
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)");
38 static int concurrent_peers = 1152;
39 CFS_MODULE_PARM(concurrent_peers, "i", int, 0444,
40 "maximum number of peers that may connect");
43 CFS_MODULE_PARM(cksum, "i", int, 0644,
44 "set non-zero to enable message (not RDMA) checksums");
46 static int timeout = 50;
47 CFS_MODULE_PARM(timeout, "i", int, 0644,
51 CFS_MODULE_PARM(ntx, "i", int, 0444,
52 "# of message descriptors");
54 static int credits = 128;
55 CFS_MODULE_PARM(credits, "i", int, 0444,
56 "# concurrent sends");
58 static int peer_credits = 8;
59 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
60 "# concurrent sends to 1 peer");
62 static int arp_retries = 3;
63 CFS_MODULE_PARM(arp_retries, "i", int, 0644,
64 "# of times to retry ARP");
66 static char *hca_basename = "InfiniHost";
67 CFS_MODULE_PARM(hca_basename, "s", charp, 0444,
70 static char *ipif_basename = "ipoib";
71 CFS_MODULE_PARM(ipif_basename, "s", charp, 0444,
72 "IPoIB interface base name");
74 static int local_ack_timeout = 0x12;
75 CFS_MODULE_PARM(local_ack_timeout, "i", int, 0644,
76 "ACK timeout for low-level 'sends'");
78 static int retry_cnt = 7;
79 CFS_MODULE_PARM(retry_cnt, "i", int, 0644,
80 "Retransmissions when no ACK received");
82 static int rnr_cnt = 6;
83 CFS_MODULE_PARM(rnr_cnt, "i", int, 0644,
84 "RNR retransmissions");
86 static int rnr_nak_timer = 0x10;
87 CFS_MODULE_PARM(rnr_nak_timer, "i", int, 0644,
88 "RNR retransmission interval");
90 static int keepalive = 100;
91 CFS_MODULE_PARM(keepalive, "i", int, 0644,
92 "Idle time in seconds before sending a keepalive");
94 static int concurrent_sends = IBNAL_RX_MSGS;
95 CFS_MODULE_PARM(concurrent_sends, "i", int, 0644,
96 "send work-queue sizing");
99 static int fmr_remaps = 1000;
100 CFS_MODULE_PARM(fmr_remaps, "i", int, 0444,
101 "FMR mappings allowed before unmap");
104 kib_tunables_t kibnal_tunables = {
105 .kib_service_number = &service_number,
106 .kib_min_reconnect_interval = &min_reconnect_interval,
107 .kib_max_reconnect_interval = &max_reconnect_interval,
108 .kib_concurrent_peers = &concurrent_peers,
110 .kib_timeout = &timeout,
112 .kib_credits = &credits,
113 .kib_peercredits = &peer_credits,
114 .kib_arp_retries = &arp_retries,
115 .kib_hca_basename = &hca_basename,
116 .kib_ipif_basename = &ipif_basename,
117 .kib_local_ack_timeout = &local_ack_timeout,
118 .kib_retry_cnt = &retry_cnt,
119 .kib_rnr_cnt = &rnr_cnt,
120 .kib_rnr_nak_timer = &rnr_nak_timer,
121 .kib_keepalive = &keepalive,
122 .kib_concurrent_sends = &concurrent_sends,
124 .kib_fmr_remaps = &fmr_remaps,
128 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
130 static char hca_basename_space[32];
131 static char ipif_basename_space[32];
133 static cfs_sysctl_table_t kibnal_ctl_table[] = {
136 .procname = "service_number",
137 .data = &service_number,
138 .maxlen = sizeof(int),
140 .proc_handler = &proc_dointvec
144 .procname = "min_reconnect_interval",
145 .data = &min_reconnect_interval,
146 .maxlen = sizeof(int),
148 .proc_handler = &proc_dointvec
152 .procname = "max_reconnect_interval",
153 .data = &max_reconnect_interval,
154 .maxlen = sizeof(int),
156 .proc_handler = &proc_dointvec
160 .procname = "concurrent_peers",
161 .data = &concurrent_peers,
162 .maxlen = sizeof(int),
164 .proc_handler = &proc_dointvec
170 .maxlen = sizeof(int),
172 .proc_handler = &proc_dointvec
176 .procname = "timeout",
178 .maxlen = sizeof(int),
180 .proc_handler = &proc_dointvec
186 .maxlen = sizeof(int),
188 .proc_handler = &proc_dointvec
192 .procname = "credits",
194 .maxlen = sizeof(int),
196 .proc_handler = &proc_dointvec
200 .procname = "peer_credits",
201 .data = &peer_credits,
202 .maxlen = sizeof(int),
204 .proc_handler = &proc_dointvec
208 .procname = "arp_retries",
209 .data = &arp_retries,
210 .maxlen = sizeof(int),
212 .proc_handler = &proc_dointvec
216 .procname = "hca_basename",
217 .data = hca_basename_space,
218 .maxlen = sizeof(hca_basename_space),
220 .proc_handler = &proc_dostring
224 .procname = "ipif_basename",
225 .data = ipif_basename_space,
226 .maxlen = sizeof(ipif_basename_space),
228 .proc_handler = &proc_dostring
232 .procname = "local_ack_timeout",
233 .data = &local_ack_timeout,
234 .maxlen = sizeof(int),
236 .proc_handler = &proc_dointvec
240 .procname = "retry_cnt",
242 .maxlen = sizeof(int),
244 .proc_handler = &proc_dointvec
248 .procname = "rnr_cnt",
250 .maxlen = sizeof(int),
252 .proc_handler = &proc_dointvec
256 .procname = "rnr_nak_timer",
257 .data = &rnr_nak_timer,
258 .maxlen = sizeof(int),
260 .proc_handler = &proc_dointvec
264 .procname = "keepalive",
266 .maxlen = sizeof(int),
268 .proc_handler = &proc_dointvec
272 .procname = "concurrent_sends",
273 .data = &concurrent_sends,
274 .maxlen = sizeof(int),
276 .proc_handler = &proc_dointvec
281 .procname = "fmr_remaps",
283 .maxlen = sizeof(int),
285 .proc_handler = &proc_dointvec
291 static cfs_sysctl_table_t kibnal_top_ctl_table[] = {
294 .procname = "vibnal",
298 .child = kibnal_ctl_table
304 kibnal_initstrtunable(char *space, char *str, int size)
306 strncpy(space, str, size);
311 kibnal_tunables_init ()
313 kibnal_initstrtunable(hca_basename_space, hca_basename,
314 sizeof(hca_basename_space));
315 kibnal_initstrtunable(ipif_basename_space, ipif_basename,
316 sizeof(ipif_basename_space));
318 kibnal_tunables.kib_sysctl =
319 cfs_register_sysctl_table(kibnal_top_ctl_table, 0);
321 if (kibnal_tunables.kib_sysctl == NULL)
322 CWARN("Can't setup /proc tunables\n");
324 if (*kibnal_tunables.kib_concurrent_sends > IBNAL_RX_MSGS)
325 *kibnal_tunables.kib_concurrent_sends = IBNAL_RX_MSGS;
326 if (*kibnal_tunables.kib_concurrent_sends < IBNAL_MSG_QUEUE_SIZE)
327 *kibnal_tunables.kib_concurrent_sends = IBNAL_MSG_QUEUE_SIZE;
333 kibnal_tunables_fini ()
335 if (kibnal_tunables.kib_sysctl != NULL)
336 cfs_unregister_sysctl_table(kibnal_tunables.kib_sysctl);
342 kibnal_tunables_init ()
348 kibnal_tunables_fini ()