4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
31 * This file is part of Lustre, http://www.lustre.org/
32 * Lustre is a trademark of Sun Microsystems, Inc.
34 * lnet/klnds/ptllnd/ptllnd_modparams.c
36 * Author: PJ Kirner <pjkirner@clusterfs.com>
43 CFS_MODULE_PARM(ntx, "i", int, 0444,
44 "# of TX descriptors");
46 static int max_nodes = 1152;
47 CFS_MODULE_PARM(max_nodes, "i", int, 0444,
48 "maximum number of peer nodes");
50 static int max_procs_per_node = 2;
51 CFS_MODULE_PARM(max_procs_per_node, "i", int, 0444,
52 "maximum number of processes per peer node to cache");
54 static int checksum = 0;
55 CFS_MODULE_PARM(checksum, "i", int, 0644,
56 "set non-zero to enable message (not RDMA) checksums");
58 /* NB 250 is the Cray Portals wire timeout */
59 static int timeout = 250;
60 CFS_MODULE_PARM(timeout, "i", int, 0644,
63 static int portal = PTLLND_PORTAL; /* <lnet/ptllnd_wire.h> */
64 CFS_MODULE_PARM(portal, "i", int, 0444,
67 static int pid = PTLLND_PID; /* <lnet/ptllnd_wire.h> */
68 CFS_MODULE_PARM(pid, "i", int, 0444,
71 static int rxb_npages = 1;
72 CFS_MODULE_PARM(rxb_npages, "i", int, 0444,
73 "# of pages per rx buffer");
75 static int rxb_nspare = 8;
76 CFS_MODULE_PARM(rxb_nspare, "i", int, 0444,
77 "# of spare rx buffers");
79 static int credits = 128;
80 CFS_MODULE_PARM(credits, "i", int, 0444,
83 static int peercredits = PTLLND_PEERCREDITS; /* <lnet/ptllnd_wire.h> */
84 CFS_MODULE_PARM(peercredits, "i", int, 0444,
85 "concurrent sends to 1 peer");
87 static int peer_buffer_credits = 0;
88 CFS_MODULE_PARM(peer_buffer_credits, "i", int, 0444,
89 "# per-peer router buffer credits");
91 static int max_msg_size = PTLLND_MAX_KLND_MSG_SIZE; /* <lnet/ptllnd_wire.h> */
92 CFS_MODULE_PARM(max_msg_size, "i", int, 0444,
93 "max size of immediate message");
95 static int peer_hash_table_size = 101;
96 CFS_MODULE_PARM(peer_hash_table_size, "i", int, 0444,
97 "# of slots in the peer hash table");
99 static int reschedule_loops = 100;
100 CFS_MODULE_PARM(reschedule_loops, "i", int, 0644,
101 "# of loops before scheduler does cond_resched()");
103 static int ack_puts = 0;
104 CFS_MODULE_PARM(ack_puts, "i", int, 0644,
105 "get portals to ack all PUTs");
108 static int simulation_bitmap = 0;
109 CFS_MODULE_PARM(simulation_bitmap, "i", int, 0444,
110 "simulation bitmap");
114 kptl_tunables_t kptllnd_tunables = {
116 .kptl_max_nodes = &max_nodes,
117 .kptl_max_procs_per_node = &max_procs_per_node,
118 .kptl_checksum = &checksum,
119 .kptl_portal = &portal,
121 .kptl_timeout = &timeout,
122 .kptl_rxb_npages = &rxb_npages,
123 .kptl_rxb_nspare = &rxb_nspare,
124 .kptl_credits = &credits,
125 .kptl_peertxcredits = &peercredits,
126 .kptl_peerrtrcredits = &peer_buffer_credits,
127 .kptl_max_msg_size = &max_msg_size,
128 .kptl_peer_hash_table_size = &peer_hash_table_size,
129 .kptl_reschedule_loops = &reschedule_loops,
130 .kptl_ack_puts = &ack_puts,
132 .kptl_simulation_bitmap = &simulation_bitmap,
137 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
139 #ifndef HAVE_SYSCTL_UNNUMBERED
144 KPTLLND_MAX_PROC_PER_NODE,
151 KPTLLND_PEERTXCREDITS,
152 KPTLLND_PEERRTRCREDITS,
153 KPTLLND_MAX_MSG_SIZE,
154 KPTLLND_PEER_HASH_SIZE,
155 KPTLLND_RESHEDULE_LOOPS,
157 KPTLLND_TRACETIMEOUT,
159 KPTLLND_TRACEBASENAME,
160 KPTLLND_SIMULATION_BITMAP
164 #define KPTLLND_NTX CTL_UNNUMBERED
165 #define KPTLLND_MAX_NODES CTL_UNNUMBERED
166 #define KPTLLND_MAX_PROC_PER_NODE CTL_UNNUMBERED
167 #define KPTLLND_CHECKSUM CTL_UNNUMBERED
168 #define KPTLLND_TIMEOUT CTL_UNNUMBERED
169 #define KPTLLND_PORTAL CTL_UNNUMBERED
170 #define KPTLLND_PID CTL_UNNUMBERED
171 #define KPTLLND_RXB_PAGES CTL_UNNUMBERED
172 #define KPTLLND_CREDITS CTL_UNNUMBERED
173 #define KPTLLND_PEERTXCREDITS CTL_UNNUMBERED
174 #define KPTLLND_PEERRTRCREDITS CTL_UNNUMBERED
175 #define KPTLLND_MAX_MSG_SIZE CTL_UNNUMBERED
176 #define KPTLLND_PEER_HASH_SIZE CTL_UNNUMBERED
177 #define KPTLLND_RESHEDULE_LOOPS CTL_UNNUMBERED
178 #define KPTLLND_ACK_PUTS CTL_UNNUMBERED
179 #define KPTLLND_TRACETIMEOUT CTL_UNNUMBERED
180 #define KPTLLND_TRACEFAIL CTL_UNNUMBERED
181 #define KPTLLND_TRACEBASENAME CTL_UNNUMBERED
182 #define KPTLLND_SIMULATION_BITMAP CTL_UNNUMBERED
185 static cfs_sysctl_table_t kptllnd_ctl_table[] = {
187 .ctl_name = KPTLLND_NTX,
190 .maxlen = sizeof(int),
192 .proc_handler = &proc_dointvec
195 .ctl_name = KPTLLND_MAX_NODES,
196 .procname = "max_nodes",
198 .maxlen = sizeof(int),
200 .proc_handler = &proc_dointvec
203 .ctl_name = KPTLLND_MAX_PROC_PER_NODE,
204 .procname = "max_procs_per_node",
205 .data = &max_procs_per_node,
206 .maxlen = sizeof(int),
208 .proc_handler = &proc_dointvec
211 .ctl_name = KPTLLND_CHECKSUM,
212 .procname = "checksum",
214 .maxlen = sizeof(int),
216 .proc_handler = &proc_dointvec
219 .ctl_name = KPTLLND_TIMEOUT,
220 .procname = "timeout",
222 .maxlen = sizeof(int),
224 .proc_handler = &proc_dointvec
227 .ctl_name = KPTLLND_PORTAL,
228 .procname = "portal",
230 .maxlen = sizeof(int),
232 .proc_handler = &proc_dointvec
235 .ctl_name = KPTLLND_PID,
238 .maxlen = sizeof(int),
240 .proc_handler = &proc_dointvec
243 .ctl_name = KPTLLND_RXB_PAGES,
244 .procname = "rxb_npages",
246 .maxlen = sizeof(int),
248 .proc_handler = &proc_dointvec
251 .ctl_name = KPTLLND_CREDITS,
252 .procname = "credits",
254 .maxlen = sizeof(int),
256 .proc_handler = &proc_dointvec
259 .ctl_name = KPTLLND_PEERTXCREDITS,
260 .procname = "peercredits",
261 .data = &peercredits,
262 .maxlen = sizeof(int),
264 .proc_handler = &proc_dointvec
267 .ctl_name = KPTLLND_PEERRTRCREDITS,
268 .procname = "peer_buffer_credits",
269 .data = &peer_buffer_credits,
270 .maxlen = sizeof(int),
272 .proc_handler = &proc_dointvec
275 .ctl_name = KPTLLND_MAX_MSG_SIZE,
276 .procname = "max_msg_size",
277 .data = &max_msg_size,
278 .maxlen = sizeof(int),
280 .proc_handler = &proc_dointvec
283 .ctl_name = KPTLLND_PEER_HASH_SIZE,
284 .procname = "peer_hash_table_size",
285 .data = &peer_hash_table_size,
286 .maxlen = sizeof(int),
288 .proc_handler = &proc_dointvec
291 .ctl_name = KPTLLND_RESHEDULE_LOOPS,
292 .procname = "reschedule_loops",
293 .data = &reschedule_loops,
294 .maxlen = sizeof(int),
296 .proc_handler = &proc_dointvec
299 .ctl_name = KPTLLND_ACK_PUTS,
300 .procname = "ack_puts",
302 .maxlen = sizeof(int),
304 .proc_handler = &proc_dointvec
308 .ctl_name = KPTLLND_SIMULATION_BITMAP,
309 .procname = "simulation_bitmap",
310 .data = &simulation_bitmap,
311 .maxlen = sizeof(int),
313 .proc_handler = &proc_dointvec
320 static cfs_sysctl_table_t kptllnd_top_ctl_table[] = {
322 .ctl_name = CTL_PTLLND,
323 .procname = "ptllnd",
327 .child = kptllnd_ctl_table
333 kptllnd_tunables_init ()
335 kptllnd_tunables.kptl_sysctl =
336 cfs_register_sysctl_table(kptllnd_top_ctl_table, 0);
338 if (kptllnd_tunables.kptl_sysctl == NULL)
339 CWARN("Can't setup /proc tunables\n");
345 kptllnd_tunables_fini ()
347 if (kptllnd_tunables.kptl_sysctl != NULL)
348 cfs_unregister_sysctl_table(kptllnd_tunables.kptl_sysctl);
354 kptllnd_tunables_init ()
360 kptllnd_tunables_fini ()