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/o2iblnd/o2iblnd_modparams.c
38 * Author: Eric Barton <eric@bartonsoftware.com>
43 static int service = 987;
44 CFS_MODULE_PARM(service, "i", int, 0444,
45 "service number (within RDMA_PS_TCP)");
48 CFS_MODULE_PARM(cksum, "i", int, 0644,
49 "set non-zero to enable message (not RDMA) checksums");
51 static int timeout = 50;
52 CFS_MODULE_PARM(timeout, "i", int, 0644,
56 CFS_MODULE_PARM(ntx, "i", int, 0444,
57 "# of message descriptors");
59 static int credits = 64;
60 CFS_MODULE_PARM(credits, "i", int, 0444,
61 "# concurrent sends");
63 static int peer_credits = 8;
64 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
65 "# concurrent sends to 1 peer");
67 static char *ipif_name = "ib0";
68 CFS_MODULE_PARM(ipif_name, "s", charp, 0444,
69 "IPoIB interface name");
71 static int retry_count = 5;
72 CFS_MODULE_PARM(retry_count, "i", int, 0644,
73 "Retransmissions when no ACK received");
75 static int rnr_retry_count = 6;
76 CFS_MODULE_PARM(rnr_retry_count, "i", int, 0644,
77 "RNR retransmissions");
79 static int keepalive = 100;
80 CFS_MODULE_PARM(keepalive, "i", int, 0644,
81 "Idle time in seconds before sending a keepalive");
83 static int ib_mtu = 0;
84 CFS_MODULE_PARM(ib_mtu, "i", int, 0444,
85 "IB MTU 256/512/1024/2048/4096");
87 #if IBLND_MAP_ON_DEMAND
88 static int concurrent_sends = IBLND_RX_MSGS;
90 static int concurrent_sends = IBLND_MSG_QUEUE_SIZE;
92 CFS_MODULE_PARM(concurrent_sends, "i", int, 0444,
93 "send work-queue sizing");
95 #if IBLND_MAP_ON_DEMAND
96 static int fmr_pool_size = 512;
97 CFS_MODULE_PARM(fmr_pool_size, "i", int, 0444,
98 "size of the fmr pool (>= ntx)");
100 static int fmr_flush_trigger = 384;
101 CFS_MODULE_PARM(fmr_flush_trigger, "i", int, 0444,
102 "# dirty FMRs that triggers pool flush");
104 static int fmr_cache = 1;
105 CFS_MODULE_PARM(fmr_cache, "i", int, 0444,
106 "non-zero to enable FMR caching");
109 kib_tunables_t kiblnd_tunables = {
110 .kib_service = &service,
112 .kib_timeout = &timeout,
113 .kib_keepalive = &keepalive,
115 .kib_credits = &credits,
116 .kib_peercredits = &peer_credits,
117 .kib_default_ipif = &ipif_name,
118 .kib_retry_count = &retry_count,
119 .kib_rnr_retry_count = &rnr_retry_count,
120 .kib_concurrent_sends = &concurrent_sends,
121 .kib_ib_mtu = &ib_mtu,
122 #if IBLND_MAP_ON_DEMAND
123 .kib_fmr_pool_size = &fmr_pool_size,
124 .kib_fmr_flush_trigger = &fmr_flush_trigger,
125 .kib_fmr_cache = &fmr_cache,
129 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
131 static char ipif_basename_space[32];
133 static cfs_sysctl_table_t kiblnd_ctl_table[] = {
136 .procname = "service",
138 .maxlen = sizeof(int),
140 .proc_handler = &proc_dointvec
146 .maxlen = sizeof(int),
148 .proc_handler = &proc_dointvec
152 .procname = "timeout",
154 .maxlen = sizeof(int),
156 .proc_handler = &proc_dointvec
162 .maxlen = sizeof(int),
164 .proc_handler = &proc_dointvec
168 .procname = "credits",
170 .maxlen = sizeof(int),
172 .proc_handler = &proc_dointvec
176 .procname = "peer_credits",
177 .data = &peer_credits,
178 .maxlen = sizeof(int),
180 .proc_handler = &proc_dointvec
184 .procname = "ipif_name",
185 .data = ipif_basename_space,
186 .maxlen = sizeof(ipif_basename_space),
188 .proc_handler = &proc_dostring
192 .procname = "retry_count",
193 .data = &retry_count,
194 .maxlen = sizeof(int),
196 .proc_handler = &proc_dointvec
200 .procname = "rnr_retry_count",
201 .data = &rnr_retry_count,
202 .maxlen = sizeof(int),
204 .proc_handler = &proc_dointvec
208 .procname = "keepalive",
210 .maxlen = sizeof(int),
212 .proc_handler = &proc_dointvec
216 .procname = "concurrent_sends",
217 .data = &concurrent_sends,
218 .maxlen = sizeof(int),
220 .proc_handler = &proc_dointvec
224 .procname = "ib_mtu",
226 .maxlen = sizeof(int),
228 .proc_handler = &proc_dointvec
230 #if IBLND_MAP_ON_DEMAND
233 .procname = "fmr_pool_size",
234 .data = &fmr_pool_size,
235 .maxlen = sizeof(int),
237 .proc_handler = &proc_dointvec
241 .procname = "fmr_flush_trigger",
242 .data = &fmr_flush_trigger,
243 .maxlen = sizeof(int),
245 .proc_handler = &proc_dointvec
249 .procname = "fmr_cache",
251 .maxlen = sizeof(int),
253 .proc_handler = &proc_dointvec
259 static cfs_sysctl_table_t kiblnd_top_ctl_table[] = {
262 .procname = "o2iblnd",
266 .child = kiblnd_ctl_table
272 kiblnd_initstrtunable(char *space, char *str, int size)
274 strncpy(space, str, size);
279 kiblnd_sysctl_init (void)
281 kiblnd_initstrtunable(ipif_basename_space, ipif_name,
282 sizeof(ipif_basename_space));
284 kiblnd_tunables.kib_sysctl =
285 cfs_register_sysctl_table(kiblnd_top_ctl_table, 0);
287 if (kiblnd_tunables.kib_sysctl == NULL)
288 CWARN("Can't setup /proc tunables\n");
292 kiblnd_sysctl_fini (void)
294 if (kiblnd_tunables.kib_sysctl != NULL)
295 cfs_unregister_sysctl_table(kiblnd_tunables.kib_sysctl);
301 kiblnd_sysctl_init (void)
306 kiblnd_sysctl_fini (void)
313 kiblnd_tunables_init (void)
315 kiblnd_sysctl_init();
317 if (*kiblnd_tunables.kib_concurrent_sends > IBLND_RX_MSGS)
318 *kiblnd_tunables.kib_concurrent_sends = IBLND_RX_MSGS;
319 if (*kiblnd_tunables.kib_concurrent_sends < IBLND_MSG_QUEUE_SIZE)
320 *kiblnd_tunables.kib_concurrent_sends = IBLND_MSG_QUEUE_SIZE;
326 kiblnd_tunables_fini (void)
328 kiblnd_sysctl_fini();