xref: /onnv-gate/usr/src/uts/common/inet/sctp/sctp_tunables.c (revision 12016:0248e987199b)
1*12016SGirish.Moodalbail@Sun.COM /*
2*12016SGirish.Moodalbail@Sun.COM  * CDDL HEADER START
3*12016SGirish.Moodalbail@Sun.COM  *
4*12016SGirish.Moodalbail@Sun.COM  * The contents of this file are subject to the terms of the
5*12016SGirish.Moodalbail@Sun.COM  * Common Development and Distribution License (the "License").
6*12016SGirish.Moodalbail@Sun.COM  * You may not use this file except in compliance with the License.
7*12016SGirish.Moodalbail@Sun.COM  *
8*12016SGirish.Moodalbail@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*12016SGirish.Moodalbail@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*12016SGirish.Moodalbail@Sun.COM  * See the License for the specific language governing permissions
11*12016SGirish.Moodalbail@Sun.COM  * and limitations under the License.
12*12016SGirish.Moodalbail@Sun.COM  *
13*12016SGirish.Moodalbail@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*12016SGirish.Moodalbail@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*12016SGirish.Moodalbail@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*12016SGirish.Moodalbail@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*12016SGirish.Moodalbail@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*12016SGirish.Moodalbail@Sun.COM  *
19*12016SGirish.Moodalbail@Sun.COM  * CDDL HEADER END
20*12016SGirish.Moodalbail@Sun.COM  */
21*12016SGirish.Moodalbail@Sun.COM /*
22*12016SGirish.Moodalbail@Sun.COM  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
23*12016SGirish.Moodalbail@Sun.COM  * Use is subject to license terms.
24*12016SGirish.Moodalbail@Sun.COM  */
25*12016SGirish.Moodalbail@Sun.COM 
26*12016SGirish.Moodalbail@Sun.COM #include <inet/ip.h>
27*12016SGirish.Moodalbail@Sun.COM #include <inet/ip6.h>
28*12016SGirish.Moodalbail@Sun.COM #include <inet/sctp/sctp_stack.h>
29*12016SGirish.Moodalbail@Sun.COM #include <inet/sctp/sctp_impl.h>
30*12016SGirish.Moodalbail@Sun.COM #include <sys/sunddi.h>
31*12016SGirish.Moodalbail@Sun.COM 
32*12016SGirish.Moodalbail@Sun.COM /* Max size IP datagram is 64k - 1 */
33*12016SGirish.Moodalbail@Sun.COM #define	SCTP_MSS_MAX_IPV4 (IP_MAXPACKET - (sizeof (ipha_t) + \
34*12016SGirish.Moodalbail@Sun.COM 					sizeof (sctp_hdr_t)))
35*12016SGirish.Moodalbail@Sun.COM #define	SCTP_MSS_MAX_IPV6 (IP_MAXPACKET - (sizeof (ip6_t) + \
36*12016SGirish.Moodalbail@Sun.COM 					sizeof (sctp_hdr_t)))
37*12016SGirish.Moodalbail@Sun.COM /* Max of the above */
38*12016SGirish.Moodalbail@Sun.COM #define	SCTP_MSS_MAX	SCTP_MSS_MAX_IPV4
39*12016SGirish.Moodalbail@Sun.COM 
40*12016SGirish.Moodalbail@Sun.COM /*
41*12016SGirish.Moodalbail@Sun.COM  * All of these are alterable, within the min/max values given, at run time.
42*12016SGirish.Moodalbail@Sun.COM  *
43*12016SGirish.Moodalbail@Sun.COM  * Note: All those tunables which do not start with "sctp_" are Committed and
44*12016SGirish.Moodalbail@Sun.COM  * therefore are public. See PSARC 2009/306.
45*12016SGirish.Moodalbail@Sun.COM  */
46*12016SGirish.Moodalbail@Sun.COM mod_prop_info_t sctp_propinfo_tbl[] = {
47*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_max_init_retr", MOD_PROTO_SCTP,
48*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
49*12016SGirish.Moodalbail@Sun.COM 	    {0, 128, 8}, {8} },
50*12016SGirish.Moodalbail@Sun.COM 
51*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_pa_max_retr", MOD_PROTO_SCTP,
52*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
53*12016SGirish.Moodalbail@Sun.COM 	    {1, 128, 10}, {10} },
54*12016SGirish.Moodalbail@Sun.COM 
55*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_pp_max_retr", MOD_PROTO_SCTP,
56*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
57*12016SGirish.Moodalbail@Sun.COM 	    {1, 128, 5}, {5} },
58*12016SGirish.Moodalbail@Sun.COM 
59*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_cwnd_max", MOD_PROTO_SCTP,
60*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
61*12016SGirish.Moodalbail@Sun.COM 	    {128, (1<<30), 1024*1024}, {1024*1024} },
62*12016SGirish.Moodalbail@Sun.COM 
63*12016SGirish.Moodalbail@Sun.COM 	{ "smallest_nonpriv_port", MOD_PROTO_SCTP,
64*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
65*12016SGirish.Moodalbail@Sun.COM 	    {1024, (32*1024), 1024}, {1024} },
66*12016SGirish.Moodalbail@Sun.COM 
67*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_ipv4_ttl", MOD_PROTO_SCTP,
68*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
69*12016SGirish.Moodalbail@Sun.COM 	    {1, 255, 64}, {64} },
70*12016SGirish.Moodalbail@Sun.COM 
71*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_heartbeat_interval", MOD_PROTO_SCTP,
72*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
73*12016SGirish.Moodalbail@Sun.COM 	    {0, 1*DAYS, 30*SECONDS}, {30*SECONDS} },
74*12016SGirish.Moodalbail@Sun.COM 
75*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_initial_mtu", MOD_PROTO_SCTP,
76*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
77*12016SGirish.Moodalbail@Sun.COM 	    {68, 65535, 1500}, {1500} },
78*12016SGirish.Moodalbail@Sun.COM 
79*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_mtu_probe_interval", MOD_PROTO_SCTP,
80*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
81*12016SGirish.Moodalbail@Sun.COM 	    {0, 1*DAYS, 10*MINUTES}, {10*MINUTES} },
82*12016SGirish.Moodalbail@Sun.COM 
83*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_new_secret_interval", MOD_PROTO_SCTP,
84*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
85*12016SGirish.Moodalbail@Sun.COM 	    {0, 1*DAYS, 2*MINUTES}, {2*MINUTES} },
86*12016SGirish.Moodalbail@Sun.COM 
87*12016SGirish.Moodalbail@Sun.COM 	/* tunable - 10 */
88*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_deferred_ack_interval", MOD_PROTO_SCTP,
89*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
90*12016SGirish.Moodalbail@Sun.COM 	    {10*MS, 1*MINUTES, 100*MS}, {100*MS} },
91*12016SGirish.Moodalbail@Sun.COM 
92*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_snd_lowat_fraction", MOD_PROTO_SCTP,
93*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
94*12016SGirish.Moodalbail@Sun.COM 	    {0, 16, 0}, {0} },
95*12016SGirish.Moodalbail@Sun.COM 
96*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_ignore_path_mtu", MOD_PROTO_SCTP,
97*12016SGirish.Moodalbail@Sun.COM 	    mod_set_boolean, mod_get_boolean,
98*12016SGirish.Moodalbail@Sun.COM 	    {B_FALSE}, {B_FALSE} },
99*12016SGirish.Moodalbail@Sun.COM 
100*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_initial_ssthresh", MOD_PROTO_SCTP,
101*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
102*12016SGirish.Moodalbail@Sun.COM 	    {1024, UINT32_MAX, SCTP_RECV_HIWATER}, { SCTP_RECV_HIWATER} },
103*12016SGirish.Moodalbail@Sun.COM 
104*12016SGirish.Moodalbail@Sun.COM 	{ "smallest_anon_port", MOD_PROTO_SCTP,
105*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
106*12016SGirish.Moodalbail@Sun.COM 	    {1024, ULP_MAX_PORT, 32*1024}, {32*1024} },
107*12016SGirish.Moodalbail@Sun.COM 
108*12016SGirish.Moodalbail@Sun.COM 	{ "largest_anon_port", MOD_PROTO_SCTP,
109*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
110*12016SGirish.Moodalbail@Sun.COM 	    {1024, ULP_MAX_PORT, ULP_MAX_PORT}, {ULP_MAX_PORT} },
111*12016SGirish.Moodalbail@Sun.COM 
112*12016SGirish.Moodalbail@Sun.COM 	{ "send_maxbuf", MOD_PROTO_SCTP,
113*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
114*12016SGirish.Moodalbail@Sun.COM 	    {SCTP_XMIT_LOWATER,  (1<<30),  SCTP_XMIT_HIWATER},
115*12016SGirish.Moodalbail@Sun.COM 	    {SCTP_XMIT_HIWATER} },
116*12016SGirish.Moodalbail@Sun.COM 
117*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_xmit_lowat", MOD_PROTO_SCTP,
118*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
119*12016SGirish.Moodalbail@Sun.COM 	    {SCTP_XMIT_LOWATER,  (1<<30),  SCTP_XMIT_LOWATER},
120*12016SGirish.Moodalbail@Sun.COM 	    {SCTP_XMIT_LOWATER} },
121*12016SGirish.Moodalbail@Sun.COM 
122*12016SGirish.Moodalbail@Sun.COM 	{ "recv_maxbuf", MOD_PROTO_SCTP,
123*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
124*12016SGirish.Moodalbail@Sun.COM 	    {SCTP_RECV_LOWATER,  (1<<30),  SCTP_RECV_HIWATER},
125*12016SGirish.Moodalbail@Sun.COM 	    {SCTP_RECV_HIWATER} },
126*12016SGirish.Moodalbail@Sun.COM 
127*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_max_buf", MOD_PROTO_SCTP,
128*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
129*12016SGirish.Moodalbail@Sun.COM 	    {8192, (1<<30), 1024*1024}, {1024*1024} },
130*12016SGirish.Moodalbail@Sun.COM 
131*12016SGirish.Moodalbail@Sun.COM 	/* tunable - 20 */
132*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_rtt_updates", MOD_PROTO_SCTP,
133*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
134*12016SGirish.Moodalbail@Sun.COM 	    {0, 65536, 20}, {20} },
135*12016SGirish.Moodalbail@Sun.COM 
136*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_ipv6_hoplimit", MOD_PROTO_SCTP,
137*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
138*12016SGirish.Moodalbail@Sun.COM 	    {0, IPV6_MAX_HOPS, IPV6_DEFAULT_HOPS}, {IPV6_DEFAULT_HOPS} },
139*12016SGirish.Moodalbail@Sun.COM 
140*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_rto_min", MOD_PROTO_SCTP,
141*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
142*12016SGirish.Moodalbail@Sun.COM 	    {500*MS, 60*SECONDS, 1*SECONDS}, {1*SECONDS} },
143*12016SGirish.Moodalbail@Sun.COM 
144*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_rto_max", MOD_PROTO_SCTP,
145*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
146*12016SGirish.Moodalbail@Sun.COM 	    {1*SECONDS, 60000*SECONDS, 60*SECONDS}, {60*SECONDS} },
147*12016SGirish.Moodalbail@Sun.COM 
148*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_rto_initial", MOD_PROTO_SCTP,
149*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
150*12016SGirish.Moodalbail@Sun.COM 	    {1*SECONDS, 60000*SECONDS, 3*SECONDS}, {3*SECONDS} },
151*12016SGirish.Moodalbail@Sun.COM 
152*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_cookie_life", MOD_PROTO_SCTP,
153*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
154*12016SGirish.Moodalbail@Sun.COM 	    {10*MS, 60000*SECONDS, 60*SECONDS}, {60*SECONDS} },
155*12016SGirish.Moodalbail@Sun.COM 
156*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_max_in_streams", MOD_PROTO_SCTP,
157*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
158*12016SGirish.Moodalbail@Sun.COM 	    {1, UINT16_MAX, 32}, {32} },
159*12016SGirish.Moodalbail@Sun.COM 
160*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_initial_out_streams", MOD_PROTO_SCTP,
161*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
162*12016SGirish.Moodalbail@Sun.COM 	    {1, UINT16_MAX, 32}, {32} },
163*12016SGirish.Moodalbail@Sun.COM 
164*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_shutack_wait_bound", MOD_PROTO_SCTP,
165*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
166*12016SGirish.Moodalbail@Sun.COM 	    {0, 300*SECONDS, 60*SECONDS}, {60*SECONDS} },
167*12016SGirish.Moodalbail@Sun.COM 
168*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_maxburst", MOD_PROTO_SCTP,
169*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
170*12016SGirish.Moodalbail@Sun.COM 	    {2, 8, 4}, {4} },
171*12016SGirish.Moodalbail@Sun.COM 
172*12016SGirish.Moodalbail@Sun.COM 	/* tunable - 30 */
173*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_addip_enabled", MOD_PROTO_SCTP,
174*12016SGirish.Moodalbail@Sun.COM 	    mod_set_boolean, mod_get_boolean,
175*12016SGirish.Moodalbail@Sun.COM 	    {B_FALSE}, {B_FALSE} },
176*12016SGirish.Moodalbail@Sun.COM 
177*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_recv_hiwat_minmss", MOD_PROTO_SCTP,
178*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
179*12016SGirish.Moodalbail@Sun.COM 	    {1, 65536, 4}, {4} },
180*12016SGirish.Moodalbail@Sun.COM 
181*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_slow_start_initial", MOD_PROTO_SCTP,
182*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
183*12016SGirish.Moodalbail@Sun.COM 	    {1, 16, 4}, {4} },
184*12016SGirish.Moodalbail@Sun.COM 
185*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_slow_start_after_idle", MOD_PROTO_SCTP,
186*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
187*12016SGirish.Moodalbail@Sun.COM 	    {1, 16384, 4}, {4} },
188*12016SGirish.Moodalbail@Sun.COM 
189*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_prsctp_enabled", MOD_PROTO_SCTP,
190*12016SGirish.Moodalbail@Sun.COM 	    mod_set_boolean, mod_get_boolean,
191*12016SGirish.Moodalbail@Sun.COM 	    {B_TRUE}, {B_TRUE} },
192*12016SGirish.Moodalbail@Sun.COM 
193*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_fast_rxt_thresh", MOD_PROTO_SCTP,
194*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
195*12016SGirish.Moodalbail@Sun.COM 	    {1, 10000, 3}, {3} },
196*12016SGirish.Moodalbail@Sun.COM 
197*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_deferred_acks_max", MOD_PROTO_SCTP,
198*12016SGirish.Moodalbail@Sun.COM 	    mod_set_uint32, mod_get_uint32,
199*12016SGirish.Moodalbail@Sun.COM 	    { 1, 16, 2}, {2} },
200*12016SGirish.Moodalbail@Sun.COM 
201*12016SGirish.Moodalbail@Sun.COM 	/*
202*12016SGirish.Moodalbail@Sun.COM 	 * sctp_wroff_xtra is the extra space in front of SCTP/IP header
203*12016SGirish.Moodalbail@Sun.COM 	 * for link layer header.  It has to be a multiple of 8.
204*12016SGirish.Moodalbail@Sun.COM 	 */
205*12016SGirish.Moodalbail@Sun.COM 	{ "sctp_wroff_xtra", MOD_PROTO_SCTP,
206*12016SGirish.Moodalbail@Sun.COM 	    mod_set_aligned, mod_get_uint32,
207*12016SGirish.Moodalbail@Sun.COM 	    {0, 256, 32}, {32} },
208*12016SGirish.Moodalbail@Sun.COM 
209*12016SGirish.Moodalbail@Sun.COM 	{ "extra_priv_ports", MOD_PROTO_SCTP,
210*12016SGirish.Moodalbail@Sun.COM 	    mod_set_extra_privports, mod_get_extra_privports,
211*12016SGirish.Moodalbail@Sun.COM 	    {1, ULP_MAX_PORT, 0}, {0} },
212*12016SGirish.Moodalbail@Sun.COM 
213*12016SGirish.Moodalbail@Sun.COM 	{ "?", MOD_PROTO_SCTP, NULL, mod_get_allprop, {0}, {0} },
214*12016SGirish.Moodalbail@Sun.COM 
215*12016SGirish.Moodalbail@Sun.COM 	{ NULL, 0, NULL, NULL, {0}, {0} }
216*12016SGirish.Moodalbail@Sun.COM };
217*12016SGirish.Moodalbail@Sun.COM 
218*12016SGirish.Moodalbail@Sun.COM int sctp_propinfo_count = A_CNT(sctp_propinfo_tbl);
219