1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
5 * Author: Eric Barton <eric@bartonsoftware.com>
7 * Portals is free software; you can redistribute it and/or
8 * modify it under the terms of version 2 of the GNU General Public
9 * License as published by the Free Software Foundation.
11 * Portals is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Portals; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 static int sock_timeout = 50;
24 CFS_MODULE_PARM(sock_timeout, "i", int, 0644,
25 "dead socket timeout (seconds)");
27 static int credits = 256;
28 CFS_MODULE_PARM(credits, "i", int, 0444,
29 "# concurrent sends");
31 static int peer_credits = 8;
32 CFS_MODULE_PARM(peer_credits, "i", int, 0444,
33 "# concurrent sends to 1 peer");
35 static int nconnds = 4;
36 CFS_MODULE_PARM(nconnds, "i", int, 0444,
37 "# connection daemons");
39 static int min_reconnectms = 1000;
40 CFS_MODULE_PARM(min_reconnectms, "i", int, 0644,
41 "min connection retry interval (mS)");
43 static int max_reconnectms = 60000;
44 CFS_MODULE_PARM(max_reconnectms, "i", int, 0644,
45 "max connection retry interval (mS)");
47 #if defined(__APPLE__) && !defined(__DARWIN8__)
48 # define DEFAULT_EAGER_ACK 1
50 # define DEFAULT_EAGER_ACK 0
52 static int eager_ack = DEFAULT_EAGER_ACK;
53 CFS_MODULE_PARM(eager_ack, "i", int, 0644,
54 "send tcp ack packets eagerly");
56 static int typed_conns = 1;
57 CFS_MODULE_PARM(typed_conns, "i", int, 0444,
58 "use different sockets for bulk");
60 static int min_bulk = (1<<10);
61 CFS_MODULE_PARM(min_bulk, "i", int, 0644,
62 "smallest 'large' message");
66 # define DEFAULT_BUFFER_SIZE (224*1024)
68 # define DEFAULT_BUFFER_SIZE (1152 * 1024)
71 # define DEFAULT_BUFFER_SIZE 0
73 static int tx_buffer_size = DEFAULT_BUFFER_SIZE;
74 CFS_MODULE_PARM(tx_buffer_size, "i", int, 0644,
75 "socket tx buffer size (0 for system default)");
77 static int rx_buffer_size = DEFAULT_BUFFER_SIZE;
78 CFS_MODULE_PARM(rx_buffer_size, "i", int, 0644,
79 "socket rx buffer size (0 for system default)");
82 CFS_MODULE_PARM(nagle, "i", int, 0644,
85 static int keepalive_idle = 30;
86 CFS_MODULE_PARM(keepalive_idle, "i", int, 0644,
87 "# idle seconds before probe");
89 #ifdef HAVE_BGL_SUPPORT
90 #define DEFAULT_KEEPALIVE_COUNT 100
92 #define DEFAULT_KEEPALIVE_COUNT 5
94 static int keepalive_count = DEFAULT_KEEPALIVE_COUNT;
95 CFS_MODULE_PARM(keepalive_count, "i", int, 0644,
96 "# missed probes == dead");
98 static int keepalive_intvl = 5;
99 CFS_MODULE_PARM(keepalive_intvl, "i", int, 0644,
100 "seconds between probes");
102 static int enable_csum = 0;
103 CFS_MODULE_PARM(enable_csum, "i", int, 0644,
106 static int inject_csum_error = 0;
107 CFS_MODULE_PARM(inject_csum_error, "i", int, 0644,
108 "set non-zero to inject a checksum error");
110 static int enable_irq_affinity = 1;
111 CFS_MODULE_PARM(enable_irq_affinity, "i", int, 0644,
112 "enable IRQ affinity");
115 static unsigned int zc_min_frag = (2<<10);
116 CFS_MODULE_PARM(zc_min_frag, "i", int, 0644,
117 "minimum fragment to zero copy");
119 #ifdef SOCKNAL_BACKOFF
120 static int backoff_init = 3;
121 CFS_MODULE_PARM(backoff_init, "i", int, 0644,
122 "seconds for initial tcp backoff");
124 static int backoff_max = 3;
125 CFS_MODULE_PARM(backoff_max, "i", int, 0644,
126 "seconds for maximum tcp backoff");
129 #if SOCKNAL_VERSION_DEBUG
130 static int protocol = 2;
131 CFS_MODULE_PARM(protocol, "i", int, 0644,
135 ksock_tunables_t ksocknal_tunables = {
136 .ksnd_timeout = &sock_timeout,
137 .ksnd_credits = &credits,
138 .ksnd_peercredits = &peer_credits,
139 .ksnd_nconnds = &nconnds,
140 .ksnd_min_reconnectms = &min_reconnectms,
141 .ksnd_max_reconnectms = &max_reconnectms,
142 .ksnd_eager_ack = &eager_ack,
143 .ksnd_typed_conns = &typed_conns,
144 .ksnd_min_bulk = &min_bulk,
145 .ksnd_tx_buffer_size = &tx_buffer_size,
146 .ksnd_rx_buffer_size = &rx_buffer_size,
147 .ksnd_nagle = &nagle,
148 .ksnd_keepalive_idle = &keepalive_idle,
149 .ksnd_keepalive_count = &keepalive_count,
150 .ksnd_keepalive_intvl = &keepalive_intvl,
151 .ksnd_enable_csum = &enable_csum,
152 .ksnd_inject_csum_error = &inject_csum_error,
153 .ksnd_zc_min_frag = &zc_min_frag,
155 .ksnd_irq_affinity = &enable_irq_affinity,
157 #ifdef SOCKNAL_BACKOFF
158 .ksnd_backoff_init = &backoff_init,
159 .ksnd_backoff_max = &backoff_max,
161 #if SOCKNAL_VERSION_DEBUG
162 .ksnd_protocol = &protocol,