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 static struct ctl_table kmxlnd_ctl_table[] = {
109 .procname = "n_waitd",
111 .maxlen = sizeof(int),
113 .proc_handler = &proc_dointvec
117 .procname = "max_peers",
119 .maxlen = sizeof(int),
121 .proc_handler = &proc_dointvec
127 .maxlen = sizeof(int),
129 .proc_handler = &proc_dointvec
135 .maxlen = sizeof(int),
137 .proc_handler = &proc_dointvec
141 .procname = "credits",
143 .maxlen = sizeof(int),
145 .proc_handler = &proc_dointvec
149 .procname = "peercredits",
150 .data = &peercredits,
151 .maxlen = sizeof(int),
153 .proc_handler = &proc_dointvec
159 .maxlen = sizeof(int),
161 .proc_handler = &proc_dointvec
167 .maxlen = sizeof(int),
169 .proc_handler = &proc_dointvec
172 .procname = "ipif_name",
173 .data = ipif_basename_space,
174 .maxlen = sizeof(ipif_basename_space),
176 .proc_handler = &proc_dostring
180 .procname = "polling",
182 .maxlen = sizeof(int),
184 .proc_handler = &proc_dointvec
189 static struct ctl_table kmxlnd_top_ctl_table[] = {
196 .child = kmxlnd_ctl_table
202 kmxlnd_initstrtunable(char *space, char *str, int size)
204 strncpy(space, str, size);
209 kmxlnd_sysctl_init (void)
211 kmxlnd_initstrtunable(ipif_basename_space, ipif_name,
212 sizeof(ipif_basename_space));
214 kmxlnd_tunables.kib_sysctl =
215 register_sysctl_table(kmxlnd_top_ctl_table);
217 if (kmxlnd_tunables.kib_sysctl == NULL)
218 CWARN("Can't setup /proc tunables\n");
222 kmxlnd_sysctl_fini (void)
224 if (kmxlnd_tunables.kib_sysctl != NULL)
225 unregister_sysctl_table(kmxlnd_tunables.kib_sysctl);
231 kmxlnd_sysctl_init (void)
236 kmxlnd_sysctl_fini (void)
243 kmxlnd_tunables_init (void)
245 kmxlnd_sysctl_init();
250 kmxlnd_tunables_fini (void)
252 kmxlnd_sysctl_fini();