Whamcloud - gitweb
* cleaned up startup/shutdown handling
[fs/lustre-release.git] / lnet / klnds / gmlnd / gmlnd_module.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  *  Copyright (c) 2003 Los Alamos National Laboratory (LANL)
5  *
6  *   This file is part of Lustre, http://www.lustre.org/
7  *
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.
11  *
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.
16  *
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.
20  */
21
22 #include "gmnal.h"
23
24
25 /*
26  *      -1 indicates default value.
27  *      This is 1 thread per cpu
28  *      See start_kernel_threads
29  */
30 int num_rx_threads = -1;
31 int num_txds = 5;
32 int gm_port_id = 4;
33
34 static int __init
35 gmnal_load(void)
36 {
37         int     status;
38         CDEBUG(D_TRACE, "This is the gmnal module initialisation routine\n");
39
40
41         CDEBUG(D_NET, "Calling gmnal_init\n");
42         status = gmnal_init();
43         if (status == PTL_OK) {
44                 CDEBUG(D_NET, "Portals GMNAL initialised ok\n");
45         } else {
46                 CDEBUG(D_NET, "Portals GMNAL Failed to initialise\n");
47                 return(-ENODEV);
48         }
49
50         CDEBUG(D_NET, "This is the end of the gmnal init routine");
51
52         return(0);
53 }
54
55
56 static void __exit
57 gmnal_unload(void)
58 {
59         gmnal_fini();
60         return;
61 }
62
63
64 module_init(gmnal_load);
65 module_exit(gmnal_unload);
66
67 MODULE_PARM(num_rx_threads, "i");
68 MODULE_PARM(num_txds, "i");
69 MODULE_PARM(gm_port_id, "i");
70
71 MODULE_AUTHOR("Morgan Doyle");
72
73 MODULE_DESCRIPTION("A Portals kernel NAL for Myrinet GM.");
74
75 MODULE_LICENSE("GPL");