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 ctl_table gmnal_ctl_table[] = {
66 sizeof (int), 0444, NULL, &proc_dointvec},
68 sizeof (int), 0444, NULL, &proc_dointvec},
69 {3, "credits", &credits,
70 sizeof (int), 0444, NULL, &proc_dointvec},
71 {4, "peer_credits", &peer_credits,
72 sizeof (int), 0444, NULL, &proc_dointvec},
73 {5, "nlarge_tx_bufs", &nlarge_tx_bufs,
74 sizeof (int), 0444, NULL, &proc_dointvec},
75 {6, "nrx_small", &nrx_small,
76 sizeof (int), 0444, NULL, &proc_dointvec},
77 {7, "nrx_large", &nrx_large,
78 sizeof (int), 0444, NULL, &proc_dointvec},
82 static ctl_table gmnal_top_ctl_table[] = {
83 {207, "gmnal", NULL, 0, 0555, gmnal_ctl_table},
92 CDEBUG(D_TRACE, "This is the gmnal module initialisation routine\n");
94 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
95 gmnal_tunables.gm_sysctl =
96 register_sysctl_table(gmnal_top_ctl_table, 0);
98 if (gmnal_tunables.gm_sysctl == NULL)
99 CWARN("Can't setup /proc tunables\n");
101 CDEBUG(D_NET, "Calling gmnal_init\n");
102 status = gmnal_init();
104 CDEBUG(D_NET, "Portals GMNAL initialised ok\n");
106 CDEBUG(D_NET, "Portals GMNAL Failed to initialise\n");
110 CDEBUG(D_NET, "This is the end of the gmnal init routine");
119 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
120 if (gmnal_tunables.gm_sysctl != NULL)
121 unregister_sysctl_table(gmnal_tunables.gm_sysctl);
125 module_init(gmnal_load);
126 module_exit(gmnal_unload);
128 MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
129 MODULE_DESCRIPTION("Kernel GM LND v1.01");
130 MODULE_LICENSE("GPL");