1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (c) 2003 Los Alamos National Laboratory (LANL)
6 * This file is part of Lustre, http://www.lustre.org/
8 * Lustre 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 * Lustre 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 Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 CFS_MODULE_PARM(port, "i", int, 0444,
27 "GM port to use for communications");
30 CFS_MODULE_PARM(ntx, "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 "# concurrent sends per peer");
41 static int nlarge_tx_bufs = 32;
42 CFS_MODULE_PARM(nlarge_tx_bufs, "i", int, 0444,
43 "# large tx message buffers");
45 static int nrx_small = 128;
46 CFS_MODULE_PARM(nrx_small, "i", int, 0444,
47 "# small rx message buffers");
49 static int nrx_large = 64;
50 CFS_MODULE_PARM(nrx_large, "i", int, 0444,
51 "# large rx message buffers");
53 gmnal_tunables_t gmnal_tunables = {
56 .gm_credits = &credits,
57 .gm_peer_credits = &peer_credits,
58 .gm_nlarge_tx_bufs = &nlarge_tx_bufs,
59 .gm_nrx_small = &nrx_small,
60 .gm_nrx_large = &nrx_large,
63 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
64 static cfs_sysctl_table_t gmnal_ctl_table[] = {
69 .maxlen = sizeof (int),
71 .proc_handler = &proc_dointvec
77 .maxlen = sizeof (int),
79 .proc_handler = &proc_dointvec
83 .procname = "credits",
85 .maxlen = sizeof (int),
87 .proc_handler = &proc_dointvec
91 .procname = "peer_credits",
92 .data = &peer_credits,
93 .maxlen = sizeof (int),
95 .proc_handler = &proc_dointvec
99 .procname = "nlarge_tx_bufs",
100 .data = &nlarge_tx_bufs,
101 .maxlen = sizeof (int),
103 .proc_handler = &proc_dointvec
107 .procname = "nrx_small",
109 .maxlen = sizeof (int),
111 .proc_handler = &proc_dointvec
115 .procname = "nrx_large",
117 .maxlen = sizeof (int),
119 .proc_handler = &proc_dointvec
124 static cfs_sysctl_table_t gmnal_top_ctl_table[] = {
131 .child = gmnal_ctl_table
141 CDEBUG(D_TRACE, "This is the gmnal module initialisation routine\n");
143 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
144 gmnal_tunables.gm_sysctl =
145 cfs_register_sysctl_table(gmnal_top_ctl_table, 0);
147 if (gmnal_tunables.gm_sysctl == NULL)
148 CWARN("Can't setup /proc tunables\n");
150 CDEBUG(D_NET, "Calling gmnal_init\n");
151 status = gmnal_init();
153 CDEBUG(D_NET, "Portals GMNAL initialised ok\n");
155 CDEBUG(D_NET, "Portals GMNAL Failed to initialise\n");
159 CDEBUG(D_NET, "This is the end of the gmnal init routine");
168 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
169 if (gmnal_tunables.gm_sysctl != NULL)
170 cfs_unregister_sysctl_table(gmnal_tunables.gm_sysctl);
174 module_init(gmnal_load);
175 module_exit(gmnal_unload);
177 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
178 MODULE_DESCRIPTION("Kernel GM LND v1.01");
179 MODULE_LICENSE("GPL");