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 CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
87 static ctl_table kqswnal_ctl_table[] = {
88 {1, "tx_maxcontig", &tx_maxcontig,
89 sizeof (int), 0444, NULL, &proc_dointvec},
90 {2, "ntxmsgs", &ntxmsgs,
91 sizeof (int), 0444, NULL, &proc_dointvec},
92 {3, "credits", &credits,
93 sizeof (int), 0444, NULL, &proc_dointvec},
94 {4, "peer_credits", &peer_credits,
95 sizeof (int), 0444, NULL, &proc_dointvec},
96 {5, "nrxmsgs_large", &nrxmsgs_large,
97 sizeof (int), 0444, NULL, &proc_dointvec},
98 {6, "ep_envelopes_large", &ep_envelopes_large,
99 sizeof (int), 0444, NULL, &proc_dointvec},
100 {7, "nrxmsgs_small", &nrxmsgs_small,
101 sizeof (int), 0444, NULL, &proc_dointvec},
102 {8, "ep_envelopes_small", &ep_envelopes_small,
103 sizeof (int), 0444, NULL, &proc_dointvec},
104 {9, "optimized_puts", &optimized_puts,
105 sizeof (int), 0644, NULL, &proc_dointvec},
106 {10, "optimized_gets", &optimized_gets,
107 sizeof (int), 0644, NULL, &proc_dointvec},
109 {11, "inject_csum_error", &inject_csum_error,
110 sizeof (int), 0644, NULL, &proc_dointvec},
115 static ctl_table kqswnal_top_ctl_table[] = {
116 {201, "qswnal", NULL, 0, 0555, kqswnal_ctl_table},
121 kqswnal_tunables_init ()
123 kqswnal_tunables.kqn_sysctl =
124 cfs_register_sysctl_table(kqswnal_top_ctl_table, 0);
126 if (kqswnal_tunables.kqn_sysctl == NULL)
127 CWARN("Can't setup /proc tunables\n");
133 kqswnal_tunables_fini ()
135 if (kqswnal_tunables.kqn_sysctl != NULL)
136 cfs_unregister_sysctl_table(kqswnal_tunables.kqn_sysctl);
140 kqswnal_tunables_init ()
146 kqswnal_tunables_fini ()