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 [sun.com URL with a
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 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
147 static char hca_basename_space[32];
148 static char ipif_basename_space[32];
150 static cfs_sysctl_table_t kibnal_ctl_table[] = {
153 .procname = "service_number",
154 .data = &service_number,
155 .maxlen = sizeof(int),
157 .proc_handler = &proc_dointvec
161 .procname = "min_reconnect_interval",
162 .data = &min_reconnect_interval,
163 .maxlen = sizeof(int),
165 .proc_handler = &proc_dointvec
169 .procname = "max_reconnect_interval",
170 .data = &max_reconnect_interval,
171 .maxlen = sizeof(int),
173 .proc_handler = &proc_dointvec
177 .procname = "concurrent_peers",
178 .data = &concurrent_peers,
179 .maxlen = sizeof(int),
181 .proc_handler = &proc_dointvec
187 .maxlen = sizeof(int),
189 .proc_handler = &proc_dointvec
193 .procname = "timeout",
195 .maxlen = sizeof(int),
197 .proc_handler = &proc_dointvec
203 .maxlen = sizeof(int),
205 .proc_handler = &proc_dointvec
209 .procname = "credits",
211 .maxlen = sizeof(int),
213 .proc_handler = &proc_dointvec
217 .procname = "peer_credits",
218 .data = &peer_credits,
219 .maxlen = sizeof(int),
221 .proc_handler = &proc_dointvec
225 .procname = "arp_retries",
226 .data = &arp_retries,
227 .maxlen = sizeof(int),
229 .proc_handler = &proc_dointvec
233 .procname = "hca_basename",
234 .data = hca_basename_space,
235 .maxlen = sizeof(hca_basename_space),
237 .proc_handler = &proc_dostring
241 .procname = "ipif_basename",
242 .data = ipif_basename_space,
243 .maxlen = sizeof(ipif_basename_space),
245 .proc_handler = &proc_dostring
249 .procname = "local_ack_timeout",
250 .data = &local_ack_timeout,
251 .maxlen = sizeof(int),
253 .proc_handler = &proc_dointvec
257 .procname = "retry_cnt",
259 .maxlen = sizeof(int),
261 .proc_handler = &proc_dointvec
265 .procname = "rnr_cnt",
267 .maxlen = sizeof(int),
269 .proc_handler = &proc_dointvec
273 .procname = "rnr_nak_timer",
274 .data = &rnr_nak_timer,
275 .maxlen = sizeof(int),
277 .proc_handler = &proc_dointvec
281 .procname = "keepalive",
283 .maxlen = sizeof(int),
285 .proc_handler = &proc_dointvec
289 .procname = "concurrent_sends",
290 .data = &concurrent_sends,
291 .maxlen = sizeof(int),
293 .proc_handler = &proc_dointvec
298 .procname = "fmr_remaps",
300 .maxlen = sizeof(int),
302 .proc_handler = &proc_dointvec
308 static cfs_sysctl_table_t kibnal_top_ctl_table[] = {
311 .procname = "vibnal",
315 .child = kibnal_ctl_table
321 kibnal_initstrtunable(char *space, char *str, int size)
323 strncpy(space, str, size);
328 kibnal_tunables_init ()
330 kibnal_initstrtunable(hca_basename_space, hca_basename,
331 sizeof(hca_basename_space));
332 kibnal_initstrtunable(ipif_basename_space, ipif_basename,
333 sizeof(ipif_basename_space));
335 kibnal_tunables.kib_sysctl =
336 cfs_register_sysctl_table(kibnal_top_ctl_table, 0);
338 if (kibnal_tunables.kib_sysctl == NULL)
339 CWARN("Can't setup /proc tunables\n");
341 if (*kibnal_tunables.kib_concurrent_sends > IBNAL_RX_MSGS)
342 *kibnal_tunables.kib_concurrent_sends = IBNAL_RX_MSGS;
343 if (*kibnal_tunables.kib_concurrent_sends < IBNAL_MSG_QUEUE_SIZE)
344 *kibnal_tunables.kib_concurrent_sends = IBNAL_MSG_QUEUE_SIZE;
350 kibnal_tunables_fini ()
352 if (kibnal_tunables.kib_sysctl != NULL)
353 cfs_unregister_sysctl_table(kibnal_tunables.kib_sysctl);
359 kibnal_tunables_init ()
365 kibnal_tunables_fini ()