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 = 1;
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 ctl_table kptllnd_ctl_table[] = {
139 sizeof(int), 0444, NULL, &proc_dointvec},
140 {2, "max_nodes", &max_nodes,
141 sizeof(int), 0444, NULL, &proc_dointvec},
142 {3, "max_procs_per_node", &max_procs_per_node,
143 sizeof(int), 0444, NULL, &proc_dointvec},
144 {4, "checksum", &checksum,
145 sizeof(int), 0644, NULL, &proc_dointvec},
146 {5, "timeout", &timeout,
147 sizeof(int), 0644, NULL, &proc_dointvec},
148 {6, "portal", &portal,
149 sizeof(int), 0444, NULL, &proc_dointvec},
151 sizeof(int), 0444, NULL, &proc_dointvec},
152 {8, "rxb_npages", &rxb_npages,
153 sizeof(int), 0444, NULL, &proc_dointvec},
154 {9, "credits", &credits,
155 sizeof(int), 0444, NULL, &proc_dointvec},
156 {10, "peercredits", &peercredits,
157 sizeof(int), 0444, NULL, &proc_dointvec},
158 {11, "max_msg_size", &max_msg_size,
159 sizeof(int), 0444, NULL, &proc_dointvec},
160 {12, "peer_hash_table_size", &peer_hash_table_size,
161 sizeof(int), 0444, NULL, &proc_dointvec},
162 {13, "reschedule_loops", &reschedule_loops,
163 sizeof(int), 0444, NULL, &proc_dointvec},
164 {14, "ack_puts", &ack_puts,
165 sizeof(int), 0644, NULL, &proc_dointvec},
167 {15, "ptltrace_on_timeout", &ptltrace_on_timeout,
168 sizeof(int), 0644, NULL, &proc_dointvec},
169 {16, "ptltrace_basename", ptltrace_basename_space,
170 sizeof(ptltrace_basename_space), 0644, NULL, &proc_dostring,
174 {17, "simulation_bitmap", &simulation_bitmap,
175 sizeof(int), 0444, NULL, &proc_dointvec},
181 static ctl_table kptllnd_top_ctl_table[] = {
182 {203, "ptllnd", NULL, 0, 0555, kptllnd_ctl_table},
187 kptllnd_tunables_init ()
190 kptllnd_init_strtunable(&ptltrace_basename,
191 ptltrace_basename_space,
192 sizeof(ptltrace_basename_space));
194 kptllnd_tunables.kptl_sysctl =
195 register_sysctl_table(kptllnd_top_ctl_table, 0);
197 if (kptllnd_tunables.kptl_sysctl == NULL)
198 CWARN("Can't setup /proc tunables\n");
204 kptllnd_tunables_fini ()
206 if (kptllnd_tunables.kptl_sysctl != NULL)
207 unregister_sysctl_table(kptllnd_tunables.kptl_sysctl);
213 kptllnd_tunables_init ()
219 kptllnd_tunables_fini ()