2 * -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
3 * vim:expandtab:shiftwidth=8:tabstop=8:
7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 only,
11 * as published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License version 2 for more details (a copy is included
17 * in the LICENSE file that accompanied this code).
19 * You should have received a copy of the GNU General Public License
20 * version 2 along with this program; If not, see [sun.com URL with a
23 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
24 * CA 95054 USA or visit www.sun.com if you need additional information or
30 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
31 * Use is subject to license terms.
33 * Copyright (c) 2003 Los Alamos National Laboratory (LANL)
36 * This file is part of Lustre, http://www.lustre.org/
37 * Lustre is a trademark of Sun Microsystems, Inc.
44 CFS_MODULE_PARM(port, "i", int, 0444,
45 "GM port to use for communications");
48 CFS_MODULE_PARM(ntx, "i", int, 0444,
51 static int credits = 128;
52 CFS_MODULE_PARM(credits, "i", int, 0444,
53 "# concurrent sends");
55 static int peer_credits = 8;
56 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
57 "# concurrent sends per peer");
59 static int nlarge_tx_bufs = 32;
60 CFS_MODULE_PARM(nlarge_tx_bufs, "i", int, 0444,
61 "# large tx message buffers");
63 static int nrx_small = 128;
64 CFS_MODULE_PARM(nrx_small, "i", int, 0444,
65 "# small rx message buffers");
67 static int nrx_large = 64;
68 CFS_MODULE_PARM(nrx_large, "i", int, 0444,
69 "# large rx message buffers");
71 gmnal_tunables_t gmnal_tunables = {
74 .gm_credits = &credits,
75 .gm_peer_credits = &peer_credits,
76 .gm_nlarge_tx_bufs = &nlarge_tx_bufs,
77 .gm_nrx_small = &nrx_small,
78 .gm_nrx_large = &nrx_large,
81 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
82 static cfs_sysctl_table_t gmnal_ctl_table[] = {
87 .maxlen = sizeof (int),
89 .proc_handler = &proc_dointvec
95 .maxlen = sizeof (int),
97 .proc_handler = &proc_dointvec
101 .procname = "credits",
103 .maxlen = sizeof (int),
105 .proc_handler = &proc_dointvec
109 .procname = "peer_credits",
110 .data = &peer_credits,
111 .maxlen = sizeof (int),
113 .proc_handler = &proc_dointvec
117 .procname = "nlarge_tx_bufs",
118 .data = &nlarge_tx_bufs,
119 .maxlen = sizeof (int),
121 .proc_handler = &proc_dointvec
125 .procname = "nrx_small",
127 .maxlen = sizeof (int),
129 .proc_handler = &proc_dointvec
133 .procname = "nrx_large",
135 .maxlen = sizeof (int),
137 .proc_handler = &proc_dointvec
142 static cfs_sysctl_table_t gmnal_top_ctl_table[] = {
149 .child = gmnal_ctl_table
159 CDEBUG(D_TRACE, "This is the gmnal module initialisation routine\n");
161 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
162 gmnal_tunables.gm_sysctl =
163 cfs_register_sysctl_table(gmnal_top_ctl_table, 0);
165 if (gmnal_tunables.gm_sysctl == NULL)
166 CWARN("Can't setup /proc tunables\n");
168 CDEBUG(D_NET, "Calling gmnal_init\n");
169 status = gmnal_init();
171 CDEBUG(D_NET, "Portals GMNAL initialised ok\n");
173 CDEBUG(D_NET, "Portals GMNAL Failed to initialise\n");
177 CDEBUG(D_NET, "This is the end of the gmnal init routine");
186 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
187 if (gmnal_tunables.gm_sysctl != NULL)
188 cfs_unregister_sysctl_table(gmnal_tunables.gm_sysctl);
192 module_init(gmnal_load);
193 module_exit(gmnal_unload);
195 MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
196 MODULE_DESCRIPTION("Kernel GM LND v1.01");
197 MODULE_LICENSE("GPL");