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
81 static cfs_sysctl_table_t gmnal_ctl_table[] = {
86 .maxlen = sizeof (int),
88 .proc_handler = &proc_dointvec
94 .maxlen = sizeof (int),
96 .proc_handler = &proc_dointvec
100 .procname = "credits",
102 .maxlen = sizeof (int),
104 .proc_handler = &proc_dointvec
108 .procname = "peer_credits",
109 .data = &peer_credits,
110 .maxlen = sizeof (int),
112 .proc_handler = &proc_dointvec
116 .procname = "nlarge_tx_bufs",
117 .data = &nlarge_tx_bufs,
118 .maxlen = sizeof (int),
120 .proc_handler = &proc_dointvec
124 .procname = "nrx_small",
126 .maxlen = sizeof (int),
128 .proc_handler = &proc_dointvec
132 .procname = "nrx_large",
134 .maxlen = sizeof (int),
136 .proc_handler = &proc_dointvec
141 static cfs_sysctl_table_t gmnal_top_ctl_table[] = {
148 .child = gmnal_ctl_table
158 CDEBUG(D_TRACE, "This is the gmnal module initialisation routine\n");
160 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
161 gmnal_tunables.gm_sysctl =
162 cfs_register_sysctl_table(gmnal_top_ctl_table, 0);
164 if (gmnal_tunables.gm_sysctl == NULL)
165 CWARN("Can't setup /proc tunables\n");
167 CDEBUG(D_NET, "Calling gmnal_init\n");
168 status = gmnal_init();
170 CDEBUG(D_NET, "Portals GMNAL initialised ok\n");
172 CDEBUG(D_NET, "Portals GMNAL Failed to initialise\n");
176 CDEBUG(D_NET, "This is the end of the gmnal init routine");
185 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
186 if (gmnal_tunables.gm_sysctl != NULL)
187 cfs_unregister_sysctl_table(gmnal_tunables.gm_sysctl);
191 module_init(gmnal_load);
192 module_exit(gmnal_unload);
194 MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
195 MODULE_DESCRIPTION("Kernel GM LND v1.01");
196 MODULE_LICENSE("GPL");