1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lnet/klnds/viblnd/viblnd_modparams.c
38 * Author: Eric Barton <eric@bartonsoftware.com>
43 static int service_number = 0x11b9a2;
44 CFS_MODULE_PARM(service_number, "i", int, 0444,
47 static int min_reconnect_interval = 1;
48 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
49 "minimum connection retry interval (seconds)");
51 static int max_reconnect_interval = 60;
52 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
53 "maximum connection retry interval (seconds)");
55 static int concurrent_peers = 1152;
56 CFS_MODULE_PARM(concurrent_peers, "i", int, 0444,
57 "maximum number of peers that may connect");
60 CFS_MODULE_PARM(cksum, "i", int, 0644,
61 "set non-zero to enable message (not RDMA) checksums");
63 static int timeout = 50;
64 CFS_MODULE_PARM(timeout, "i", int, 0644,
68 CFS_MODULE_PARM(ntx, "i", int, 0444,
69 "# of message descriptors");
71 static int credits = 128;
72 CFS_MODULE_PARM(credits, "i", int, 0444,
73 "# concurrent sends");
75 static int peer_credits = 8;
76 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
77 "# concurrent sends to 1 peer");
79 static int arp_retries = 3;
80 CFS_MODULE_PARM(arp_retries, "i", int, 0644,
81 "# of times to retry ARP");
83 static char *hca_basename = "InfiniHost";
84 CFS_MODULE_PARM(hca_basename, "s", charp, 0444,
87 static char *ipif_basename = "ipoib";
88 CFS_MODULE_PARM(ipif_basename, "s", charp, 0444,
89 "IPoIB interface base name");
91 static int local_ack_timeout = 0x12;
92 CFS_MODULE_PARM(local_ack_timeout, "i", int, 0644,
93 "ACK timeout for low-level 'sends'");
95 static int retry_cnt = 7;
96 CFS_MODULE_PARM(retry_cnt, "i", int, 0644,
97 "Retransmissions when no ACK received");
99 static int rnr_cnt = 6;
100 CFS_MODULE_PARM(rnr_cnt, "i", int, 0644,
101 "RNR retransmissions");
103 static int rnr_nak_timer = 0x10;
104 CFS_MODULE_PARM(rnr_nak_timer, "i", int, 0644,
105 "RNR retransmission interval");
107 static int keepalive = 100;
108 CFS_MODULE_PARM(keepalive, "i", int, 0644,
109 "Idle time in seconds before sending a keepalive");
111 static int concurrent_sends = IBNAL_RX_MSGS;
112 CFS_MODULE_PARM(concurrent_sends, "i", int, 0644,
113 "send work-queue sizing");
116 static int fmr_remaps = 1000;
117 CFS_MODULE_PARM(fmr_remaps, "i", int, 0444,
118 "FMR mappings allowed before unmap");
121 kib_tunables_t kibnal_tunables = {
122 .kib_service_number = &service_number,
123 .kib_min_reconnect_interval = &min_reconnect_interval,
124 .kib_max_reconnect_interval = &max_reconnect_interval,
125 .kib_concurrent_peers = &concurrent_peers,
127 .kib_timeout = &timeout,
129 .kib_credits = &credits,
130 .kib_peercredits = &peer_credits,
131 .kib_arp_retries = &arp_retries,
132 .kib_hca_basename = &hca_basename,
133 .kib_ipif_basename = &ipif_basename,
134 .kib_local_ack_timeout = &local_ack_timeout,
135 .kib_retry_cnt = &retry_cnt,
136 .kib_rnr_cnt = &rnr_cnt,
137 .kib_rnr_nak_timer = &rnr_nak_timer,
138 .kib_keepalive = &keepalive,
139 .kib_concurrent_sends = &concurrent_sends,
141 .kib_fmr_remaps = &fmr_remaps,
145 #ifndef HAVE_SYSCTL_UNNUMBERED
149 VIBLND_RECONNECT_MIN,
150 VIBLND_RECONNECT_MAX,
151 VIBLND_CONCURRENT_PEERS,
159 VIBLND_IPIF_BASENAME,
160 VIBLND_LOCAL_ACK_TIMEOUT,
163 VIBLND_RNR_NAK_TIMER,
165 VIBLND_CONCURRENT_SENDS,
170 #define VIBLND_SERVICE CTL_UNNUMBERED
171 #define VIBLND_RECONNECT_MIN CTL_UNNUMBERED
172 #define VIBLND_RECONNECT_MAX CTL_UNNUMBERED
173 #define VIBLND_CONCURRENT_PEERS CTL_UNNUMBERED
174 #define VIBLND_CHKSUM CTL_UNNUMBERED
175 #define VIBLND_TIMEOUT CTL_UNNUMBERED
176 #define VIBLND_NTX CTL_UNNUMBERED
177 #define VIBLND_CREDITS CTL_UNNUMBERED
178 #define VIBLND_PEER_CREDITS CTL_UNNUMBERED
179 #define VIBLND_ARP_RETRIES CTL_UNNUMBERED
180 #define VIBLND_HCA_BASENAME CTL_UNNUMBERED
181 #define VIBLND_IPIF_BASENAME CTL_UNNUMBERED
182 #define VIBLND_LOCAL_ACK_TIMEOUT CTL_UNNUMBERED
183 #define VIBLND_RETRY_CNT CTL_UNNUMBERED
184 #define VIBLND_RNR_CNT CTL_UNNUMBERED
185 #define VIBLND_RNR_NAK_TIMER CTL_UNNUMBERED
186 #define VIBLND_KEEPALIVE CTL_UNNUMBERED
187 #define VIBLND_CONCURRENT_SENDS CTL_UNNUMBERED
188 #define VIBLND_FMR_REMAPS CTL_UNNUMBERED
192 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
194 static char hca_basename_space[32];
195 static char ipif_basename_space[32];
197 static cfs_sysctl_table_t kibnal_ctl_table[] = {
199 .ctl_name = VIBLND_SERVICE,
200 .procname = "service_number",
201 .data = &service_number,
202 .maxlen = sizeof(int),
204 .proc_handler = &proc_dointvec
207 .ctl_name = VIBLND_RECONNECT_MIN,
208 .procname = "min_reconnect_interval",
209 .data = &min_reconnect_interval,
210 .maxlen = sizeof(int),
212 .proc_handler = &proc_dointvec
215 .ctl_name = VIBLND_RECONNECT_MAX,
216 .procname = "max_reconnect_interval",
217 .data = &max_reconnect_interval,
218 .maxlen = sizeof(int),
220 .proc_handler = &proc_dointvec
223 .ctl_name = VIBLND_CONCURRENT_PEERS,
224 .procname = "concurrent_peers",
225 .data = &concurrent_peers,
226 .maxlen = sizeof(int),
228 .proc_handler = &proc_dointvec
231 .ctl_name = VIBLND_CHKSUM,
234 .maxlen = sizeof(int),
236 .proc_handler = &proc_dointvec
239 .ctl_name = VIBLND_TIMEOUT,
240 .procname = "timeout",
242 .maxlen = sizeof(int),
244 .proc_handler = &proc_dointvec
247 .ctl_name = VIBLND_NTX,
250 .maxlen = sizeof(int),
252 .proc_handler = &proc_dointvec
255 .ctl_name = VIBLND_CREDITS,
256 .procname = "credits",
258 .maxlen = sizeof(int),
260 .proc_handler = &proc_dointvec
263 .ctl_name = VIBLND_PEER_CREDITS,
264 .procname = "peer_credits",
265 .data = &peer_credits,
266 .maxlen = sizeof(int),
268 .proc_handler = &proc_dointvec
271 .ctl_name = VIBLND_ARP_RETRIES,
272 .procname = "arp_retries",
273 .data = &arp_retries,
274 .maxlen = sizeof(int),
276 .proc_handler = &proc_dointvec
279 .ctl_name = VIBLND_HCA_BASENAME,
280 .procname = "hca_basename",
281 .data = hca_basename_space,
282 .maxlen = sizeof(hca_basename_space),
284 .proc_handler = &proc_dostring
287 .ctl_name = VIBLND_IPIF_BASENAME,
288 .procname = "ipif_basename",
289 .data = ipif_basename_space,
290 .maxlen = sizeof(ipif_basename_space),
292 .proc_handler = &proc_dostring
295 .ctl_name = VIBLND_LOCAL_ACK_TIMEOUT,
296 .procname = "local_ack_timeout",
297 .data = &local_ack_timeout,
298 .maxlen = sizeof(int),
300 .proc_handler = &proc_dointvec
303 .ctl_name = VIBLND_RETRY_CNT,
304 .procname = "retry_cnt",
306 .maxlen = sizeof(int),
308 .proc_handler = &proc_dointvec
311 .ctl_name = VIBLND_RNR_CNT,
312 .procname = "rnr_cnt",
314 .maxlen = sizeof(int),
316 .proc_handler = &proc_dointvec
319 .ctl_name = VIBLND_RNR_NAK_TIMER,
320 .procname = "rnr_nak_timer",
321 .data = &rnr_nak_timer,
322 .maxlen = sizeof(int),
324 .proc_handler = &proc_dointvec
327 .ctl_name = VIBLND_KEEPALIVE,
328 .procname = "keepalive",
330 .maxlen = sizeof(int),
332 .proc_handler = &proc_dointvec
335 .ctl_name = VIBLND_CONCURRENT_SENDS,
336 .procname = "concurrent_sends",
337 .data = &concurrent_sends,
338 .maxlen = sizeof(int),
340 .proc_handler = &proc_dointvec
344 .ctl_name = VIBLND_FMR_REMAPS,
345 .procname = "fmr_remaps",
347 .maxlen = sizeof(int),
349 .proc_handler = &proc_dointvec
355 static cfs_sysctl_table_t kibnal_top_ctl_table[] = {
357 .ctl_name = CTL_VIBLND,
358 .procname = "vibnal",
362 .child = kibnal_ctl_table
368 kibnal_initstrtunable(char *space, char *str, int size)
370 strncpy(space, str, size);
375 kibnal_tunables_init ()
377 kibnal_initstrtunable(hca_basename_space, hca_basename,
378 sizeof(hca_basename_space));
379 kibnal_initstrtunable(ipif_basename_space, ipif_basename,
380 sizeof(ipif_basename_space));
382 kibnal_tunables.kib_sysctl =
383 cfs_register_sysctl_table(kibnal_top_ctl_table, 0);
385 if (kibnal_tunables.kib_sysctl == NULL)
386 CWARN("Can't setup /proc tunables\n");
388 if (*kibnal_tunables.kib_concurrent_sends > IBNAL_RX_MSGS)
389 *kibnal_tunables.kib_concurrent_sends = IBNAL_RX_MSGS;
390 if (*kibnal_tunables.kib_concurrent_sends < IBNAL_MSG_QUEUE_SIZE)
391 *kibnal_tunables.kib_concurrent_sends = IBNAL_MSG_QUEUE_SIZE;
397 kibnal_tunables_fini ()
399 if (kibnal_tunables.kib_sysctl != NULL)
400 cfs_unregister_sysctl_table(kibnal_tunables.kib_sysctl);
406 kibnal_tunables_init ()
412 kibnal_tunables_fini ()