4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
30 * Copyright (C) 2006 Myricom, Inc.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
36 * lnet/klnds/mxlnd/mxlnd.c
38 * Author: Eric Barton <eric@bartonsoftware.com>
39 * Author: Scott Atchley <atchley at myri.com>
44 static int n_waitd = MXLND_N_SCHED;
45 CFS_MODULE_PARM(n_waitd, "i", int, 0444,
46 "# of completion daemons");
48 /* this was used to allocate global rxs which are no londer used */
49 static int max_peers = MXLND_MAX_PEERS;
50 CFS_MODULE_PARM(max_peers, "i", int, 0444,
51 "Unused - was maximum number of peers that may connect");
53 static int cksum = MXLND_CKSUM;
54 CFS_MODULE_PARM(cksum, "i", int, 0644,
55 "set non-zero to enable message (not data payload) checksums");
57 static int ntx = MXLND_NTX;
58 CFS_MODULE_PARM(ntx, "i", int, 0444,
59 "# of total tx message descriptors");
61 /* this duplicates ntx */
62 static int credits = MXLND_NTX;
63 CFS_MODULE_PARM(credits, "i", int, 0444,
64 "Unused - was # concurrent sends to all peers");
66 static int peercredits = MXLND_MSG_QUEUE_DEPTH;
67 CFS_MODULE_PARM(peercredits, "i", int, 0444,
68 "# concurrent sends to one peer");
70 static int board = MXLND_MX_BOARD;
71 CFS_MODULE_PARM(board, "i", int, 0444,
72 "index value of the Myrinet board (NIC)");
74 static int ep_id = MXLND_MX_EP_ID;
75 CFS_MODULE_PARM(ep_id, "i", int, 0444, "MX endpoint ID");
77 static char *ipif_name = "myri0";
78 CFS_MODULE_PARM(ipif_name, "s", charp, 0444,
79 "IPoMX interface name");
81 static int polling = MXLND_POLLING;
82 CFS_MODULE_PARM(polling, "i", int, 0444,
83 "Use 0 to block (wait). A value > 0 will poll that many times before blocking");
85 static char *hosts = NULL;
86 CFS_MODULE_PARM(hosts, "s", charp, 0444,
87 "Unused - was IP-to-hostname resolution file");
89 kmx_tunables_t kmxlnd_tunables = {
90 .kmx_n_waitd = &n_waitd,
91 .kmx_max_peers = &max_peers,
94 .kmx_credits = &credits,
95 .kmx_peercredits = &peercredits,
98 .kmx_default_ipif = &ipif_name,
99 .kmx_polling = &polling
102 #if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
104 static char ipif_basename_space[32];
106 #ifndef HAVE_SYSCTL_UNNUMBERED
121 #define MXLND_N_WAITD CTL_UNNUMBERED
122 #define MXLND_MAX_PEERS CTL_UNNUMBERED
123 #define MXLND_CKSUM CTL_UNNUMBERED
124 #define MXLND_NNTX CTL_UNNUMBERED
125 #define MXLND_CREDITS CTL_UNNUMBERED
126 #define MXLND_BOARD CTL_UNNUMBERED
127 #define MXLND_EP_ID CTL_UNNUMBERED
128 #define MXLND_IPIF_BASENAME CTL_UNNUMBERED
129 #define MXLND_POLLING CTL_UNNUMBERED
133 static struct ctl_table kmxlnd_ctl_table[] = {
136 .procname = "n_waitd",
138 .maxlen = sizeof(int),
140 .proc_handler = &proc_dointvec
144 .procname = "max_peers",
146 .maxlen = sizeof(int),
148 .proc_handler = &proc_dointvec
154 .maxlen = sizeof(int),
156 .proc_handler = &proc_dointvec
162 .maxlen = sizeof(int),
164 .proc_handler = &proc_dointvec
168 .procname = "credits",
170 .maxlen = sizeof(int),
172 .proc_handler = &proc_dointvec
176 .procname = "peercredits",
177 .data = &peercredits,
178 .maxlen = sizeof(int),
180 .proc_handler = &proc_dointvec
186 .maxlen = sizeof(int),
188 .proc_handler = &proc_dointvec
194 .maxlen = sizeof(int),
196 .proc_handler = &proc_dointvec
200 .procname = "ipif_name",
201 .data = ipif_basename_space,
202 .maxlen = sizeof(ipif_basename_space),
204 .proc_handler = &proc_dostring
208 .procname = "polling",
210 .maxlen = sizeof(int),
212 .proc_handler = &proc_dointvec
217 static struct ctl_table kmxlnd_top_ctl_table[] = {
224 .child = kmxlnd_ctl_table
230 kmxlnd_initstrtunable(char *space, char *str, int size)
232 strncpy(space, str, size);
237 kmxlnd_sysctl_init (void)
239 kmxlnd_initstrtunable(ipif_basename_space, ipif_name,
240 sizeof(ipif_basename_space));
242 kmxlnd_tunables.kib_sysctl =
243 register_sysctl_table(kmxlnd_top_ctl_table);
245 if (kmxlnd_tunables.kib_sysctl == NULL)
246 CWARN("Can't setup /proc tunables\n");
250 kmxlnd_sysctl_fini (void)
252 if (kmxlnd_tunables.kib_sysctl != NULL)
253 unregister_sysctl_table(kmxlnd_tunables.kib_sysctl);
259 kmxlnd_sysctl_init (void)
264 kmxlnd_sysctl_fini (void)
271 kmxlnd_tunables_init (void)
273 kmxlnd_sysctl_init();
278 kmxlnd_tunables_fini (void)
280 kmxlnd_sysctl_fini();