Print this page
3942 inject sanity into ipadm tcp buffer size properties
3943 _snd_lowat_fraction tcp tunable has no effect
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Peng Dai <peng.dai@delphix.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/inet/tcp_impl.h
+++ new/usr/src/uts/common/inet/tcp_impl.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 * Copyright (c) 2011, Joyent Inc. All rights reserved.
24 24 * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
25 + * Copyright (c) 2013 by Delphix. All rights reserved.
25 26 */
26 27
27 28 #ifndef _INET_TCP_IMPL_H
28 29 #define _INET_TCP_IMPL_H
29 30
30 31 /*
31 32 * TCP implementation private declarations. These interfaces are
32 33 * used to build the IP module and are not meant to be accessed
33 34 * by any modules except IP itself. They are undocumented and are
34 35 * subject to change without notice.
35 36 */
36 37
37 38 #ifdef __cplusplus
38 39 extern "C" {
39 40 #endif
40 41
41 42 #ifdef _KERNEL
42 43
43 44 #include <sys/cpuvar.h>
44 45 #include <sys/clock_impl.h> /* For LBOLT_FASTPATH{,64} */
45 46 #include <inet/optcom.h>
46 47 #include <inet/tcp.h>
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
47 48 #include <inet/tunables.h>
48 49
49 50 #define TCP_MOD_ID 5105
50 51
51 52 extern struct qinit tcp_sock_winit;
52 53 extern struct qinit tcp_winit;
53 54
54 55 extern sock_downcalls_t sock_tcp_downcalls;
55 56
56 57 /*
58 + * Note that by default, the _snd_lowat_fraction tunable controls the value of
59 + * the transmit low water mark. TCP_XMIT_LOWATER (and thus the _xmit_lowat
60 + * property) is only used if the administrator has disabled _snd_lowat_fraction
61 + * by setting it to 0.
62 + */
63 +#define TCP_XMIT_LOWATER 4096
64 +#define TCP_XMIT_HIWATER 49152
65 +#define TCP_RECV_LOWATER 2048
66 +#define TCP_RECV_HIWATER 128000
67 +
68 +/*
57 69 * Bind hash list size and has function. It has to be a power of 2 for
58 70 * hashing.
59 71 */
60 72 #define TCP_BIND_FANOUT_SIZE 1024
61 73 #define TCP_BIND_HASH(lport) (ntohs(lport) & (TCP_BIND_FANOUT_SIZE - 1))
62 74
63 75 /*
64 76 * This implementation follows the 4.3BSD interpretation of the urgent
65 77 * pointer and not RFC 1122. Switching to RFC 1122 behavior would cause
66 78 * incompatible changes in protocols like telnet and rlogin.
67 79 */
68 80 #define TCP_OLD_URP_INTERPRETATION 1
69 81
70 82 /* TCP option length */
71 83 #define TCPOPT_NOP_LEN 1
72 84 #define TCPOPT_MAXSEG_LEN 4
73 85 #define TCPOPT_WS_LEN 3
74 86 #define TCPOPT_REAL_WS_LEN (TCPOPT_WS_LEN+1)
75 87 #define TCPOPT_TSTAMP_LEN 10
76 88 #define TCPOPT_REAL_TS_LEN (TCPOPT_TSTAMP_LEN+2)
77 89 #define TCPOPT_SACK_OK_LEN 2
78 90 #define TCPOPT_REAL_SACK_OK_LEN (TCPOPT_SACK_OK_LEN+2)
79 91 #define TCPOPT_REAL_SACK_LEN 4
80 92 #define TCPOPT_MAX_SACK_LEN 36
81 93 #define TCPOPT_HEADER_LEN 2
82 94
83 95 /* Round up the value to the nearest mss. */
84 96 #define MSS_ROUNDUP(value, mss) ((((value) - 1) / (mss) + 1) * (mss))
85 97
86 98 /*
87 99 * Was this tcp created via socket() interface?
88 100 */
89 101 #define TCP_IS_SOCKET(tcp) ((tcp)->tcp_issocket)
90 102
91 103 /*
92 104 * Is this tcp not attached to any upper client?
93 105 */
94 106 #define TCP_IS_DETACHED(tcp) ((tcp)->tcp_detached)
95 107
96 108 /* TCP timers related data strucutres. Refer to tcp_timers.c. */
97 109 typedef struct tcp_timer_s {
98 110 conn_t *connp;
99 111 void (*tcpt_proc)(void *);
100 112 callout_id_t tcpt_tid;
101 113 } tcp_timer_t;
102 114
103 115 extern kmem_cache_t *tcp_timercache;
104 116
105 117 /*
106 118 * Macro for starting various timers. Retransmission timer has its own macro,
107 119 * TCP_TIMER_RESTART(). tim is in millisec.
108 120 */
109 121 #define TCP_TIMER(tcp, f, tim) \
110 122 tcp_timeout(tcp->tcp_connp, f, tim)
111 123 #define TCP_TIMER_CANCEL(tcp, id) \
112 124 tcp_timeout_cancel(tcp->tcp_connp, id)
113 125
114 126 /*
115 127 * To restart the TCP retransmission timer. intvl is in millisec.
116 128 */
117 129 #define TCP_TIMER_RESTART(tcp, intvl) { \
118 130 if ((tcp)->tcp_timer_tid != 0) \
119 131 (void) TCP_TIMER_CANCEL((tcp), (tcp)->tcp_timer_tid); \
120 132 (tcp)->tcp_timer_tid = TCP_TIMER((tcp), tcp_timer, (intvl)); \
121 133 }
122 134
123 135 /*
124 136 * For scalability, we must not run a timer for every TCP connection
125 137 * in TIME_WAIT state. To see why, consider (for time wait interval of
126 138 * 1 minutes):
127 139 * 10,000 connections/sec * 60 seconds/time wait = 600,000 active conn's
128 140 *
129 141 * This list is ordered by time, so you need only delete from the head
130 142 * until you get to entries which aren't old enough to delete yet.
131 143 * The list consists of only the detached TIME_WAIT connections.
132 144 *
133 145 * When a tcp_t enters TIME_WAIT state, a timer is started (timeout is
134 146 * tcps_time_wait_interval). When the tcp_t is detached (upper layer closes
135 147 * the end point), it is moved to the time wait list and another timer is
136 148 * started (expiry time is set at tcp_time_wait_expire, which is
137 149 * also calculated using tcps_time_wait_interval). This means that the
138 150 * TIME_WAIT state can be extended (up to doubled) if the tcp_t doesn't
139 151 * become detached for a long time.
140 152 *
141 153 * The list manipulations (including tcp_time_wait_next/prev)
142 154 * are protected by the tcp_time_wait_lock. The content of the
143 155 * detached TIME_WAIT connections is protected by the normal perimeters.
144 156 *
145 157 * This list is per squeue and squeues are shared across the tcp_stack_t's.
146 158 * Things on tcp_time_wait_head remain associated with the tcp_stack_t
147 159 * and conn_netstack.
148 160 * The tcp_t's that are added to tcp_free_list are disassociated and
149 161 * have NULL tcp_tcps and conn_netstack pointers.
150 162 */
151 163 typedef struct tcp_squeue_priv_s {
152 164 kmutex_t tcp_time_wait_lock;
153 165 callout_id_t tcp_time_wait_tid;
154 166 tcp_t *tcp_time_wait_head;
155 167 tcp_t *tcp_time_wait_tail;
156 168 tcp_t *tcp_free_list;
157 169 uint_t tcp_free_list_cnt;
158 170 #ifdef DEBUG
159 171 /*
160 172 * For debugging purpose, true when tcp_time_wait_collector() is
161 173 * running.
162 174 */
163 175 boolean_t tcp_time_wait_running;
164 176 #endif
165 177 } tcp_squeue_priv_t;
166 178
167 179 /*
168 180 * Parameters for TCP Initial Send Sequence number (ISS) generation. When
169 181 * tcp_strong_iss is set to 1, which is the default, the ISS is calculated
170 182 * by adding three components: a time component which grows by 1 every 4096
171 183 * nanoseconds (versus every 4 microseconds suggested by RFC 793, page 27);
172 184 * a per-connection component which grows by 125000 for every new connection;
173 185 * and an "extra" component that grows by a random amount centered
174 186 * approximately on 64000. This causes the ISS generator to cycle every
175 187 * 4.89 hours if no TCP connections are made, and faster if connections are
176 188 * made.
177 189 *
178 190 * When tcp_strong_iss is set to 0, ISS is calculated by adding two
179 191 * components: a time component which grows by 250000 every second; and
180 192 * a per-connection component which grows by 125000 for every new connections.
181 193 *
182 194 * A third method, when tcp_strong_iss is set to 2, for generating ISS is
183 195 * prescribed by Steve Bellovin. This involves adding time, the 125000 per
184 196 * connection, and a one-way hash (MD5) of the connection ID <sport, dport,
185 197 * src, dst>, a "truly" random (per RFC 1750) number, and a console-entered
186 198 * password.
187 199 */
188 200 #define ISS_INCR 250000
189 201 #define ISS_NSEC_SHT 12
190 202
191 203 /* Macros for timestamp comparisons */
192 204 #define TSTMP_GEQ(a, b) ((int32_t)((a)-(b)) >= 0)
193 205 #define TSTMP_LT(a, b) ((int32_t)((a)-(b)) < 0)
194 206
195 207 /*
196 208 * Initialize cwnd according to RFC 3390. def_max_init_cwnd is
197 209 * either tcp_slow_start_initial or tcp_slow_start_after idle
198 210 * depending on the caller. If the upper layer has not used the
199 211 * TCP_INIT_CWND option to change the initial cwnd, tcp_init_cwnd
200 212 * should be 0 and we use the formula in RFC 3390 to set tcp_cwnd.
201 213 * If the upper layer has changed set the tcp_init_cwnd, just use
202 214 * it to calculate the tcp_cwnd.
203 215 *
204 216 * "An Argument for Increasing TCP's Initial Congestion Window"
205 217 * ACM SIGCOMM Computer Communications Review, vol. 40 (2010), pp. 27-33
206 218 * -- Nandita Dukkipati, Tiziana Refice, Yuchung Cheng,
207 219 * Hsiao-keng Jerry Chu, Tom Herbert, Amit Agarwal,
208 220 * Arvind Jain, Natalia Sutin
209 221 *
210 222 * "Based on the results from our experiments, we believe the
211 223 * initial congestion window should be at least ten segments
212 224 * and the same be investigated for standardization by the IETF."
213 225 *
214 226 * As such, the def_max_init_cwnd argument with which this macro is
215 227 * invoked is either the tcps_slow_start_initial or
216 228 * tcps_slow_start_after_idle which both default to 0 and will respect
217 229 * RFC 3390 exactly. If the tunables are explicitly set by the operator,
218 230 * then the initial congestion window should be set as the operator
219 231 * demands, within reason. We shall arbitrarily define reason as a
220 232 * maximum of 16 (same as used by the TCP_INIT_CWND setsockopt).
221 233 */
222 234
223 235 /* Maximum TCP initial cwin (start/restart). */
224 236 #define TCP_MAX_INIT_CWND 16
225 237
226 238 #define TCP_SET_INIT_CWND(tcp, mss, def_max_init_cwnd) \
227 239 { \
228 240 if ((tcp)->tcp_init_cwnd == 0) { \
229 241 if (def_max_init_cwnd == 0) { \
230 242 (tcp)->tcp_cwnd = MIN(4 * (mss), \
231 243 MAX(2 * (mss), 4380 / (mss) * (mss))); \
232 244 } else { \
233 245 (tcp)->tcp_cwnd = MIN(TCP_MAX_INIT_CWND * (mss),\
234 246 def_max_init_cwnd * (mss)); \
235 247 } \
236 248 } else { \
237 249 (tcp)->tcp_cwnd = (tcp)->tcp_init_cwnd * (mss); \
238 250 } \
239 251 tcp->tcp_cwnd_cnt = 0; \
240 252 }
241 253
242 254 /*
243 255 * Set ECN capable transport (ECT) code point in IP header.
244 256 *
245 257 * Note that there are 2 ECT code points '01' and '10', which are called
246 258 * ECT(1) and ECT(0) respectively. Here we follow the original ECT code
247 259 * point ECT(0) for TCP as described in RFC 2481.
248 260 */
249 261 #define TCP_SET_ECT(tcp, iph) \
250 262 if ((tcp)->tcp_connp->conn_ipversion == IPV4_VERSION) { \
251 263 /* We need to clear the code point first. */ \
252 264 ((ipha_t *)(iph))->ipha_type_of_service &= 0xFC; \
253 265 ((ipha_t *)(iph))->ipha_type_of_service |= IPH_ECN_ECT0; \
254 266 } else { \
255 267 ((ip6_t *)(iph))->ip6_vcf &= htonl(0xFFCFFFFF); \
256 268 ((ip6_t *)(iph))->ip6_vcf |= htonl(IPH_ECN_ECT0 << 20); \
257 269 }
258 270
259 271 /*
260 272 * Set tcp_rto with boundary checking.
261 273 */
262 274 #define TCP_SET_RTO(tcp, rto) \
263 275 if ((rto) < (tcp)->tcp_rto_min) \
264 276 (tcp)->tcp_rto = (tcp)->tcp_rto_min; \
265 277 else if ((rto) > (tcp)->tcp_rto_max) \
266 278 (tcp)->tcp_rto = (tcp)->tcp_rto_max; \
267 279 else \
268 280 (tcp)->tcp_rto = (rto);
269 281
270 282 /*
271 283 * TCP options struct returned from tcp_parse_options.
272 284 */
273 285 typedef struct tcp_opt_s {
274 286 uint32_t tcp_opt_mss;
275 287 uint32_t tcp_opt_wscale;
276 288 uint32_t tcp_opt_ts_val;
277 289 uint32_t tcp_opt_ts_ecr;
278 290 tcp_t *tcp;
279 291 } tcp_opt_t;
280 292
281 293 /*
282 294 * Write-side flow-control is implemented via the per instance STREAMS
283 295 * write-side Q by explicitly setting QFULL to stop the flow of mblk_t(s)
284 296 * and clearing QFULL and calling qbackenable() to restart the flow based
285 297 * on the number of TCP unsent bytes (i.e. those not on the wire waiting
286 298 * for a remote ACK).
287 299 *
288 300 * This is different than a standard STREAMS kmod which when using the
289 301 * STREAMS Q the framework would automatictly flow-control based on the
290 302 * defined hiwat/lowat values as mblk_t's are enqueued/dequeued.
291 303 *
292 304 * As of FireEngine TCP write-side flow-control needs to take into account
293 305 * both the unsent tcp_xmit list bytes but also any squeue_t enqueued bytes
294 306 * (i.e. from tcp_wput() -> tcp_output()).
295 307 *
296 308 * This is accomplished by adding a new tcp_t fields, tcp_squeue_bytes, to
297 309 * count the number of bytes enqueued by tcp_wput() and the number of bytes
298 310 * dequeued and processed by tcp_output().
299 311 *
300 312 * So, the total number of bytes unsent is (squeue_bytes + unsent) with all
301 313 * flow-control uses of unsent replaced with the macro TCP_UNSENT_BYTES.
302 314 */
303 315 extern void tcp_clrqfull(tcp_t *);
304 316 extern void tcp_setqfull(tcp_t *);
305 317
306 318 #define TCP_UNSENT_BYTES(tcp) \
307 319 ((tcp)->tcp_squeue_bytes + (tcp)->tcp_unsent)
308 320
309 321 /*
310 322 * Linked list struct to store listener connection limit configuration per
311 323 * IP stack. The list is stored at tcps_listener_conf in tcp_stack_t.
312 324 *
313 325 * tl_port: the listener port of this limit configuration
314 326 * tl_ratio: the maximum amount of memory consumed by all concurrent TCP
315 327 * connections created by a listener does not exceed 1/tl_ratio
316 328 * of the total system memory. Note that this is only an
317 329 * approximation.
318 330 * tl_link: linked list struct
319 331 */
320 332 typedef struct tcp_listener_s {
321 333 in_port_t tl_port;
322 334 uint32_t tl_ratio;
323 335 list_node_t tl_link;
324 336 } tcp_listener_t;
325 337
326 338 /*
327 339 * If there is a limit set on the number of connections allowed per each
328 340 * listener, the following struct is used to store that counter. It keeps
329 341 * the number of TCP connection created by a listener. Note that this needs
330 342 * to be separated from the listener since the listener can go away before
331 343 * all the connections are gone.
332 344 *
333 345 * When the struct is allocated, tlc_cnt is set to 1. When a new connection
334 346 * is created by the listener, tlc_cnt is incremented by 1. When a connection
335 347 * created by the listener goes away, tlc_count is decremented by 1. When the
336 348 * listener itself goes away, tlc_cnt is decremented by one. The last
337 349 * connection (or the listener) which decrements tlc_cnt to zero frees the
338 350 * struct.
339 351 *
340 352 * tlc_max is the maximum number of concurrent TCP connections created from a
341 353 * listner. It is calculated when the tcp_listen_cnt_t is allocated.
342 354 *
343 355 * tlc_report_time stores the time when cmn_err() is called to report that the
344 356 * max has been exceeeded. Report is done at most once every
345 357 * TCP_TLC_REPORT_INTERVAL mins for a listener.
346 358 *
347 359 * tlc_drop stores the number of connection attempt dropped because the
348 360 * limit has reached.
349 361 */
350 362 typedef struct tcp_listen_cnt_s {
351 363 uint32_t tlc_max;
352 364 uint32_t tlc_cnt;
353 365 int64_t tlc_report_time;
354 366 uint32_t tlc_drop;
355 367 } tcp_listen_cnt_t;
356 368
357 369 #define TCP_TLC_REPORT_INTERVAL (30 * MINUTES)
358 370
359 371 #define TCP_DECR_LISTEN_CNT(tcp) \
360 372 { \
361 373 ASSERT((tcp)->tcp_listen_cnt->tlc_cnt > 0); \
362 374 if (atomic_add_32_nv(&(tcp)->tcp_listen_cnt->tlc_cnt, -1) == 0) \
363 375 kmem_free((tcp)->tcp_listen_cnt, sizeof (tcp_listen_cnt_t)); \
364 376 (tcp)->tcp_listen_cnt = NULL; \
365 377 }
366 378
367 379 /* Increment and decrement the number of connections in tcp_stack_t. */
368 380 #define TCPS_CONN_INC(tcps) \
369 381 atomic_inc_64( \
370 382 (uint64_t *)&(tcps)->tcps_sc[CPU->cpu_seqid]->tcp_sc_conn_cnt)
371 383
372 384 #define TCPS_CONN_DEC(tcps) \
373 385 atomic_dec_64( \
374 386 (uint64_t *)&(tcps)->tcps_sc[CPU->cpu_seqid]->tcp_sc_conn_cnt)
375 387
376 388 /*
377 389 * When the system is under memory pressure, stack variable tcps_reclaim is
378 390 * true, we shorten the connection timeout abort interval to tcp_early_abort
379 391 * seconds. Defined in tcp.c.
380 392 */
381 393 extern uint32_t tcp_early_abort;
382 394
383 395 /*
384 396 * To reach to an eager in Q0 which can be dropped due to an incoming
385 397 * new SYN request when Q0 is full, a new doubly linked list is
386 398 * introduced. This list allows to select an eager from Q0 in O(1) time.
387 399 * This is needed to avoid spending too much time walking through the
388 400 * long list of eagers in Q0 when tcp_drop_q0() is called. Each member of
389 401 * this new list has to be a member of Q0.
390 402 * This list is headed by listener's tcp_t. When the list is empty,
391 403 * both the pointers - tcp_eager_next_drop_q0 and tcp_eager_prev_drop_q0,
392 404 * of listener's tcp_t point to listener's tcp_t itself.
393 405 *
394 406 * Given an eager in Q0 and a listener, MAKE_DROPPABLE() puts the eager
395 407 * in the list. MAKE_UNDROPPABLE() takes the eager out of the list.
396 408 * These macros do not affect the eager's membership to Q0.
397 409 */
398 410 #define MAKE_DROPPABLE(listener, eager) \
399 411 if ((eager)->tcp_eager_next_drop_q0 == NULL) { \
400 412 (listener)->tcp_eager_next_drop_q0->tcp_eager_prev_drop_q0\
401 413 = (eager); \
402 414 (eager)->tcp_eager_prev_drop_q0 = (listener); \
403 415 (eager)->tcp_eager_next_drop_q0 = \
404 416 (listener)->tcp_eager_next_drop_q0; \
405 417 (listener)->tcp_eager_next_drop_q0 = (eager); \
406 418 }
407 419
408 420 #define MAKE_UNDROPPABLE(eager) \
409 421 if ((eager)->tcp_eager_next_drop_q0 != NULL) { \
410 422 (eager)->tcp_eager_next_drop_q0->tcp_eager_prev_drop_q0 \
411 423 = (eager)->tcp_eager_prev_drop_q0; \
412 424 (eager)->tcp_eager_prev_drop_q0->tcp_eager_next_drop_q0 \
413 425 = (eager)->tcp_eager_next_drop_q0; \
414 426 (eager)->tcp_eager_prev_drop_q0 = NULL; \
415 427 (eager)->tcp_eager_next_drop_q0 = NULL; \
416 428 }
417 429
418 430 /*
419 431 * The format argument to pass to tcp_display().
420 432 * DISP_PORT_ONLY means that the returned string has only port info.
421 433 * DISP_ADDR_AND_PORT means that the returned string also contains the
422 434 * remote and local IP address.
423 435 */
424 436 #define DISP_PORT_ONLY 1
425 437 #define DISP_ADDR_AND_PORT 2
426 438
427 439 #define IP_ADDR_CACHE_SIZE 2048
428 440 #define IP_ADDR_CACHE_HASH(faddr) \
429 441 (ntohl(faddr) & (IP_ADDR_CACHE_SIZE -1))
430 442
431 443 /* TCP cwnd burst factor. */
432 444 #define TCP_CWND_INFINITE 65535
433 445 #define TCP_CWND_SS 3
434 446 #define TCP_CWND_NORMAL 5
435 447
436 448 /*
437 449 * TCP reassembly macros. We hide starting and ending sequence numbers in
438 450 * b_next and b_prev of messages on the reassembly queue. The messages are
439 451 * chained using b_cont. These macros are used in tcp_reass() so we don't
440 452 * have to see the ugly casts and assignments.
441 453 */
442 454 #define TCP_REASS_SEQ(mp) ((uint32_t)(uintptr_t)((mp)->b_next))
443 455 #define TCP_REASS_SET_SEQ(mp, u) ((mp)->b_next = \
444 456 (mblk_t *)(uintptr_t)(u))
445 457 #define TCP_REASS_END(mp) ((uint32_t)(uintptr_t)((mp)->b_prev))
446 458 #define TCP_REASS_SET_END(mp, u) ((mp)->b_prev = \
447 459 (mblk_t *)(uintptr_t)(u))
448 460
449 461 #define tcps_time_wait_interval tcps_propinfo_tbl[0].prop_cur_uval
450 462 #define tcps_conn_req_max_q tcps_propinfo_tbl[1].prop_cur_uval
451 463 #define tcps_conn_req_max_q0 tcps_propinfo_tbl[2].prop_cur_uval
452 464 #define tcps_conn_req_min tcps_propinfo_tbl[3].prop_cur_uval
453 465 #define tcps_conn_grace_period tcps_propinfo_tbl[4].prop_cur_uval
454 466 #define tcps_cwnd_max_ tcps_propinfo_tbl[5].prop_cur_uval
455 467 #define tcps_dbg tcps_propinfo_tbl[6].prop_cur_uval
456 468 #define tcps_smallest_nonpriv_port tcps_propinfo_tbl[7].prop_cur_uval
457 469 #define tcps_ip_abort_cinterval tcps_propinfo_tbl[8].prop_cur_uval
458 470 #define tcps_ip_abort_linterval tcps_propinfo_tbl[9].prop_cur_uval
459 471 #define tcps_ip_abort_interval tcps_propinfo_tbl[10].prop_cur_uval
460 472 #define tcps_ip_notify_cinterval tcps_propinfo_tbl[11].prop_cur_uval
461 473 #define tcps_ip_notify_interval tcps_propinfo_tbl[12].prop_cur_uval
462 474 #define tcps_ipv4_ttl tcps_propinfo_tbl[13].prop_cur_uval
463 475 #define tcps_keepalive_interval_high tcps_propinfo_tbl[14].prop_max_uval
464 476 #define tcps_keepalive_interval tcps_propinfo_tbl[14].prop_cur_uval
465 477 #define tcps_keepalive_interval_low tcps_propinfo_tbl[14].prop_min_uval
466 478 #define tcps_maxpsz_multiplier tcps_propinfo_tbl[15].prop_cur_uval
467 479 #define tcps_mss_def_ipv4 tcps_propinfo_tbl[16].prop_cur_uval
468 480 #define tcps_mss_max_ipv4 tcps_propinfo_tbl[17].prop_cur_uval
469 481 #define tcps_mss_min tcps_propinfo_tbl[18].prop_cur_uval
470 482 #define tcps_naglim_def tcps_propinfo_tbl[19].prop_cur_uval
471 483 #define tcps_rexmit_interval_initial_high \
472 484 tcps_propinfo_tbl[20].prop_max_uval
473 485 #define tcps_rexmit_interval_initial tcps_propinfo_tbl[20].prop_cur_uval
474 486 #define tcps_rexmit_interval_initial_low \
475 487 tcps_propinfo_tbl[20].prop_min_uval
476 488 #define tcps_rexmit_interval_max_high tcps_propinfo_tbl[21].prop_max_uval
477 489 #define tcps_rexmit_interval_max tcps_propinfo_tbl[21].prop_cur_uval
478 490 #define tcps_rexmit_interval_max_low tcps_propinfo_tbl[21].prop_min_uval
479 491 #define tcps_rexmit_interval_min_high tcps_propinfo_tbl[22].prop_max_uval
480 492 #define tcps_rexmit_interval_min tcps_propinfo_tbl[22].prop_cur_uval
481 493 #define tcps_rexmit_interval_min_low tcps_propinfo_tbl[22].prop_min_uval
482 494 #define tcps_deferred_ack_interval tcps_propinfo_tbl[23].prop_cur_uval
483 495 #define tcps_snd_lowat_fraction tcps_propinfo_tbl[24].prop_cur_uval
484 496 #define tcps_dupack_fast_retransmit tcps_propinfo_tbl[25].prop_cur_uval
485 497 #define tcps_ignore_path_mtu tcps_propinfo_tbl[26].prop_cur_bval
486 498 #define tcps_smallest_anon_port tcps_propinfo_tbl[27].prop_cur_uval
487 499 #define tcps_largest_anon_port tcps_propinfo_tbl[28].prop_cur_uval
488 500 #define tcps_xmit_hiwat tcps_propinfo_tbl[29].prop_cur_uval
489 501 #define tcps_xmit_lowat tcps_propinfo_tbl[30].prop_cur_uval
490 502 #define tcps_recv_hiwat tcps_propinfo_tbl[31].prop_cur_uval
491 503 #define tcps_recv_hiwat_minmss tcps_propinfo_tbl[32].prop_cur_uval
492 504 #define tcps_fin_wait_2_flush_interval_high \
493 505 tcps_propinfo_tbl[33].prop_max_uval
494 506 #define tcps_fin_wait_2_flush_interval tcps_propinfo_tbl[33].prop_cur_uval
495 507 #define tcps_fin_wait_2_flush_interval_low \
496 508 tcps_propinfo_tbl[33].prop_min_uval
497 509 #define tcps_max_buf tcps_propinfo_tbl[34].prop_cur_uval
498 510 #define tcps_strong_iss tcps_propinfo_tbl[35].prop_cur_uval
499 511 #define tcps_rtt_updates tcps_propinfo_tbl[36].prop_cur_uval
500 512 #define tcps_wscale_always tcps_propinfo_tbl[37].prop_cur_bval
501 513 #define tcps_tstamp_always tcps_propinfo_tbl[38].prop_cur_bval
502 514 #define tcps_tstamp_if_wscale tcps_propinfo_tbl[39].prop_cur_bval
503 515 #define tcps_rexmit_interval_extra tcps_propinfo_tbl[40].prop_cur_uval
504 516 #define tcps_deferred_acks_max tcps_propinfo_tbl[41].prop_cur_uval
505 517 #define tcps_slow_start_after_idle tcps_propinfo_tbl[42].prop_cur_uval
506 518 #define tcps_slow_start_initial tcps_propinfo_tbl[43].prop_cur_uval
507 519 #define tcps_sack_permitted tcps_propinfo_tbl[44].prop_cur_uval
508 520 #define tcps_ipv6_hoplimit tcps_propinfo_tbl[45].prop_cur_uval
509 521 #define tcps_mss_def_ipv6 tcps_propinfo_tbl[46].prop_cur_uval
510 522 #define tcps_mss_max_ipv6 tcps_propinfo_tbl[47].prop_cur_uval
511 523 #define tcps_rev_src_routes tcps_propinfo_tbl[48].prop_cur_bval
512 524 #define tcps_local_dack_interval tcps_propinfo_tbl[49].prop_cur_uval
513 525 #define tcps_local_dacks_max tcps_propinfo_tbl[50].prop_cur_uval
514 526 #define tcps_ecn_permitted tcps_propinfo_tbl[51].prop_cur_uval
515 527 #define tcps_rst_sent_rate_enabled tcps_propinfo_tbl[52].prop_cur_bval
516 528 #define tcps_rst_sent_rate tcps_propinfo_tbl[53].prop_cur_uval
517 529 #define tcps_push_timer_interval tcps_propinfo_tbl[54].prop_cur_uval
518 530 #define tcps_use_smss_as_mss_opt tcps_propinfo_tbl[55].prop_cur_bval
519 531 #define tcps_keepalive_abort_interval_high \
520 532 tcps_propinfo_tbl[56].prop_max_uval
521 533 #define tcps_keepalive_abort_interval \
522 534 tcps_propinfo_tbl[56].prop_cur_uval
523 535 #define tcps_keepalive_abort_interval_low \
524 536 tcps_propinfo_tbl[56].prop_min_uval
525 537 #define tcps_wroff_xtra tcps_propinfo_tbl[57].prop_cur_uval
526 538 #define tcps_dev_flow_ctl tcps_propinfo_tbl[58].prop_cur_bval
527 539 #define tcps_reass_timeout tcps_propinfo_tbl[59].prop_cur_uval
528 540 #define tcps_iss_incr tcps_propinfo_tbl[65].prop_cur_uval
529 541
530 542 extern struct qinit tcp_rinitv4, tcp_rinitv6;
531 543 extern boolean_t do_tcp_fusion;
532 544
533 545 /*
534 546 * Object to represent database of options to search passed to
535 547 * {sock,tpi}optcom_req() interface routine to take care of option
536 548 * management and associated methods.
537 549 */
538 550 extern optdb_obj_t tcp_opt_obj;
539 551 extern uint_t tcp_max_optsize;
540 552
541 553 extern int tcp_squeue_flag;
542 554
543 555 extern uint_t tcp_free_list_max_cnt;
544 556
545 557 /*
546 558 * Functions in tcp.c.
547 559 */
548 560 extern void tcp_acceptor_hash_insert(t_uscalar_t, tcp_t *);
549 561 extern tcp_t *tcp_acceptor_hash_lookup(t_uscalar_t, tcp_stack_t *);
550 562 extern void tcp_acceptor_hash_remove(tcp_t *);
551 563 extern mblk_t *tcp_ack_mp(tcp_t *);
552 564 extern int tcp_build_hdrs(tcp_t *);
553 565 extern void tcp_cleanup(tcp_t *);
554 566 extern int tcp_clean_death(tcp_t *, int);
555 567 extern void tcp_clean_death_wrapper(void *, mblk_t *, void *,
556 568 ip_recv_attr_t *);
557 569 extern void tcp_close_common(conn_t *, int);
558 570 extern void tcp_close_detached(tcp_t *);
559 571 extern void tcp_close_mpp(mblk_t **);
560 572 extern void tcp_closei_local(tcp_t *);
561 573 extern sock_lower_handle_t tcp_create(int, int, int, sock_downcalls_t **,
562 574 uint_t *, int *, int, cred_t *);
563 575 extern conn_t *tcp_create_common(cred_t *, boolean_t, boolean_t, int *);
564 576 extern void tcp_disconnect(tcp_t *, mblk_t *);
565 577 extern char *tcp_display(tcp_t *, char *, char);
566 578 extern int tcp_do_bind(conn_t *, struct sockaddr *, socklen_t, cred_t *,
567 579 boolean_t);
568 580 extern int tcp_do_connect(conn_t *, const struct sockaddr *, socklen_t,
569 581 cred_t *, pid_t);
570 582 extern int tcp_do_listen(conn_t *, struct sockaddr *, socklen_t, int,
571 583 cred_t *, boolean_t);
572 584 extern int tcp_do_unbind(conn_t *);
573 585 extern boolean_t tcp_eager_blowoff(tcp_t *, t_scalar_t);
574 586 extern void tcp_eager_cleanup(tcp_t *, boolean_t);
575 587 extern void tcp_eager_kill(void *, mblk_t *, void *, ip_recv_attr_t *);
576 588 extern void tcp_eager_unlink(tcp_t *);
577 589 extern void tcp_init_values(tcp_t *, tcp_t *);
578 590 extern void tcp_ipsec_cleanup(tcp_t *);
579 591 extern int tcp_maxpsz_set(tcp_t *, boolean_t);
580 592 extern void tcp_mss_set(tcp_t *, uint32_t);
581 593 extern void tcp_reinput(conn_t *, mblk_t *, ip_recv_attr_t *, ip_stack_t *);
582 594 extern void tcp_rsrv(queue_t *);
583 595 extern uint_t tcp_rwnd_reopen(tcp_t *);
584 596 extern int tcp_rwnd_set(tcp_t *, uint32_t);
585 597 extern int tcp_set_destination(tcp_t *);
586 598 extern void tcp_set_ws_value(tcp_t *);
587 599 extern void tcp_stop_lingering(tcp_t *);
588 600 extern void tcp_update_pmtu(tcp_t *, boolean_t);
589 601 extern mblk_t *tcp_zcopy_backoff(tcp_t *, mblk_t *, boolean_t);
590 602 extern boolean_t tcp_zcopy_check(tcp_t *);
591 603 extern void tcp_zcopy_notify(tcp_t *);
592 604 extern void tcp_get_proto_props(tcp_t *, struct sock_proto_props *);
593 605
594 606 /*
595 607 * Bind related functions in tcp_bind.c
596 608 */
597 609 extern int tcp_bind_check(conn_t *, struct sockaddr *, socklen_t,
598 610 cred_t *, boolean_t);
599 611 extern void tcp_bind_hash_insert(tf_t *, tcp_t *, int);
600 612 extern void tcp_bind_hash_remove(tcp_t *);
601 613 extern in_port_t tcp_bindi(tcp_t *, in_port_t, const in6_addr_t *,
602 614 int, boolean_t, boolean_t, boolean_t);
603 615 extern in_port_t tcp_update_next_port(in_port_t, const tcp_t *,
604 616 boolean_t);
605 617
606 618 /*
607 619 * Fusion related functions in tcp_fusion.c.
608 620 */
609 621 extern void tcp_fuse(tcp_t *, uchar_t *, tcpha_t *);
610 622 extern void tcp_unfuse(tcp_t *);
611 623 extern boolean_t tcp_fuse_output(tcp_t *, mblk_t *, uint32_t);
612 624 extern void tcp_fuse_output_urg(tcp_t *, mblk_t *);
613 625 extern boolean_t tcp_fuse_rcv_drain(queue_t *, tcp_t *, mblk_t **);
614 626 extern size_t tcp_fuse_set_rcv_hiwat(tcp_t *, size_t);
615 627 extern int tcp_fuse_maxpsz(tcp_t *);
616 628 extern void tcp_fuse_backenable(tcp_t *);
617 629 extern void tcp_iss_key_init(uint8_t *, int, tcp_stack_t *);
618 630
619 631 /*
620 632 * Output related functions in tcp_output.c.
621 633 */
622 634 extern void tcp_close_output(void *, mblk_t *, void *, ip_recv_attr_t *);
623 635 extern void tcp_output(void *, mblk_t *, void *, ip_recv_attr_t *);
624 636 extern void tcp_output_urgent(void *, mblk_t *, void *, ip_recv_attr_t *);
625 637 extern void tcp_rexmit_after_error(tcp_t *);
626 638 extern void tcp_sack_rexmit(tcp_t *, uint_t *);
627 639 extern void tcp_send_data(tcp_t *, mblk_t *);
628 640 extern void tcp_send_synack(void *, mblk_t *, void *, ip_recv_attr_t *);
629 641 extern void tcp_shutdown_output(void *, mblk_t *, void *, ip_recv_attr_t *);
630 642 extern void tcp_ss_rexmit(tcp_t *);
631 643 extern void tcp_update_xmit_tail(tcp_t *, uint32_t);
632 644 extern void tcp_wput(queue_t *, mblk_t *);
633 645 extern void tcp_wput_data(tcp_t *, mblk_t *, boolean_t);
634 646 extern void tcp_wput_sock(queue_t *, mblk_t *);
635 647 extern void tcp_wput_fallback(queue_t *, mblk_t *);
636 648 extern void tcp_xmit_ctl(char *, tcp_t *, uint32_t, uint32_t, int);
637 649 extern void tcp_xmit_listeners_reset(mblk_t *, ip_recv_attr_t *,
638 650 ip_stack_t *i, conn_t *);
639 651 extern mblk_t *tcp_xmit_mp(tcp_t *, mblk_t *, int32_t, int32_t *,
640 652 mblk_t **, uint32_t, boolean_t, uint32_t *, boolean_t);
641 653
642 654 /*
643 655 * Input related functions in tcp_input.c.
644 656 */
645 657 extern void tcp_icmp_input(void *, mblk_t *, void *, ip_recv_attr_t *);
646 658 extern void tcp_input_data(void *, mblk_t *, void *, ip_recv_attr_t *);
647 659 extern void tcp_input_listener_unbound(void *, mblk_t *, void *,
648 660 ip_recv_attr_t *);
649 661 extern boolean_t tcp_paws_check(tcp_t *, tcpha_t *, tcp_opt_t *);
650 662 extern uint_t tcp_rcv_drain(tcp_t *);
651 663 extern void tcp_rcv_enqueue(tcp_t *, mblk_t *, uint_t, cred_t *);
652 664 extern boolean_t tcp_verifyicmp(conn_t *, void *, icmph_t *, icmp6_t *,
653 665 ip_recv_attr_t *);
654 666
655 667 /*
656 668 * Kernel socket related functions in tcp_socket.c.
657 669 */
658 670 extern int tcp_fallback(sock_lower_handle_t, queue_t *, boolean_t,
659 671 so_proto_quiesced_cb_t, sock_quiesce_arg_t *);
660 672 extern boolean_t tcp_newconn_notify(tcp_t *, ip_recv_attr_t *);
661 673
662 674 /*
663 675 * Timer related functions in tcp_timers.c.
664 676 */
665 677 extern void tcp_ack_timer(void *);
666 678 extern void tcp_close_linger_timeout(void *);
667 679 extern void tcp_keepalive_timer(void *);
668 680 extern void tcp_push_timer(void *);
669 681 extern void tcp_reass_timer(void *);
670 682 extern mblk_t *tcp_timermp_alloc(int);
671 683 extern void tcp_timermp_free(tcp_t *);
672 684 extern timeout_id_t tcp_timeout(conn_t *, void (*)(void *), hrtime_t);
673 685 extern clock_t tcp_timeout_cancel(conn_t *, timeout_id_t);
674 686 extern void tcp_timer(void *arg);
675 687 extern void tcp_timers_stop(tcp_t *);
676 688
677 689 /*
678 690 * TCP TPI related functions in tcp_tpi.c.
679 691 */
680 692 extern void tcp_addr_req(tcp_t *, mblk_t *);
681 693 extern void tcp_capability_req(tcp_t *, mblk_t *);
682 694 extern boolean_t tcp_conn_con(tcp_t *, uchar_t *, mblk_t *,
683 695 mblk_t **, ip_recv_attr_t *);
684 696 extern void tcp_err_ack(tcp_t *, mblk_t *, int, int);
685 697 extern void tcp_err_ack_prim(tcp_t *, mblk_t *, int, int, int);
686 698 extern void tcp_info_req(tcp_t *, mblk_t *);
687 699 extern void tcp_send_conn_ind(void *, mblk_t *, void *);
688 700 extern void tcp_send_pending(void *, mblk_t *, void *, ip_recv_attr_t *);
689 701 extern void tcp_tpi_accept(queue_t *, mblk_t *);
690 702 extern void tcp_tpi_bind(tcp_t *, mblk_t *);
691 703 extern int tcp_tpi_close(queue_t *, int);
692 704 extern int tcp_tpi_close_accept(queue_t *);
693 705 extern void tcp_tpi_connect(tcp_t *, mblk_t *);
694 706 extern int tcp_tpi_opt_get(queue_t *, t_scalar_t, t_scalar_t, uchar_t *);
695 707 extern int tcp_tpi_opt_set(queue_t *, uint_t, int, int, uint_t, uchar_t *,
696 708 uint_t *, uchar_t *, void *, cred_t *);
697 709 extern void tcp_tpi_unbind(tcp_t *, mblk_t *);
698 710 extern void tcp_tli_accept(tcp_t *, mblk_t *);
699 711 extern void tcp_use_pure_tpi(tcp_t *);
700 712 extern void tcp_do_capability_ack(tcp_t *, struct T_capability_ack *,
701 713 t_uscalar_t);
702 714
703 715 /*
704 716 * TCP option processing related functions in tcp_opt_data.c
705 717 */
706 718 extern int tcp_opt_get(conn_t *, int, int, uchar_t *);
707 719 extern int tcp_opt_set(conn_t *, uint_t, int, int, uint_t, uchar_t *,
708 720 uint_t *, uchar_t *, void *, cred_t *);
709 721
710 722 /*
711 723 * TCP time wait processing related functions in tcp_time_wait.c.
712 724 */
713 725 extern void tcp_time_wait_append(tcp_t *);
714 726 extern void tcp_time_wait_collector(void *);
715 727 extern boolean_t tcp_time_wait_remove(tcp_t *, tcp_squeue_priv_t *);
716 728 extern void tcp_time_wait_processing(tcp_t *, mblk_t *, uint32_t,
717 729 uint32_t, int, tcpha_t *, ip_recv_attr_t *);
718 730
719 731 /*
720 732 * Misc functions in tcp_misc.c.
721 733 */
722 734 extern uint32_t tcp_find_listener_conf(tcp_stack_t *, in_port_t);
723 735 extern void tcp_ioctl_abort_conn(queue_t *, mblk_t *);
724 736 extern void tcp_listener_conf_cleanup(tcp_stack_t *);
725 737 extern void tcp_stack_cpu_add(tcp_stack_t *, processorid_t);
726 738
727 739 #endif /* _KERNEL */
728 740
729 741 #ifdef __cplusplus
730 742 }
731 743 #endif
732 744
733 745 #endif /* _INET_TCP_IMPL_H */
↓ open down ↓ |
667 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX