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.
25 int gmnal_small_msg_size = 525312;
27 * -1 indicates default value.
28 * This is 1 thread per cpu
29 * See start_kernel_threads
31 int num_rx_threads = -1;
36 gmnal_cmd(struct portals_cfg *pcfg, void *private)
38 gmnal_data_t *nal_data = NULL;
42 gm_status_t gm_status;
45 CDEBUG(D_TRACE, "gmnal_cmd [%d] private [%p]\n",
46 pcfg->pcfg_command, private);
47 nal_data = (gmnal_data_t*)private;
48 switch(pcfg->pcfg_command) {
50 * just reuse already defined GET_NID. Should define GMNAL version
52 case(GMNAL_IOC_GET_GNID):
54 PORTAL_ALLOC(name, pcfg->pcfg_plen1);
55 copy_from_user(name, pcfg->pcfg_pbuf1, pcfg->pcfg_plen1);
57 GMNAL_GM_LOCK(nal_data);
58 //nid = gm_host_name_to_node_id(nal_data->gm_port, name);
59 gm_status = gm_host_name_to_node_id_ex (nal_data->gm_port, 0, name, &nid);
60 GMNAL_GM_UNLOCK(nal_data);
61 if (gm_status != GM_SUCCESS) {
62 CDEBUG(D_INFO, "gm_host_name_to_node_id_ex(...host %s) failed[%d]\n",
66 CDEBUG(D_INFO, "Local node %s id is [%d]\n", name, nid);
67 GMNAL_GM_LOCK(nal_data);
68 gm_status = gm_node_id_to_global_id(nal_data->gm_port,
70 GMNAL_GM_UNLOCK(nal_data);
71 if (gm_status != GM_SUCCESS) {
72 CDEBUG(D_INFO, "gm_node_id_to_global_id failed[%d]\n",
76 CDEBUG(D_INFO, "Global node is is [%u][%x]\n", gnid, gnid);
77 copy_to_user(pcfg->pcfg_pbuf2, &gnid, pcfg->pcfg_plen2);
80 CDEBUG(D_INFO, "gmnal_cmd UNKNOWN[%d]\n", pcfg->pcfg_command);
93 CDEBUG(D_TRACE, "This is the gmnal module initialisation routine\n");
96 CDEBUG(D_INFO, "Calling gmnal_init\n");
97 status = gmnal_init();
98 if (status == PTL_OK) {
99 CDEBUG(D_INFO, "Portals GMNAL initialised ok\n");
101 CDEBUG(D_INFO, "Portals GMNAL Failed to initialise\n");
106 CDEBUG(D_INFO, "This is the end of the gmnal init routine");
121 module_init(gmnal_load);
123 module_exit(gmnal_unload);
125 MODULE_PARM(gmnal_small_msg_size, "i");
126 MODULE_PARM(num_rx_threads, "i");
127 MODULE_PARM(num_stxds, "i");
128 MODULE_PARM(gm_port, "i");
130 MODULE_AUTHOR("Morgan Doyle");
132 MODULE_DESCRIPTION("A Portals kernel NAL for Myrinet GM.");
134 MODULE_LICENSE("GPL");