-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
+/*
+ * GPL HEADER START
*
- * Copyright (C) 2005 Cluster File Systems, Inc. All rights reserved.
- * Author: PJ Kirner <pjkirner@clusterfs.com>
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * This file is part of the Lustre file system, http://www.lustre.org
- * Lustre is a trademark of Cluster File Systems, Inc.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
*
- * This file is confidential source code owned by Cluster File Systems.
- * No viewing, modification, compilation, redistribution, or any other
- * form of use is permitted except through a signed license agreement.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
*
- * If you have not signed such an agreement, then you have no rights to
- * this file. Please destroy it immediately and contact CFS.
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
+ *
+ * lnet/klnds/ptllnd/ptllnd_modparams.c
+ *
+ * Author: PJ Kirner <pjkirner@clusterfs.com>
*/
CFS_MODULE_PARM(checksum, "i", int, 0644,
"set non-zero to enable message (not RDMA) checksums");
-static int timeout = 50;
+/* NB 250 is the Cray Portals wire timeout */
+static int timeout = 250;
CFS_MODULE_PARM(timeout, "i", int, 0644,
"timeout (seconds)");
CFS_MODULE_PARM(peercredits, "i", int, 0444,
"concurrent sends to 1 peer");
+static int peer_buffer_credits = 0;
+CFS_MODULE_PARM(peer_buffer_credits, "i", int, 0444,
+ "# per-peer router buffer credits");
+
static int max_msg_size = PTLLND_MAX_KLND_MSG_SIZE; /* <lnet/ptllnd_wire.h> */
CFS_MODULE_PARM(max_msg_size, "i", int, 0444,
"max size of immediate message");
CFS_MODULE_PARM(ack_puts, "i", int, 0644,
"get portals to ack all PUTs");
-#ifdef CRAY_XT3
-static int ptltrace_on_timeout = 0;
-CFS_MODULE_PARM(ptltrace_on_timeout, "i", int, 0644,
- "dump ptltrace on timeout");
-
-static char *ptltrace_basename = "/tmp/lnet-ptltrace";
-CFS_MODULE_PARM(ptltrace_basename, "s", charp, 0644,
- "ptltrace dump file basename");
-#endif
#ifdef PJK_DEBUGGING
static int simulation_bitmap = 0;
CFS_MODULE_PARM(simulation_bitmap, "i", int, 0444,
.kptl_rxb_npages = &rxb_npages,
.kptl_rxb_nspare = &rxb_nspare,
.kptl_credits = &credits,
- .kptl_peercredits = &peercredits,
+ .kptl_peertxcredits = &peercredits,
+ .kptl_peerrtrcredits = &peer_buffer_credits,
.kptl_max_msg_size = &max_msg_size,
.kptl_peer_hash_table_size = &peer_hash_table_size,
.kptl_reschedule_loops = &reschedule_loops,
.kptl_ack_puts = &ack_puts,
-#ifdef CRAY_XT3
- .kptl_ptltrace_on_timeout = &ptltrace_on_timeout,
- .kptl_ptltrace_basename = &ptltrace_basename,
-#endif
#ifdef PJK_DEBUGGING
.kptl_simulation_bitmap = &simulation_bitmap,
#endif
};
-#if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
-#ifdef CRAY_XT3
-static char ptltrace_basename_space[1024];
+#if defined(CONFIG_SYSCTL) && !CFS_SYSFS_MODULE_PARM
+
+#ifndef HAVE_SYSCTL_UNNUMBERED
+
+enum {
+ KPTLLND_NTX = 1,
+ KPTLLND_MAX_NODES,
+ KPTLLND_MAX_PROC_PER_NODE,
+ KPTLLND_CHECKSUM,
+ KPTLLND_TIMEOUT,
+ KPTLLND_PORTAL,
+ KPTLLND_PID,
+ KPTLLND_RXB_PAGES,
+ KPTLLND_CREDITS,
+ KPTLLND_PEERTXCREDITS,
+ KPTLLND_PEERRTRCREDITS,
+ KPTLLND_MAX_MSG_SIZE,
+ KPTLLND_PEER_HASH_SIZE,
+ KPTLLND_RESHEDULE_LOOPS,
+ KPTLLND_ACK_PUTS,
+ KPTLLND_TRACETIMEOUT,
+ KPTLLND_TRACEFAIL,
+ KPTLLND_TRACEBASENAME,
+ KPTLLND_SIMULATION_BITMAP
+};
+#else
-static void
-kptllnd_init_strtunable(char **str_param, char *space, int size)
-{
- strncpy(space, *str_param, size);
- space[size - 1] = 0;
- *str_param = space;
-}
+#define KPTLLND_NTX CTL_UNNUMBERED
+#define KPTLLND_MAX_NODES CTL_UNNUMBERED
+#define KPTLLND_MAX_PROC_PER_NODE CTL_UNNUMBERED
+#define KPTLLND_CHECKSUM CTL_UNNUMBERED
+#define KPTLLND_TIMEOUT CTL_UNNUMBERED
+#define KPTLLND_PORTAL CTL_UNNUMBERED
+#define KPTLLND_PID CTL_UNNUMBERED
+#define KPTLLND_RXB_PAGES CTL_UNNUMBERED
+#define KPTLLND_CREDITS CTL_UNNUMBERED
+#define KPTLLND_PEERTXCREDITS CTL_UNNUMBERED
+#define KPTLLND_PEERRTRCREDITS CTL_UNNUMBERED
+#define KPTLLND_MAX_MSG_SIZE CTL_UNNUMBERED
+#define KPTLLND_PEER_HASH_SIZE CTL_UNNUMBERED
+#define KPTLLND_RESHEDULE_LOOPS CTL_UNNUMBERED
+#define KPTLLND_ACK_PUTS CTL_UNNUMBERED
+#define KPTLLND_TRACETIMEOUT CTL_UNNUMBERED
+#define KPTLLND_TRACEFAIL CTL_UNNUMBERED
+#define KPTLLND_TRACEBASENAME CTL_UNNUMBERED
+#define KPTLLND_SIMULATION_BITMAP CTL_UNNUMBERED
#endif
static cfs_sysctl_table_t kptllnd_ctl_table[] = {
{
- .ctl_name = 1,
+ .ctl_name = KPTLLND_NTX,
.procname = "ntx",
.data = &ntx,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 2,
+ .ctl_name = KPTLLND_MAX_NODES,
.procname = "max_nodes",
.data = &max_nodes,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 3,
- .procnmae = "max_procs_per_node",
+ .ctl_name = KPTLLND_MAX_PROC_PER_NODE,
+ .procname = "max_procs_per_node",
.data = &max_procs_per_node,
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 4,
+ .ctl_name = KPTLLND_CHECKSUM,
.procname = "checksum",
.data = &checksum,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 5,
+ .ctl_name = KPTLLND_TIMEOUT,
.procname = "timeout",
.data = &timeout,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 6,
+ .ctl_name = KPTLLND_PORTAL,
.procname = "portal",
.data = &portal,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 7,
+ .ctl_name = KPTLLND_PID,
.procname = "pid",
.data = &pid,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 8,
+ .ctl_name = KPTLLND_RXB_PAGES,
.procname = "rxb_npages",
.data = &rxb_npages,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 9,
+ .ctl_name = KPTLLND_CREDITS,
.procname = "credits",
.data = &credits,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 10,
+ .ctl_name = KPTLLND_PEERTXCREDITS,
.procname = "peercredits",
.data = &peercredits,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 11,
+ .ctl_name = KPTLLND_PEERRTRCREDITS,
+ .procname = "peer_buffer_credits",
+ .data = &peer_buffer_credits,
+ .maxlen = sizeof(int),
+ .mode = 0444,
+ .proc_handler = &proc_dointvec
+ },
+ {
+ .ctl_name = KPTLLND_MAX_MSG_SIZE,
.procname = "max_msg_size",
.data = &max_msg_size,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 12,
+ .ctl_name = KPTLLND_PEER_HASH_SIZE,
.procname = "peer_hash_table_size",
.data = &peer_hash_table_size,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 13,
+ .ctl_name = KPTLLND_RESHEDULE_LOOPS,
.procname = "reschedule_loops",
.data = &reschedule_loops,
.maxlen = sizeof(int),
.proc_handler = &proc_dointvec
},
{
- .ctl_name = 14,
+ .ctl_name = KPTLLND_ACK_PUTS,
.procname = "ack_puts",
.data = &ack_puts,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
},
-#ifdef CRAY_XT3
- {
- .ctl_name = 15,
- .procname = "ptltrace_on_timeout",
- .data = &ptltrace_on_timeout,
- .maxlen = sizeof(int),
- .mode = 0644,
- .proc_handler = &proc_dointvec
- },
- {
- .ctl_name = 16,
- .procname = "ptltrace_basename",
- .data = ptltrace_basename_space,
- .maxlen = sizeof(ptltrace_basename_space),
- .mode = 0644,
- .proc_handler = &proc_dostring,
- .strategy = &sysctl_string
- },
-#endif
#ifdef PJK_DEBUGGING
{
- .ctl_name = 17,
+ .ctl_name = KPTLLND_SIMULATION_BITMAP,
.procname = "simulation_bitmap",
.data = &simulation_bitmap,
.maxlen = sizeof(int),
static cfs_sysctl_table_t kptllnd_top_ctl_table[] = {
{
- .ctl_name = 203,
+ .ctl_name = CTL_PTLLND,
.procname = "ptllnd",
.data = NULL,
.maxlen = 0,
int
kptllnd_tunables_init ()
{
-#ifdef CRAY_XT3
- kptllnd_init_strtunable(&ptltrace_basename,
- ptltrace_basename_space,
- sizeof(ptltrace_basename_space));
-#endif
kptllnd_tunables.kptl_sysctl =
cfs_register_sysctl_table(kptllnd_top_ctl_table, 0);
}
#endif
-