Print this page
11553 Want pluggable TCP congestion control algorithms
Portions contributed by: Cody Peter Mello <cody.mello@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Robert Mustacchi <robert.mustacchi@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/inet/tcp_stack.h
+++ new/usr/src/uts/common/inet/tcp_stack.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
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
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 /*
23 23 * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
24 + * Copyright (c) 2017 by Delphix. All rights reserved.
24 25 */
25 26
26 27 #ifndef _INET_TCP_STACK_H
27 28 #define _INET_TCP_STACK_H
28 29
29 30 #include <sys/netstack.h>
30 31 #include <inet/ip.h>
31 32 #include <inet/ipdrop.h>
32 33 #include <inet/tcp_stats.h>
33 34 #include <sys/sunddi.h>
34 35 #include <sys/sunldi.h>
35 36
36 37 #ifdef __cplusplus
37 38 extern "C" {
38 39 #endif
39 40
40 41 #ifdef _KERNEL
41 42
42 43 /*
43 44 * TCP stack instances
44 45 */
45 46 struct tcp_stack {
46 47 netstack_t *tcps_netstack; /* Common netstack */
47 48
48 49 /*
49 50 * Extra privileged ports. In host byte order.
50 51 * Protected by tcp_epriv_port_lock.
51 52 */
52 53 #define TCP_NUM_EPRIV_PORTS 64
53 54 int tcps_g_num_epriv_ports;
54 55 in_port_t tcps_g_epriv_ports[TCP_NUM_EPRIV_PORTS];
55 56 kmutex_t tcps_epriv_port_lock;
56 57
57 58 /*
58 59 * The smallest anonymous port in the priviledged port range which TCP
59 60 * looks for free port. Use in the option TCP_ANONPRIVBIND.
60 61 */
61 62 in_port_t tcps_min_anonpriv_port;
62 63
63 64 /* holds the tcp tunables */
64 65 struct mod_prop_info_s *tcps_propinfo_tbl;
65 66
66 67 /* Hint not protected by any lock */
67 68 uint_t tcps_next_port_to_try;
68 69
69 70 /* TCP bind hash list - all tcp_t with state >= BOUND. */
70 71 struct tf_s *tcps_bind_fanout;
71 72
72 73 /* TCP queue hash list - all tcp_t in case they will be an acceptor. */
73 74 struct tf_s *tcps_acceptor_fanout;
74 75
75 76 /*
76 77 * MIB-2 stuff for SNMP
77 78 * Note: tcpInErrs {tcp 15} is accumulated in ip.c
78 79 */
79 80 kstat_t *tcps_mibkp; /* kstat exporting mib2_tcp_t data */
80 81 kstat_t *tcps_kstat; /* kstat exporting tcp_stat_t data */
81 82
82 83 uint32_t tcps_iss_incr_extra;
83 84 /* Incremented for each connection */
84 85 kmutex_t tcps_iss_key_lock;
85 86 MD5_CTX tcps_iss_key;
86 87
87 88 /* Packet dropper for TCP IPsec policy drops. */
88 89 ipdropper_t tcps_dropper;
89 90
90 91 /*
91 92 * These two variables control the rate for TCP to generate RSTs in
92 93 * response to segments not belonging to any connections. We limit
93 94 * TCP to sent out tcp_rst_sent_rate (ndd param) number of RSTs in
94 95 * each 1 second interval. This is to protect TCP against DoS attack.
95 96 */
96 97 int64_t tcps_last_rst_intrvl;
97 98 uint32_t tcps_rst_cnt;
98 99
99 100 ldi_ident_t tcps_ldi_ident;
100 101
101 102 /* Used to synchronize access when reclaiming memory */
102 103 mblk_t *tcps_ixa_cleanup_mp;
103 104 kmutex_t tcps_ixa_cleanup_lock;
104 105 kcondvar_t tcps_ixa_cleanup_ready_cv;
105 106 kcondvar_t tcps_ixa_cleanup_done_cv;
106 107
↓ open down ↓ |
73 lines elided |
↑ open up ↑ |
107 108 /* Variables for handling kmem reclaim call back. */
108 109 kmutex_t tcps_reclaim_lock;
109 110 boolean_t tcps_reclaim;
110 111 timeout_id_t tcps_reclaim_tid;
111 112 uint32_t tcps_reclaim_period;
112 113
113 114 /* Listener connection limit configuration. */
114 115 kmutex_t tcps_listener_conf_lock;
115 116 list_t tcps_listener_conf;
116 117
118 + struct cc_algo *tcps_default_cc_algo;
119 +
117 120 /*
118 121 * Per CPU stats
119 122 *
120 123 * tcps_sc: array of pointer to per CPU stats. The i-th element in the
121 124 * array represents the stats of the CPU with cpu_seqid.
122 125 * tcps_sc_cnt: number of CPU stats in the tcps_sc array.
123 126 */
124 127 tcp_stats_cpu_t **tcps_sc;
125 128 int tcps_sc_cnt;
126 129 };
127 130
128 131 typedef struct tcp_stack tcp_stack_t;
129 132
130 133 #endif /* _KERNEL */
131 134 #ifdef __cplusplus
132 135 }
133 136 #endif
134 137
135 138 #endif /* _INET_TCP_STACK_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX