2 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
4 * Author: Eric Barton <eric@bartonsoftware.com>
6 * This file is part of Portals, http://www.lustre.org
8 * Portals is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Portals is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Portals; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 static int tx_maxcontig = (1<<10);
26 CFS_MODULE_PARM(tx_maxcontig, "i", int, 0444,
27 "maximum payload to de-fragment");
29 static int ntxmsgs = 512;
30 CFS_MODULE_PARM(ntxmsgs, "i", int, 0444,
33 static int credits = 128;
34 CFS_MODULE_PARM(credits, "i", int, 0444,
35 "# concurrent sends");
37 static int peer_credits = 8;
38 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
39 "# per-peer concurrent sends");
41 static int nrxmsgs_large = 64;
42 CFS_MODULE_PARM(nrxmsgs_large, "i", int, 0444,
43 "# 'large' rx msg buffers");
45 static int ep_envelopes_large = 256;
46 CFS_MODULE_PARM(ep_envelopes_large, "i", int, 0444,
47 "# 'large' rx msg envelope buffers");
49 static int nrxmsgs_small = 256;
50 CFS_MODULE_PARM(nrxmsgs_small, "i", int, 0444,
51 "# 'small' rx msg buffers");
53 static int ep_envelopes_small = 2048;
54 CFS_MODULE_PARM(ep_envelopes_small, "i", int, 0444,
55 "# 'small' rx msg envelope buffers");
57 static int optimized_puts = (32<<10);
58 CFS_MODULE_PARM(optimized_puts, "i", int, 0644,
59 "zero-copy puts >= this size");
61 static int optimized_gets = 2048;
62 CFS_MODULE_PARM(optimized_gets, "i", int, 0644,
63 "zero-copy gets >= this size");
66 static int inject_csum_error = 0;
67 CFS_MODULE_PARM(inject_csum_error, "i", int, 0644,
71 kqswnal_tunables_t kqswnal_tunables = {
72 .kqn_tx_maxcontig = &tx_maxcontig,
73 .kqn_ntxmsgs = &ntxmsgs,
74 .kqn_credits = &credits,
75 .kqn_peercredits = &peer_credits,
76 .kqn_nrxmsgs_large = &nrxmsgs_large,
77 .kqn_ep_envelopes_large = &ep_envelopes_large,
78 .kqn_nrxmsgs_small = &nrxmsgs_small,
79 .kqn_ep_envelopes_small = &ep_envelopes_small,
80 .kqn_optimized_puts = &optimized_puts,
81 .kqn_optimized_gets = &optimized_gets,
83 .kqn_inject_csum_error = &inject_csum_error,
87 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
89 static struct ctl_table kqswnal_ctl_table[] = {
92 .procname = "tx_maxcontig",
93 .data = &tx_maxcontig,
94 .maxlen = sizeof (int),
96 .proc_handler = &proc_dointvec
100 .procname = "ntxmsgs",
102 .maxlen = sizeof (int),
104 .proc_handler = &proc_dointvec
108 .procname = "credits",
110 .maxlen = sizeof (int),
112 .proc_handler = &proc_dointvec
116 .procname = "peer_credits",
117 .data = &peer_credits,
118 .maxlen = sizeof (int),
120 .proc_handler = &proc_dointvec
124 .procname = "nrxmsgs_large",
125 .data = &nrxmsgs_large,
126 .maxlen = sizeof (int),
128 .proc_handler = &proc_dointvec
132 .procname = "ep_envelopes_large",
133 .data = &ep_envelopes_large,
134 .maxlen = sizeof (int),
136 .proc_handler = &proc_dointvec
140 .procname = "nrxmsgs_small",
141 .data = &nrxmsgs_small,
142 .maxlen = sizeof (int),
144 .proc_handler = &proc_dointvec
148 .procname = "ep_envelopes_small",
149 .data = &ep_envelopes_small,
150 .maxlen = sizeof (int),
152 .proc_handler = &proc_dointvec
156 .procname = "optimized_puts",
157 .data = &optimized_puts,
158 .maxlen = sizeof (int),
160 .proc_handler = &proc_dointvec
164 .procname = "optimized_gets",
165 .data = &optimized_gets,
166 .maxlen = sizeof (int),
168 .proc_handler = &proc_dointvec
173 .procname = "inject_csum_error",
174 .data = &inject_csum_error,
175 .maxlen = sizeof (int),
177 .proc_handler = &proc_dointvec
183 static struct ctl_table kqswnal_top_ctl_table[] = {
186 .procname = "qswnal",
190 .child = kqswnal_ctl_table
196 kqswnal_tunables_init ()
198 kqswnal_tunables.kqn_sysctl =
199 register_sysctl_table(kqswnal_top_ctl_table);
201 if (kqswnal_tunables.kqn_sysctl == NULL)
202 CWARN("Can't setup /proc tunables\n");
207 void kqswnal_tunables_fini()
209 if (kqswnal_tunables.kqn_sysctl != NULL)
210 unregister_sysctl_table(kqswnal_tunables.kqn_sysctl);
214 kqswnal_tunables_init ()
220 kqswnal_tunables_fini ()