2 * Copyright (C) 2002-2004 Cluster File Systems, Inc.
3 * Author: Eric Barton <eric@bartonsoftware.com>
5 * This file is part of Portals, http://www.lustre.org
7 * Portals is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU General Public
9 * License as published by the Free Software Foundation.
11 * Portals is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Portals; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 static int tx_maxcontig = (1<<10);
25 CFS_MODULE_PARM(tx_maxcontig, "i", int, 0444,
26 "maximum payload to de-fragment");
28 static int ntxmsgs = 512;
29 CFS_MODULE_PARM(ntxmsgs, "i", int, 0444,
32 static int credits = 128;
33 CFS_MODULE_PARM(credits, "i", int, 0444,
34 "# concurrent sends");
36 static int peer_credits = 8;
37 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
38 "# per-peer concurrent sends");
40 static int nrxmsgs_large = 64;
41 CFS_MODULE_PARM(nrxmsgs_large, "i", int, 0444,
42 "# 'large' rx msg buffers");
44 static int ep_envelopes_large = 256;
45 CFS_MODULE_PARM(ep_envelopes_large, "i", int, 0444,
46 "# 'large' rx msg envelope buffers");
48 static int nrxmsgs_small = 256;
49 CFS_MODULE_PARM(nrxmsgs_small, "i", int, 0444,
50 "# 'small' rx msg buffers");
52 static int ep_envelopes_small = 2048;
53 CFS_MODULE_PARM(ep_envelopes_small, "i", int, 0444,
54 "# 'small' rx msg envelope buffers");
56 static int optimized_puts = (32<<10);
57 CFS_MODULE_PARM(optimized_puts, "i", int, 0644,
58 "zero-copy puts >= this size");
60 static int optimized_gets = 2048;
61 CFS_MODULE_PARM(optimized_gets, "i", int, 0644,
62 "zero-copy gets >= this size");
65 static int inject_csum_error = 0;
66 CFS_MODULE_PARM(inject_csum_error, "i", int, 0644,
70 kqswnal_tunables_t kqswnal_tunables = {
71 .kqn_tx_maxcontig = &tx_maxcontig,
72 .kqn_ntxmsgs = &ntxmsgs,
73 .kqn_credits = &credits,
74 .kqn_peercredits = &peer_credits,
75 .kqn_nrxmsgs_large = &nrxmsgs_large,
76 .kqn_ep_envelopes_large = &ep_envelopes_large,
77 .kqn_nrxmsgs_small = &nrxmsgs_small,
78 .kqn_ep_envelopes_small = &ep_envelopes_small,
79 .kqn_optimized_puts = &optimized_puts,
80 .kqn_optimized_gets = &optimized_gets,
82 .kqn_inject_csum_error = &inject_csum_error,
86 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
87 static cfs_sysctl_table_t kqswnal_ctl_table[] = {
90 .procname = "tx_maxcontig",
91 .data = &tx_maxcontig,
92 .maxlen = sizeof (int),
94 .proc_handler = &proc_dointvec
98 .procname = "ntxmsgs",
100 .maxlen = sizeof (int),
102 .proc_handler = &proc_dointvec
106 .procname = "credits",
108 .maxlen = sizeof (int),
110 .proc_handler = &proc_dointvec
114 .procname = "peer_credits",
115 .data = &peer_credits,
116 .maxlen = sizeof (int),
118 .proc_handler = &proc_dointvec
122 .procname = "nrxmsgs_large",
123 .data = &nrxmsgs_large,
124 .maxlen = sizeof (int),
126 .proc_handler = &proc_dointvec
130 .procname = "ep_envelopes_large",
131 .data = &ep_envelopes_large,
132 .maxlen = sizeof (int),
134 .proc_handler = &proc_dointvec
138 .procname = "nrxmsgs_small",
139 .data = &nrxmsgs_small,
140 .maxlen = sizeof (int),
142 .proc_handler = &proc_dointvec
146 .procname = "ep_envelopes_small",
147 .data = &ep_envelopes_small,
148 .maxlen = sizeof (int),
150 .proc_handler = &proc_dointvec
154 .procname = "optimized_puts",
155 .data = &optimized_puts,
156 .maxlen = sizeof (int),
158 .proc_handler = &proc_dointvec
162 .procname = "optimized_gets",
163 .data = &optimized_gets,
164 .maxlen = sizeof (int),
166 .proc_handler = &proc_dointvec
171 .procname = "inject_csum_error",
172 .data = &inject_csum_error,
173 .maxlen = sizeof (int),
175 .proc_handler = &proc_dointvec
181 static cfs_sysctl_table_t kqswnal_top_ctl_table[] = {
184 .procname = "qswnal",
188 .child = kqswnal_ctl_table
194 kqswnal_tunables_init ()
196 kqswnal_tunables.kqn_sysctl =
197 cfs_register_sysctl_table(kqswnal_top_ctl_table, 0);
199 if (kqswnal_tunables.kqn_sysctl == NULL)
200 CWARN("Can't setup /proc tunables\n");
206 kqswnal_tunables_fini ()
208 if (kqswnal_tunables.kqn_sysctl != NULL)
209 cfs_unregister_sysctl_table(kqswnal_tunables.kqn_sysctl);
213 kqswnal_tunables_init ()
219 kqswnal_tunables_fini ()