staging/lustre: Remove the "write to FSF to get a copy of GPL" wording
[deliverable/linux.git] / drivers / staging / lustre / lnet / klnds / socklnd / socklnd_modparams.c
CommitLineData
d7e09d03
PT
1/*
2 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
3 *
4 * Copyright (c) 2011, 2012, Intel Corporation.
5 *
6 * Author: Eric Barton <eric@bartonsoftware.com>
7 *
8 * Portals is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
11 *
12 * Portals is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
d7e09d03
PT
17 */
18
19#include "socklnd.h"
20
21static int sock_timeout = 50;
8cc7b4b9
PT
22module_param(sock_timeout, int, 0644);
23MODULE_PARM_DESC(sock_timeout, "dead socket timeout (seconds)");
d7e09d03
PT
24
25static int credits = 256;
8cc7b4b9
PT
26module_param(credits, int, 0444);
27MODULE_PARM_DESC(credits, "# concurrent sends");
d7e09d03
PT
28
29static int peer_credits = 8;
8cc7b4b9
PT
30module_param(peer_credits, int, 0444);
31MODULE_PARM_DESC(peer_credits, "# concurrent sends to 1 peer");
d7e09d03 32
42e7f1df 33static int peer_buffer_credits;
8cc7b4b9
PT
34module_param(peer_buffer_credits, int, 0444);
35MODULE_PARM_DESC(peer_buffer_credits, "# per-peer router buffer credits");
d7e09d03
PT
36
37static int peer_timeout = 180;
8cc7b4b9
PT
38module_param(peer_timeout, int, 0444);
39MODULE_PARM_DESC(peer_timeout, "Seconds without aliveness news to declare peer dead (<=0 to disable)");
d7e09d03 40
4420cfd3
JS
41/*
42 * Number of daemons in each thread pool which is percpt,
43 * we will estimate reasonable value based on CPUs if it's not set.
44 */
d7e09d03 45static unsigned int nscheds;
8cc7b4b9
PT
46module_param(nscheds, int, 0444);
47MODULE_PARM_DESC(nscheds, "# scheduler daemons in each pool while starting");
d7e09d03
PT
48
49static int nconnds = 4;
8cc7b4b9
PT
50module_param(nconnds, int, 0444);
51MODULE_PARM_DESC(nconnds, "# connection daemons while starting");
d7e09d03
PT
52
53static int nconnds_max = 64;
8cc7b4b9
PT
54module_param(nconnds_max, int, 0444);
55MODULE_PARM_DESC(nconnds_max, "max # connection daemons");
d7e09d03
PT
56
57static int min_reconnectms = 1000;
8cc7b4b9
PT
58module_param(min_reconnectms, int, 0644);
59MODULE_PARM_DESC(min_reconnectms, "min connection retry interval (mS)");
d7e09d03
PT
60
61static int max_reconnectms = 60000;
8cc7b4b9
PT
62module_param(max_reconnectms, int, 0644);
63MODULE_PARM_DESC(max_reconnectms, "max connection retry interval (mS)");
d7e09d03
PT
64
65# define DEFAULT_EAGER_ACK 0
66static int eager_ack = DEFAULT_EAGER_ACK;
8cc7b4b9
PT
67module_param(eager_ack, int, 0644);
68MODULE_PARM_DESC(eager_ack, "send tcp ack packets eagerly");
d7e09d03
PT
69
70static int typed_conns = 1;
8cc7b4b9
PT
71module_param(typed_conns, int, 0444);
72MODULE_PARM_DESC(typed_conns, "use different sockets for bulk");
d7e09d03 73
51078e25 74static int min_bulk = 1 << 10;
8cc7b4b9
PT
75module_param(min_bulk, int, 0644);
76MODULE_PARM_DESC(min_bulk, "smallest 'large' message");
d7e09d03
PT
77
78# define DEFAULT_BUFFER_SIZE 0
79static int tx_buffer_size = DEFAULT_BUFFER_SIZE;
8cc7b4b9
PT
80module_param(tx_buffer_size, int, 0644);
81MODULE_PARM_DESC(tx_buffer_size, "socket tx buffer size (0 for system default)");
d7e09d03
PT
82
83static int rx_buffer_size = DEFAULT_BUFFER_SIZE;
8cc7b4b9
PT
84module_param(rx_buffer_size, int, 0644);
85MODULE_PARM_DESC(rx_buffer_size, "socket rx buffer size (0 for system default)");
d7e09d03 86
42e7f1df 87static int nagle;
8cc7b4b9
PT
88module_param(nagle, int, 0644);
89MODULE_PARM_DESC(nagle, "enable NAGLE?");
d7e09d03
PT
90
91static int round_robin = 1;
8cc7b4b9
PT
92module_param(round_robin, int, 0644);
93MODULE_PARM_DESC(round_robin, "Round robin for multiple interfaces");
d7e09d03
PT
94
95static int keepalive = 30;
8cc7b4b9
PT
96module_param(keepalive, int, 0644);
97MODULE_PARM_DESC(keepalive, "# seconds before send keepalive");
d7e09d03
PT
98
99static int keepalive_idle = 30;
8cc7b4b9
PT
100module_param(keepalive_idle, int, 0644);
101MODULE_PARM_DESC(keepalive_idle, "# idle seconds before probe");
d7e09d03
PT
102
103#define DEFAULT_KEEPALIVE_COUNT 5
104static int keepalive_count = DEFAULT_KEEPALIVE_COUNT;
8cc7b4b9
PT
105module_param(keepalive_count, int, 0644);
106MODULE_PARM_DESC(keepalive_count, "# missed probes == dead");
d7e09d03
PT
107
108static int keepalive_intvl = 5;
8cc7b4b9
PT
109module_param(keepalive_intvl, int, 0644);
110MODULE_PARM_DESC(keepalive_intvl, "seconds between probes");
d7e09d03 111
42e7f1df 112static int enable_csum;
8cc7b4b9
PT
113module_param(enable_csum, int, 0644);
114MODULE_PARM_DESC(enable_csum, "enable check sum");
d7e09d03 115
42e7f1df 116static int inject_csum_error;
8cc7b4b9
PT
117module_param(inject_csum_error, int, 0644);
118MODULE_PARM_DESC(inject_csum_error, "set non-zero to inject a checksum error");
d7e09d03
PT
119
120static int nonblk_zcack = 1;
8cc7b4b9
PT
121module_param(nonblk_zcack, int, 0644);
122MODULE_PARM_DESC(nonblk_zcack, "always send ZC-ACK on non-blocking connection");
d7e09d03 123
e21bf338 124static unsigned int zc_min_payload = 16 << 10;
8cc7b4b9
PT
125module_param(zc_min_payload, int, 0644);
126MODULE_PARM_DESC(zc_min_payload, "minimum payload size to zero copy");
d7e09d03 127
42e7f1df 128static unsigned int zc_recv;
8cc7b4b9
PT
129module_param(zc_recv, int, 0644);
130MODULE_PARM_DESC(zc_recv, "enable ZC recv for Chelsio driver");
d7e09d03
PT
131
132static unsigned int zc_recv_min_nfrags = 16;
8cc7b4b9
PT
133module_param(zc_recv_min_nfrags, int, 0644);
134MODULE_PARM_DESC(zc_recv_min_nfrags, "minimum # of fragments to enable ZC recv");
d7e09d03 135
d7e09d03
PT
136#if SOCKNAL_VERSION_DEBUG
137static int protocol = 3;
8cc7b4b9
PT
138module_param(protocol, int, 0644);
139MODULE_PARM_DESC(protocol, "protocol version");
d7e09d03
PT
140#endif
141
142ksock_tunables_t ksocknal_tunables;
143
144int ksocknal_tunables_init(void)
145{
d7e09d03 146 /* initialize ksocknal_tunables structure */
97d10d0a
MS
147 ksocknal_tunables.ksnd_timeout = &sock_timeout;
148 ksocknal_tunables.ksnd_nscheds = &nscheds;
149 ksocknal_tunables.ksnd_nconnds = &nconnds;
150 ksocknal_tunables.ksnd_nconnds_max = &nconnds_max;
d7e09d03
PT
151 ksocknal_tunables.ksnd_min_reconnectms = &min_reconnectms;
152 ksocknal_tunables.ksnd_max_reconnectms = &max_reconnectms;
97d10d0a
MS
153 ksocknal_tunables.ksnd_eager_ack = &eager_ack;
154 ksocknal_tunables.ksnd_typed_conns = &typed_conns;
155 ksocknal_tunables.ksnd_min_bulk = &min_bulk;
d7e09d03
PT
156 ksocknal_tunables.ksnd_tx_buffer_size = &tx_buffer_size;
157 ksocknal_tunables.ksnd_rx_buffer_size = &rx_buffer_size;
97d10d0a
MS
158 ksocknal_tunables.ksnd_nagle = &nagle;
159 ksocknal_tunables.ksnd_round_robin = &round_robin;
160 ksocknal_tunables.ksnd_keepalive = &keepalive;
d7e09d03
PT
161 ksocknal_tunables.ksnd_keepalive_idle = &keepalive_idle;
162 ksocknal_tunables.ksnd_keepalive_count = &keepalive_count;
163 ksocknal_tunables.ksnd_keepalive_intvl = &keepalive_intvl;
97d10d0a 164 ksocknal_tunables.ksnd_credits = &credits;
d7e09d03
PT
165 ksocknal_tunables.ksnd_peertxcredits = &peer_credits;
166 ksocknal_tunables.ksnd_peerrtrcredits = &peer_buffer_credits;
97d10d0a
MS
167 ksocknal_tunables.ksnd_peertimeout = &peer_timeout;
168 ksocknal_tunables.ksnd_enable_csum = &enable_csum;
d7e09d03
PT
169 ksocknal_tunables.ksnd_inject_csum_error = &inject_csum_error;
170 ksocknal_tunables.ksnd_nonblk_zcack = &nonblk_zcack;
171 ksocknal_tunables.ksnd_zc_min_payload = &zc_min_payload;
97d10d0a 172 ksocknal_tunables.ksnd_zc_recv = &zc_recv;
d7e09d03
PT
173 ksocknal_tunables.ksnd_zc_recv_min_nfrags = &zc_recv_min_nfrags;
174
d7e09d03 175#if SOCKNAL_VERSION_DEBUG
97d10d0a 176 ksocknal_tunables.ksnd_protocol = &protocol;
d7e09d03
PT
177#endif
178
d7e09d03 179 if (*ksocknal_tunables.ksnd_zc_min_payload < (2 << 10))
e21bf338 180 *ksocknal_tunables.ksnd_zc_min_payload = 2 << 10;
d7e09d03 181
a05a2e4d 182 return 0;
d7e09d03 183};
This page took 0.304416 seconds and 5 git commands to generate.