1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
32 * Copyright (c) 2003 Los Alamos National Laboratory (LANL)
35 * This file is part of Lustre, http://www.lustre.org/
36 * Lustre is a trademark of Sun Microsystems, Inc.
43 CFS_MODULE_PARM(port, "i", int, 0444,
44 "GM port to use for communications");
47 CFS_MODULE_PARM(ntx, "i", int, 0444,
50 static int credits = 128;
51 CFS_MODULE_PARM(credits, "i", int, 0444,
52 "# concurrent sends");
54 static int peer_credits = 8;
55 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
56 "# concurrent sends per peer");
58 static int nlarge_tx_bufs = 32;
59 CFS_MODULE_PARM(nlarge_tx_bufs, "i", int, 0444,
60 "# large tx message buffers");
62 static int nrx_small = 128;
63 CFS_MODULE_PARM(nrx_small, "i", int, 0444,
64 "# small rx message buffers");
66 static int nrx_large = 64;
67 CFS_MODULE_PARM(nrx_large, "i", int, 0444,
68 "# large rx message buffers");
70 gmnal_tunables_t gmnal_tunables = {
73 .gm_credits = &credits,
74 .gm_peer_credits = &peer_credits,
75 .gm_nlarge_tx_bufs = &nlarge_tx_bufs,
76 .gm_nrx_small = &nrx_small,
77 .gm_nrx_large = &nrx_large,
80 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
82 #ifndef HAVE_SYSCTL_UNNUMBERED
96 #define GMLND_PORT CTL_UNNUMBERED
97 #define GMLND_NTX CTL_UNNUMBERED
98 #define GMLND_CREDITS CTL_UNNUMBERED
99 #define GMLND_PEERCREDITS CTL_UNNUMBERED
100 #define GMLND_NLARGE_TX_BUFS CTL_UNNUMBERED
101 #define GMLND_NRX_SMALL CTL_UNNUMBERED
102 #define GMLND_NRX_LARGE CTL_UNNUMBERED
106 static cfs_sysctl_table_t gmnal_ctl_table[] = {
108 .ctl_name = GMLND_PORT,
111 .maxlen = sizeof (int),
113 .proc_handler = &proc_dointvec
116 .ctl_name = GMLND_NTX,
119 .maxlen = sizeof (int),
121 .proc_handler = &proc_dointvec
124 .ctl_name = GMLND_CREDITS,
125 .procname = "credits",
127 .maxlen = sizeof (int),
129 .proc_handler = &proc_dointvec
132 .ctl_name = GMLND_PEERCREDITS,
133 .procname = "peer_credits",
134 .data = &peer_credits,
135 .maxlen = sizeof (int),
137 .proc_handler = &proc_dointvec
140 .ctl_name = GMLND_NLARGE_TX_BUFS,
141 .procname = "nlarge_tx_bufs",
142 .data = &nlarge_tx_bufs,
143 .maxlen = sizeof (int),
145 .proc_handler = &proc_dointvec
148 .ctl_name = GMLND_NRX_SMALL,
149 .procname = "nrx_small",
151 .maxlen = sizeof (int),
153 .proc_handler = &proc_dointvec
156 .ctl_name = GMLND_NRX_LARGE,
157 .procname = "nrx_large",
159 .maxlen = sizeof (int),
161 .proc_handler = &proc_dointvec
166 static cfs_sysctl_table_t gmnal_top_ctl_table[] = {
168 .ctl_name = CTL_GMLND,
173 .child = gmnal_ctl_table
183 CDEBUG(D_TRACE, "This is the gmnal module initialisation routine\n");
185 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
186 gmnal_tunables.gm_sysctl =
187 cfs_register_sysctl_table(gmnal_top_ctl_table, 0);
189 if (gmnal_tunables.gm_sysctl == NULL)
190 CWARN("Can't setup /proc tunables\n");
192 CDEBUG(D_NET, "Calling gmnal_init\n");
193 status = gmnal_init();
195 CDEBUG(D_NET, "Portals GMNAL initialised ok\n");
197 CDEBUG(D_NET, "Portals GMNAL Failed to initialise\n");
201 CDEBUG(D_NET, "This is the end of the gmnal init routine");
210 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
211 if (gmnal_tunables.gm_sysctl != NULL)
212 cfs_unregister_sysctl_table(gmnal_tunables.gm_sysctl);
216 module_init(gmnal_load);
217 module_exit(gmnal_unload);
219 MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
220 MODULE_DESCRIPTION("Kernel GM LND v1.01");
221 MODULE_LICENSE("GPL");