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_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()");
79 static int ptltrace_on_timeout = 0;
80 CFS_MODULE_PARM(ptltrace_on_timeout, "i", int, 0644,
81 "dump ptltrace on timeout");
83 static char *ptltrace_basename = "/tmp/lnet-ptltrace";
84 CFS_MODULE_PARM(ptltrace_basename, "s", charp, 0644,
85 "ptltrace dump file basename");
88 static int simulation_bitmap = 0;
89 CFS_MODULE_PARM(simulation_bitmap, "i", int, 0444,
94 kptl_tunables_t kptllnd_tunables = {
96 .kptl_max_nodes = &max_nodes,
97 .kptl_max_procs_per_node = &max_procs_per_node,
98 .kptl_checksum = &checksum,
99 .kptl_portal = &portal,
101 .kptl_timeout = &timeout,
102 .kptl_rxb_npages = &rxb_npages,
103 .kptl_rxb_nspare = &rxb_nspare,
104 .kptl_credits = &credits,
105 .kptl_peercredits = &peercredits,
106 .kptl_max_msg_size = &max_msg_size,
107 .kptl_peer_hash_table_size = &peer_hash_table_size,
108 .kptl_reschedule_loops = &reschedule_loops,
110 .kptl_ptltrace_on_timeout = &ptltrace_on_timeout,
111 .kptl_ptltrace_basename = &ptltrace_basename,
114 .kptl_simulation_bitmap = &simulation_bitmap,
119 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
121 static char ptltrace_basename_space[1024];
124 kptllnd_init_strtunable(char **str_param, char *space, int size)
126 strncpy(space, *str_param, size);
132 static ctl_table kptllnd_ctl_table[] = {
134 sizeof(int), 0444, NULL, &proc_dointvec},
135 {2, "max_nodes", &max_nodes,
136 sizeof(int), 0444, NULL, &proc_dointvec},
137 {3, "max_procs_per_node", &max_procs_per_node,
138 sizeof(int), 0444, NULL, &proc_dointvec},
139 {4, "checksum", &checksum,
140 sizeof(int), 0644, NULL, &proc_dointvec},
141 {5, "timeout", &timeout,
142 sizeof(int), 0644, NULL, &proc_dointvec},
143 {6, "portal", &portal,
144 sizeof(int), 0444, NULL, &proc_dointvec},
146 sizeof(int), 0444, NULL, &proc_dointvec},
147 {8, "rxb_npages", &rxb_npages,
148 sizeof(int), 0444, NULL, &proc_dointvec},
149 {9, "credits", &credits,
150 sizeof(int), 0444, NULL, &proc_dointvec},
151 {10, "peercredits", &peercredits,
152 sizeof(int), 0444, NULL, &proc_dointvec},
153 {11, "max_msg_size", &max_msg_size,
154 sizeof(int), 0444, NULL, &proc_dointvec},
155 {12, "peer_hash_table_size", &peer_hash_table_size,
156 sizeof(int), 0444, NULL, &proc_dointvec},
157 {13, "reschedule_loops", &reschedule_loops,
158 sizeof(int), 0444, NULL, &proc_dointvec},
160 {14, "ptltrace_on_timeout", &ptltrace_on_timeout,
161 sizeof(int), 0644, NULL, &proc_dointvec},
162 {15, "ptltrace_basename", ptltrace_basename_space,
163 sizeof(ptltrace_basename_space), 0644, NULL, &proc_dostring,
167 {16, "simulation_bitmap", &simulation_bitmap,
168 sizeof(int), 0444, NULL, &proc_dointvec},
174 static ctl_table kptllnd_top_ctl_table[] = {
175 {203, "ptllnd", NULL, 0, 0555, kptllnd_ctl_table},
180 kptllnd_tunables_init ()
183 kptllnd_init_strtunable(&ptltrace_basename,
184 ptltrace_basename_space,
185 sizeof(ptltrace_basename_space));
187 kptllnd_tunables.kptl_sysctl =
188 register_sysctl_table(kptllnd_top_ctl_table, 0);
190 if (kptllnd_tunables.kptl_sysctl == NULL)
191 CWARN("Can't setup /proc tunables\n");
197 kptllnd_tunables_fini ()
199 if (kptllnd_tunables.kptl_sysctl != NULL)
200 unregister_sysctl_table(kptllnd_tunables.kptl_sysctl);
206 kptllnd_tunables_init ()
212 kptllnd_tunables_fini ()