Whamcloud - gitweb
Landing b_hd_newconfig on HEAD
[fs/lustre-release.git] / lnet / klnds / ralnd / ralnd_modparams.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * Copyright (C) 2004 Cluster File Systems, Inc.
5  *   Author: Eric Barton <eric@bartonsoftware.com>
6  *
7  *   This file is part of Lustre, http://www.lustre.org.
8  *
9  *   Lustre is free software; you can redistribute it and/or
10  *   modify it under the terms of version 2 of the GNU General Public
11  *   License as published by the Free Software Foundation.
12  *
13  *   Lustre is distributed in the hope that it will be useful,
14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *   GNU General Public License for more details.
17  *
18  *   You should have received a copy of the GNU General Public License
19  *   along with Lustre; if not, write to the Free Software
20  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  *
22  */
23
24 #include "ralnd.h"
25
26 static int n_connd = 4;
27 CFS_MODULE_PARM(n_connd, "i", int, 0444,
28                 "# of connection daemons");
29
30 static int min_reconnect_interval = 1;
31 CFS_MODULE_PARM(min_reconnect_interval, "i", int, 0644,
32                 "minimum connection retry interval (seconds)");
33
34 static int max_reconnect_interval = 60;
35 CFS_MODULE_PARM(max_reconnect_interval, "i", int, 0644,
36                 "maximum connection retry interval (seconds)");
37
38 static int ntx = 256;
39 CFS_MODULE_PARM(ntx, "i", int, 0444,
40                 "# of transmit descriptors");
41
42 static int credits = 128;
43 CFS_MODULE_PARM(credits, "i", int, 0444,
44                 "# concurrent sends");
45
46 static int peer_credits = 32;
47 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
48                 "# concurrent sends to 1 peer");
49
50 static int fma_cq_size = 8192;
51 CFS_MODULE_PARM(fma_cq_size, "i", int, 0444,
52                 "size of the completion queue");
53
54 static int timeout = 30;
55 CFS_MODULE_PARM(timeout, "i", int, 0644,
56                 "communications timeout (seconds)");
57
58 static int max_immediate = (2<<10);
59 CFS_MODULE_PARM(max_immediate, "i", int, 0644,
60                 "immediate/RDMA breakpoint");
61
62 kra_tunables_t kranal_tunables = {
63         .kra_n_connd                = &n_connd,
64         .kra_min_reconnect_interval = &min_reconnect_interval,
65         .kra_max_reconnect_interval = &max_reconnect_interval,
66         .kra_ntx                    = &ntx,
67         .kra_credits                = &credits,
68         .kra_peercredits            = &peer_credits,
69         .kra_fma_cq_size            = &fma_cq_size,
70         .kra_timeout                = &timeout,
71         .kra_max_immediate          = &max_immediate,
72 };
73
74 #if CONFIG_SYSCTL && !CFS_SYSFS_MODULE_PARM
75 static ctl_table kranal_ctl_table[] = {
76         {1, "n_connd", &n_connd, 
77          sizeof(int), 0444, NULL, &proc_dointvec},
78         {2, "min_reconnect_interval", &min_reconnect_interval, 
79          sizeof(int), 0644, NULL, &proc_dointvec},
80         {3, "max_reconnect_interval", &max_reconnect_interval, 
81          sizeof(int), 0644, NULL, &proc_dointvec},
82         {4, "ntx", &ntx, 
83          sizeof(int), 0444, NULL, &proc_dointvec},
84         {5, "credits", &credits, 
85          sizeof(int), 0444, NULL, &proc_dointvec},
86         {6, "peer_credits", &peer_credits, 
87          sizeof(int), 0444, NULL, &proc_dointvec},
88         {7, "fma_cq_size", &fma_cq_size, 
89          sizeof(int), 0444, NULL, &proc_dointvec},
90         {8, "timeout", &timeout, 
91          sizeof(int), 0644, NULL, &proc_dointvec},
92         {9, "max_immediate", &max_immediate, 
93          sizeof(int), 0644, NULL, &proc_dointvec},
94         {0}
95 };
96
97 static ctl_table kranal_top_ctl_table[] = {
98         {202, "ranal", NULL, 0, 0555, kranal_ctl_table},
99         {0}
100 };
101
102 int
103 kranal_tunables_init ()
104 {
105         kranal_tunables.kra_sysctl =
106                 register_sysctl_table(kranal_top_ctl_table, 0);
107         
108         if (kranal_tunables.kra_sysctl == NULL)
109                 CWARN("Can't setup /proc tunables\n");
110         
111         return 0;
112 }
113
114 void
115 kranal_tunables_fini ()
116 {
117         if (kranal_tunables.kra_sysctl != NULL)
118                 unregister_sysctl_table(kranal_tunables.kra_sysctl);
119 }
120
121 #else
122
123 int
124 kranal_tunables_init ()
125 {
126         return 0;
127 }
128
129 void
130 kranal_tunables_fini ()
131 {
132 }
133
134 #endif
135