1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2005 Cluster File Systems, Inc. All rights reserved.
5 * Author: PJ Kirner <pjkirner@clusterfs.com>
7 * This file is part of the Lustre file system, http://www.lustre.org
8 * Lustre is a trademark of Cluster File Systems, Inc.
10 * This file is confidential source code owned by Cluster File Systems.
11 * No viewing, modification, compilation, redistribution, or any other
12 * form of use is permitted except through a signed license agreement.
14 * If you have not signed such an agreement, then you have no rights to
15 * this file. Please destroy it immediately and contact CFS.
23 CFS_MODULE_PARM(ntx, "i", int, 0444,
24 "# of TX descriptors");
26 static int max_nodes = 1152;
27 CFS_MODULE_PARM(max_nodes, "i", int, 0444,
28 "maximum number of peer nodes");
30 static int max_procs_per_node = 2;
31 CFS_MODULE_PARM(max_procs_per_node, "i", int, 0444,
32 "maximum number of processes per peer node to cache");
34 static int checksum = 0;
35 CFS_MODULE_PARM(checksum, "i", int, 0644,
36 "set non-zero to enable message (not RDMA) checksums");
38 static int timeout = 50;
39 CFS_MODULE_PARM(timeout, "i", int, 0644,
42 static int portal = PTLLND_PORTAL; /* <lnet/ptllnd_wire.h> */
43 CFS_MODULE_PARM(portal, "i", int, 0444,
46 static int pid = PTLLND_PID; /* <lnet/ptllnd_wire.h> */
47 CFS_MODULE_PARM(pid, "i", int, 0444,
50 static int rxb_npages = 1;
51 CFS_MODULE_PARM(rxb_npages, "i", int, 0444,
52 "# of pages per rx buffer");
54 static int rxb_nspare = 8;
55 CFS_MODULE_PARM(rxb_nspare, "i", int, 0444,
56 "# of spare rx buffers");
58 static int credits = 128;
59 CFS_MODULE_PARM(credits, "i", int, 0444,
62 static int peercredits = PTLLND_PEERCREDITS; /* <lnet/ptllnd_wire.h> */
63 CFS_MODULE_PARM(peercredits, "i", int, 0444,
64 "concurrent sends to 1 peer");
66 static int max_msg_size = PTLLND_MAX_KLND_MSG_SIZE; /* <lnet/ptllnd_wire.h> */
67 CFS_MODULE_PARM(max_msg_size, "i", int, 0444,
68 "max size of immediate message");
70 static int peer_hash_table_size = 101;
71 CFS_MODULE_PARM(peer_hash_table_size, "i", int, 0444,
72 "# of slots in the peer hash table");
74 static int reschedule_loops = 100;
75 CFS_MODULE_PARM(reschedule_loops, "i", int, 0644,
76 "# of loops before scheduler does cond_resched()");
78 static int ack_puts = 0;
79 CFS_MODULE_PARM(ack_puts, "i", int, 0644,
80 "get portals to ack all PUTs");
83 static int ptltrace_on_timeout = 0;
84 CFS_MODULE_PARM(ptltrace_on_timeout, "i", int, 0644,
85 "dump ptltrace on timeout");
87 static char *ptltrace_basename = "/tmp/lnet-ptltrace";
88 CFS_MODULE_PARM(ptltrace_basename, "s", charp, 0644,
89 "ptltrace dump file basename");
92 static int simulation_bitmap = 0;
93 CFS_MODULE_PARM(simulation_bitmap, "i", int, 0444,
98 kptl_tunables_t kptllnd_tunables = {
100 .kptl_max_nodes = &max_nodes,
101 .kptl_max_procs_per_node = &max_procs_per_node,
102 .kptl_checksum = &checksum,
103 .kptl_portal = &portal,
105 .kptl_timeout = &timeout,
106 .kptl_rxb_npages = &rxb_npages,
107 .kptl_rxb_nspare = &rxb_nspare,
108 .kptl_credits = &credits,
109 .kptl_peercredits = &peercredits,
110 .kptl_max_msg_size = &max_msg_size,
111 .kptl_peer_hash_table_size = &peer_hash_table_size,
112 .kptl_reschedule_loops = &reschedule_loops,
113 .kptl_ack_puts = &ack_puts,
115 .kptl_ptltrace_on_timeout = &ptltrace_on_timeout,
116 .kptl_ptltrace_basename = &ptltrace_basename,
119 .kptl_simulation_bitmap = &simulation_bitmap,
124 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
126 static char ptltrace_basename_space[1024];
129 kptllnd_init_strtunable(char **str_param, char *space, int size)
131 strncpy(space, *str_param, size);
137 static cfs_sysctl_table_t kptllnd_ctl_table[] = {
142 .maxlen = sizeof(int),
144 .proc_handler = &proc_dointvec
148 .procname = "max_nodes",
150 .maxlen = sizeof(int),
152 .proc_handler = &proc_dointvec
156 .procnmae = "max_procs_per_node",
157 .data = &max_procs_per_node,
158 .maxlen = sizeof(int),
160 .proc_handler = &proc_dointvec
164 .procname = "checksum",
166 .maxlen = sizeof(int),
168 .proc_handler = &proc_dointvec
172 .procname = "timeout",
174 .maxlen = sizeof(int),
176 .proc_handler = &proc_dointvec
180 .procname = "portal",
182 .maxlen = sizeof(int),
184 .proc_handler = &proc_dointvec
190 .maxlen = sizeof(int),
192 .proc_handler = &proc_dointvec
196 .procname = "rxb_npages",
198 .maxlen = sizeof(int),
200 .proc_handler = &proc_dointvec
204 .procname = "credits",
206 .maxlen = sizeof(int),
208 .proc_handler = &proc_dointvec
212 .procname = "peercredits",
213 .data = &peercredits,
214 .maxlen = sizeof(int),
216 .proc_handler = &proc_dointvec
220 .procname = "max_msg_size",
221 .data = &max_msg_size,
222 .maxlen = sizeof(int),
224 .proc_handler = &proc_dointvec
228 .procname = "peer_hash_table_size",
229 .data = &peer_hash_table_size,
230 .maxlen = sizeof(int),
232 .proc_handler = &proc_dointvec
236 .procname = "reschedule_loops",
237 .data = &reschedule_loops,
238 .maxlen = sizeof(int),
240 .proc_handler = &proc_dointvec
244 .procname = "ack_puts",
246 .maxlen = sizeof(int),
248 .proc_handler = &proc_dointvec
253 .procname = "ptltrace_on_timeout",
254 .data = &ptltrace_on_timeout,
255 .maxlen = sizeof(int),
257 .proc_handler = &proc_dointvec
261 .procname = "ptltrace_basename",
262 .data = ptltrace_basename_space,
263 .maxlen = sizeof(ptltrace_basename_space),
265 .proc_handler = &proc_dostring,
266 .strategy = &sysctl_string
272 .procname = "simulation_bitmap",
273 .data = &simulation_bitmap,
274 .maxlen = sizeof(int),
276 .proc_handler = &proc_dointvec
283 static cfs_sysctl_table_t kptllnd_top_ctl_table[] = {
286 .procname = "ptllnd",
290 .child = kptllnd_ctl_table
296 kptllnd_tunables_init ()
299 kptllnd_init_strtunable(&ptltrace_basename,
300 ptltrace_basename_space,
301 sizeof(ptltrace_basename_space));
303 kptllnd_tunables.kptl_sysctl =
304 cfs_register_sysctl_table(kptllnd_top_ctl_table, 0);
306 if (kptllnd_tunables.kptl_sysctl == NULL)
307 CWARN("Can't setup /proc tunables\n");
313 kptllnd_tunables_fini ()
315 if (kptllnd_tunables.kptl_sysctl != NULL)
316 cfs_unregister_sysctl_table(kptllnd_tunables.kptl_sysctl);
322 kptllnd_tunables_init ()
328 kptllnd_tunables_fini ()