Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 1 | /* |
Florin Coras | 222e1f41 | 2019-02-16 20:47:32 -0800 | [diff] [blame] | 2 | * Copyright (c) 2016-2019 Cisco and/or its affiliates. |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | |
| 16 | #ifndef _vnet_tcp_h_ |
| 17 | #define _vnet_tcp_h_ |
| 18 | |
| 19 | #include <vnet/vnet.h> |
| 20 | #include <vnet/ip/ip.h> |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 21 | #include <vnet/session/session.h> |
Florin Coras | 999840c | 2020-03-18 20:31:34 +0000 | [diff] [blame] | 22 | #include <vnet/tcp/tcp_types.h> |
| 23 | #include <vnet/tcp/tcp_timer.h> |
Florin Coras | e69f495 | 2017-03-07 10:06:24 -0800 | [diff] [blame] | 24 | #include <vnet/tcp/tcp_debug.h> |
Florin Coras | 999840c | 2020-03-18 20:31:34 +0000 | [diff] [blame] | 25 | #include <vnet/tcp/tcp_sack.h> |
| 26 | #include <vnet/tcp/tcp_bt.h> |
| 27 | #include <vnet/tcp/tcp_cc.h> |
Florin Coras | bbcfaac | 2019-10-10 13:52:04 -0700 | [diff] [blame] | 28 | |
Florin Coras | aa38869 | 2020-02-14 23:41:25 +0000 | [diff] [blame] | 29 | typedef void (timer_expiration_handler) (tcp_connection_t * tc); |
| 30 | |
Florin Coras | aa38869 | 2020-02-14 23:41:25 +0000 | [diff] [blame] | 31 | extern timer_expiration_handler tcp_timer_retransmit_handler; |
| 32 | extern timer_expiration_handler tcp_timer_persist_handler; |
| 33 | extern timer_expiration_handler tcp_timer_retransmit_syn_handler; |
| 34 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 35 | typedef enum _tcp_error |
| 36 | { |
| 37 | #define tcp_error(n,s) TCP_ERROR_##n, |
| 38 | #include <vnet/tcp/tcp_error.def> |
| 39 | #undef tcp_error |
| 40 | TCP_N_ERROR, |
| 41 | } tcp_error_t; |
| 42 | |
| 43 | typedef struct _tcp_lookup_dispatch |
| 44 | { |
| 45 | u8 next, error; |
| 46 | } tcp_lookup_dispatch_t; |
| 47 | |
Florin Coras | 5e6305f | 2020-02-12 07:42:01 +0000 | [diff] [blame] | 48 | #define foreach_tcp_wrk_stat \ |
| 49 | _(timer_expirations, u64, "timer expirations") \ |
| 50 | _(rxt_segs, u64, "segments retransmitted") \ |
| 51 | _(tr_events, u32, "timer retransmit events") \ |
| 52 | _(to_closewait, u32, "timeout close-wait") \ |
Florin Coras | aa38869 | 2020-02-14 23:41:25 +0000 | [diff] [blame] | 53 | _(to_closewait2, u32, "timeout close-wait w/data") \ |
Florin Coras | 5e6305f | 2020-02-12 07:42:01 +0000 | [diff] [blame] | 54 | _(to_finwait1, u32, "timeout fin-wait-1") \ |
Florin Coras | 3f78bbb | 2020-02-13 19:24:58 +0000 | [diff] [blame] | 55 | _(to_finwait2, u32, "timeout fin-wait-2") \ |
Florin Coras | 5e6305f | 2020-02-12 07:42:01 +0000 | [diff] [blame] | 56 | _(to_lastack, u32, "timeout last-ack") \ |
| 57 | _(to_closing, u32, "timeout closing") \ |
| 58 | _(tr_abort, u32, "timer retransmit abort") \ |
| 59 | _(rst_unread, u32, "reset on close due to unread data") \ |
Florin Coras | d4712a8 | 2020-05-22 21:51:30 +0000 | [diff] [blame] | 60 | _(no_buffer, u32, "out of buffers") \ |
Florin Coras | 5e6305f | 2020-02-12 07:42:01 +0000 | [diff] [blame] | 61 | |
| 62 | typedef struct tcp_wrk_stats_ |
| 63 | { |
| 64 | #define _(name, type, str) type name; |
| 65 | foreach_tcp_wrk_stat |
| 66 | #undef _ |
| 67 | } tcp_wrk_stats_t; |
| 68 | |
Florin Coras | 7a3a866 | 2020-02-22 02:27:21 +0000 | [diff] [blame] | 69 | typedef struct tcp_free_req_ |
| 70 | { |
| 71 | clib_time_type_t free_time; |
| 72 | u32 connection_index; |
| 73 | } tcp_cleanup_req_t; |
| 74 | |
Florin Coras | 2c41443 | 2018-06-19 09:58:04 -0700 | [diff] [blame] | 75 | typedef struct tcp_worker_ctx_ |
| 76 | { |
| 77 | CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); |
Florin Coras | b11175d | 2018-11-09 14:34:08 -0800 | [diff] [blame] | 78 | |
Florin Coras | 0426185 | 2020-02-12 01:24:29 +0000 | [diff] [blame] | 79 | /** worker's pool of connections */ |
| 80 | tcp_connection_t *connections; |
Florin Coras | b11175d | 2018-11-09 14:34:08 -0800 | [diff] [blame] | 81 | |
Florin Coras | b11175d | 2018-11-09 14:34:08 -0800 | [diff] [blame] | 82 | /** vector of pending ack dequeues */ |
Florin Coras | 9ece3c0 | 2018-11-05 11:06:53 -0800 | [diff] [blame] | 83 | u32 *pending_deq_acked; |
Florin Coras | b11175d | 2018-11-09 14:34:08 -0800 | [diff] [blame] | 84 | |
Florin Coras | b11175d | 2018-11-09 14:34:08 -0800 | [diff] [blame] | 85 | /** vector of pending disconnect notifications */ |
| 86 | u32 *pending_disconnects; |
| 87 | |
Florin Coras | 0426185 | 2020-02-12 01:24:29 +0000 | [diff] [blame] | 88 | /** vector of pending reset notifications */ |
Florin Coras | 6939d5e | 2020-02-10 23:22:34 +0000 | [diff] [blame] | 89 | u32 *pending_resets; |
| 90 | |
Florin Coras | b11175d | 2018-11-09 14:34:08 -0800 | [diff] [blame] | 91 | /** convenience pointer to this thread's vlib main */ |
| 92 | vlib_main_t *vm; |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 93 | |
Florin Coras | eedc74b | 2020-07-31 12:32:40 -0700 | [diff] [blame] | 94 | /** Time measured in @ref TCP_TSTAMP_TICK used for time stamps */ |
Florin Coras | 6939d5e | 2020-02-10 23:22:34 +0000 | [diff] [blame] | 95 | u32 time_now; |
| 96 | |
Florin Coras | a9d8cb4 | 2020-02-20 05:45:31 +0000 | [diff] [blame] | 97 | /* Max timers to be handled per dispatch loop */ |
| 98 | u32 max_timers_per_loop; |
| 99 | |
Florin Coras | 5484daa | 2020-03-27 23:55:06 +0000 | [diff] [blame] | 100 | /** Session layer edge indices to tcp output */ |
| 101 | u32 tco_next_node[2]; |
| 102 | |
| 103 | /* Fifo of pending timer expirations */ |
| 104 | u32 *pending_timers; |
Florin Coras | 0426185 | 2020-02-12 01:24:29 +0000 | [diff] [blame] | 105 | |
Florin Coras | b26743d | 2018-06-26 09:31:04 -0700 | [diff] [blame] | 106 | CLIB_CACHE_LINE_ALIGN_MARK (cacheline1); |
Florin Coras | b11175d | 2018-11-09 14:34:08 -0800 | [diff] [blame] | 107 | |
| 108 | /** cached 'on the wire' options for bursts */ |
| 109 | u8 cached_opts[40]; |
Florin Coras | bf4d5ce | 2018-10-19 16:26:24 -0700 | [diff] [blame] | 110 | |
Florin Coras | 0426185 | 2020-02-12 01:24:29 +0000 | [diff] [blame] | 111 | /** tx buffer free list */ |
| 112 | u32 *tx_buffers; |
| 113 | |
Florin Coras | 7a3a866 | 2020-02-22 02:27:21 +0000 | [diff] [blame] | 114 | /* fifo of pending free requests */ |
| 115 | tcp_cleanup_req_t *pending_cleanups; |
| 116 | |
Florin Coras | 6939d5e | 2020-02-10 23:22:34 +0000 | [diff] [blame] | 117 | /** worker timer wheel */ |
Florin Coras | 0765d97 | 2020-03-18 21:26:41 +0000 | [diff] [blame] | 118 | tcp_timer_wheel_t timer_wheel; |
Florin Coras | 6939d5e | 2020-02-10 23:22:34 +0000 | [diff] [blame] | 119 | |
Florin Coras | 5e6305f | 2020-02-12 07:42:01 +0000 | [diff] [blame] | 120 | CLIB_CACHE_LINE_ALIGN_MARK (cacheline2); |
| 121 | |
| 122 | tcp_wrk_stats_t stats; |
Florin Coras | 2c41443 | 2018-06-19 09:58:04 -0700 | [diff] [blame] | 123 | } tcp_worker_ctx_t; |
| 124 | |
Florin Coras | 0765d97 | 2020-03-18 21:26:41 +0000 | [diff] [blame] | 125 | #define tcp_worker_stats_inc(_wrk,_stat,_val) \ |
Florin Coras | 5e6305f | 2020-02-12 07:42:01 +0000 | [diff] [blame] | 126 | _wrk->stats._stat += _val |
| 127 | |
Florin Coras | 18e0d4f | 2019-01-02 12:22:02 -0800 | [diff] [blame] | 128 | typedef struct tcp_iss_seed_ |
| 129 | { |
| 130 | u64 first; |
| 131 | u64 second; |
| 132 | } tcp_iss_seed_t; |
| 133 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 134 | typedef struct tcp_configuration_ |
| 135 | { |
| 136 | /** Max rx fifo size for a session (in bytes). It is used in to compute the |
| 137 | * rfc 7323 window scaling factor */ |
| 138 | u32 max_rx_fifo; |
| 139 | |
| 140 | /** Min rx fifo for a session (in bytes) */ |
| 141 | u32 min_rx_fifo; |
| 142 | |
| 143 | /** Default MTU to be used when establishing connections */ |
| 144 | u16 default_mtu; |
| 145 | |
| 146 | /** Initial CWND multiplier, which multiplies MSS to determine initial CWND. |
| 147 | * Set 0 to determine the initial CWND by another way */ |
| 148 | u16 initial_cwnd_multiplier; |
| 149 | |
| 150 | /** Enable tx pacing for new connections */ |
| 151 | u8 enable_tx_pacing; |
| 152 | |
Florin Coras | bbcfaac | 2019-10-10 13:52:04 -0700 | [diff] [blame] | 153 | /** Allow use of TSO whenever available */ |
| 154 | u8 allow_tso; |
| 155 | |
Florin Coras | f4ce6ba | 2019-11-20 18:34:58 -0800 | [diff] [blame] | 156 | /** Set if csum offloading is enabled */ |
| 157 | u8 csum_offload; |
| 158 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 159 | /** Default congestion control algorithm type */ |
| 160 | tcp_cc_algorithm_type_e cc_algo; |
| 161 | |
Florin Coras | 017dc45 | 2019-08-30 11:06:35 -0700 | [diff] [blame] | 162 | /** Min rwnd, as number of snd_mss segments, for update ack to be sent after |
| 163 | * a zero rwnd advertisement */ |
| 164 | u32 rwnd_min_update_ack; |
| 165 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 166 | /** Delayed ack time (disabled) */ |
| 167 | u16 delack_time; |
| 168 | |
| 169 | /** Timer ticks to wait for close from app */ |
| 170 | u16 closewait_time; |
| 171 | |
| 172 | /** Timer ticks to wait in time-wait. Also known as 2MSL */ |
| 173 | u16 timewait_time; |
| 174 | |
| 175 | /** Timer ticks to wait in fin-wait1 to send fin and rcv fin-ack */ |
| 176 | u16 finwait1_time; |
| 177 | |
| 178 | /** Timer ticks to wait in last ack for ack */ |
| 179 | u16 lastack_time; |
| 180 | |
| 181 | /** Timer ticks to wait in fin-wait2 for fin */ |
| 182 | u16 finwait2_time; |
| 183 | |
| 184 | /** Timer ticks to wait in closing for fin ack */ |
| 185 | u16 closing_time; |
| 186 | |
Florin Coras | 7a3a866 | 2020-02-22 02:27:21 +0000 | [diff] [blame] | 187 | /** Time to wait (sec) before cleaning up the connection */ |
| 188 | f32 cleanup_time; |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 189 | |
| 190 | /** Number of preallocated connections */ |
| 191 | u32 preallocated_connections; |
| 192 | |
| 193 | /** Number of preallocated half-open connections */ |
| 194 | u32 preallocated_half_open_connections; |
| 195 | |
| 196 | /** Vectors of src addresses. Optional unless one needs > 63K active-opens */ |
| 197 | ip4_address_t *ip4_src_addrs; |
| 198 | ip6_address_t *ip6_src_addrs; |
| 199 | |
| 200 | /** Fault-injection. Debug only */ |
| 201 | f64 buffer_fail_fraction; |
| 202 | } tcp_configuration_t; |
| 203 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 204 | typedef struct _tcp_main |
| 205 | { |
Florin Coras | 0426185 | 2020-02-12 01:24:29 +0000 | [diff] [blame] | 206 | /** per-worker context */ |
| 207 | tcp_worker_ctx_t *wrk_ctx; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 208 | |
| 209 | /* Pool of listeners. */ |
| 210 | tcp_connection_t *listener_pool; |
| 211 | |
Florin Coras | ca03186 | 2018-09-24 13:58:05 -0700 | [diff] [blame] | 212 | /** vlib buffer size */ |
| 213 | u32 bytes_per_buffer; |
| 214 | |
Florin Coras | 5484daa | 2020-03-27 23:55:06 +0000 | [diff] [blame] | 215 | /** Session layer edge indices to ip lookup (syns, rst) */ |
| 216 | u32 ipl_next_node[2]; |
| 217 | |
Florin Coras | 0426185 | 2020-02-12 01:24:29 +0000 | [diff] [blame] | 218 | /** Dispatch table by state and flags */ |
| 219 | tcp_lookup_dispatch_t dispatch_table[TCP_N_STATES][64]; |
| 220 | |
| 221 | clib_spinlock_t half_open_lock; |
| 222 | |
| 223 | /** Pool of half-open connections on which we've sent a SYN */ |
| 224 | tcp_connection_t *half_open_connections; |
| 225 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 226 | /** Seed used to generate random iss */ |
Florin Coras | 18e0d4f | 2019-01-02 12:22:02 -0800 | [diff] [blame] | 227 | tcp_iss_seed_t iss_seed; |
| 228 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 229 | /** Congestion control algorithms registered */ |
Florin Coras | 4e116fb | 2019-06-10 08:33:50 -0700 | [diff] [blame] | 230 | tcp_cc_algorithm_t *cc_algos; |
| 231 | |
Florin Coras | fbf278a | 2019-03-26 14:05:38 -0700 | [diff] [blame] | 232 | /** Hash table of cc algorithms by name */ |
| 233 | uword *cc_algo_by_name; |
| 234 | |
Florin Coras | 4e116fb | 2019-06-10 08:33:50 -0700 | [diff] [blame] | 235 | /** Last cc algo registered */ |
| 236 | tcp_cc_algorithm_type_e cc_last_type; |
| 237 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 238 | /** Flag that indicates if stack is on or off */ |
Florin Coras | a0b34a7 | 2017-03-07 01:20:52 -0800 | [diff] [blame] | 239 | u8 is_enabled; |
| 240 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 241 | /** Flag that indicates if v4 punting is enabled */ |
Pierre Pfister | 7fe51f3 | 2017-09-20 08:48:36 +0200 | [diff] [blame] | 242 | u8 punt_unknown4; |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 243 | |
| 244 | /** Flag that indicates if v6 punting is enabled */ |
Pierre Pfister | 7fe51f3 | 2017-09-20 08:48:36 +0200 | [diff] [blame] | 245 | u8 punt_unknown6; |
Florin Coras | f988e69 | 2017-11-27 04:34:14 -0500 | [diff] [blame] | 246 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 247 | /** Rotor for v4 source addresses */ |
| 248 | u32 last_v4_addr_rotor; |
Florin Coras | 2e31cc3 | 2018-09-25 14:00:34 -0700 | [diff] [blame] | 249 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 250 | /** Rotor for v6 source addresses */ |
| 251 | u32 last_v6_addr_rotor; |
| 252 | |
| 253 | /** Protocol configuration */ |
| 254 | tcp_configuration_t cfg; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 255 | } tcp_main_t; |
| 256 | |
| 257 | extern tcp_main_t tcp_main; |
| 258 | extern vlib_node_registration_t tcp4_input_node; |
| 259 | extern vlib_node_registration_t tcp6_input_node; |
| 260 | extern vlib_node_registration_t tcp4_output_node; |
| 261 | extern vlib_node_registration_t tcp6_output_node; |
Filip Tehlar | e275bed | 2019-03-06 00:06:56 -0800 | [diff] [blame] | 262 | extern vlib_node_registration_t tcp4_established_node; |
| 263 | extern vlib_node_registration_t tcp6_established_node; |
| 264 | extern vlib_node_registration_t tcp4_syn_sent_node; |
| 265 | extern vlib_node_registration_t tcp6_syn_sent_node; |
| 266 | extern vlib_node_registration_t tcp4_rcv_process_node; |
| 267 | extern vlib_node_registration_t tcp6_rcv_process_node; |
| 268 | extern vlib_node_registration_t tcp4_listen_node; |
| 269 | extern vlib_node_registration_t tcp6_listen_node; |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 270 | |
Florin Coras | 9094b5c | 2019-08-12 14:17:47 -0700 | [diff] [blame] | 271 | #define tcp_cfg tcp_main.cfg |
Florin Coras | 1f42101 | 2019-07-26 10:18:51 -0700 | [diff] [blame] | 272 | #define tcp_node_index(node_id, is_ip4) \ |
| 273 | ((is_ip4) ? tcp4_##node_id##_node.index : tcp6_##node_id##_node.index) |
| 274 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 275 | always_inline tcp_main_t * |
| 276 | vnet_get_tcp_main () |
| 277 | { |
| 278 | return &tcp_main; |
| 279 | } |
| 280 | |
Florin Coras | be72ae6 | 2018-11-01 11:23:03 -0700 | [diff] [blame] | 281 | always_inline tcp_worker_ctx_t * |
| 282 | tcp_get_worker (u32 thread_index) |
| 283 | { |
Florin Coras | 0426185 | 2020-02-12 01:24:29 +0000 | [diff] [blame] | 284 | ASSERT (thread_index < vec_len (tcp_main.wrk_ctx)); |
Florin Coras | be72ae6 | 2018-11-01 11:23:03 -0700 | [diff] [blame] | 285 | return &tcp_main.wrk_ctx[thread_index]; |
| 286 | } |
| 287 | |
Florin Coras | f988e69 | 2017-11-27 04:34:14 -0500 | [diff] [blame] | 288 | #if (VLIB_BUFFER_TRACE_TRAJECTORY) |
| 289 | #define tcp_trajectory_add_start(b, start) \ |
| 290 | { \ |
| 291 | (*vlib_buffer_trace_trajectory_cb) (b, start); \ |
| 292 | } |
| 293 | #else |
| 294 | #define tcp_trajectory_add_start(b, start) |
| 295 | #endif |
| 296 | |
Florin Coras | 8124cb7 | 2018-12-16 20:57:29 -0800 | [diff] [blame] | 297 | tcp_connection_t *tcp_connection_alloc (u8 thread_index); |
Florin Coras | 12f6936 | 2019-08-16 09:44:00 -0700 | [diff] [blame] | 298 | tcp_connection_t *tcp_connection_alloc_w_base (u8 thread_index, |
| 299 | tcp_connection_t * base); |
Florin Coras | 8124cb7 | 2018-12-16 20:57:29 -0800 | [diff] [blame] | 300 | void tcp_connection_free (tcp_connection_t * tc); |
Florin Coras | 999840c | 2020-03-18 20:31:34 +0000 | [diff] [blame] | 301 | void tcp_connection_close (tcp_connection_t * tc); |
| 302 | void tcp_connection_cleanup (tcp_connection_t * tc); |
| 303 | void tcp_connection_del (tcp_connection_t * tc); |
| 304 | int tcp_half_open_connection_cleanup (tcp_connection_t * tc); |
Florin Coras | 3eb5062 | 2017-07-13 01:24:57 -0400 | [diff] [blame] | 305 | |
Florin Coras | 1f152cd | 2017-08-18 19:28:03 -0700 | [diff] [blame] | 306 | void tcp_send_reset_w_pkt (tcp_connection_t * tc, vlib_buffer_t * pkt, |
Florin Coras | d4c49be | 2019-02-07 00:15:53 -0800 | [diff] [blame] | 307 | u32 thread_index, u8 is_ip4); |
Florin Coras | 1f152cd | 2017-08-18 19:28:03 -0700 | [diff] [blame] | 308 | void tcp_send_reset (tcp_connection_t * tc); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 309 | void tcp_send_syn (tcp_connection_t * tc); |
Florin Coras | 7ac053b | 2018-11-05 15:57:21 -0800 | [diff] [blame] | 310 | void tcp_send_synack (tcp_connection_t * tc); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 311 | void tcp_send_fin (tcp_connection_t * tc); |
Florin Coras | cb711a4 | 2019-10-16 19:28:17 -0700 | [diff] [blame] | 312 | void tcp_send_ack (tcp_connection_t * tc); |
Vladimir Kropylev | 398afbd | 2019-06-25 00:06:52 +0300 | [diff] [blame] | 313 | void tcp_send_window_update_ack (tcp_connection_t * tc); |
Florin Coras | 7ac053b | 2018-11-05 15:57:21 -0800 | [diff] [blame] | 314 | |
Florin Coras | 26dd6de | 2019-07-23 23:54:47 -0700 | [diff] [blame] | 315 | void tcp_program_ack (tcp_connection_t * tc); |
| 316 | void tcp_program_dupack (tcp_connection_t * tc); |
Florin Coras | 36ebcff | 2019-09-12 18:36:44 -0700 | [diff] [blame] | 317 | void tcp_program_retransmit (tcp_connection_t * tc); |
Florin Coras | 26dd6de | 2019-07-23 23:54:47 -0700 | [diff] [blame] | 318 | |
Florin Coras | 999840c | 2020-03-18 20:31:34 +0000 | [diff] [blame] | 319 | void tcp_update_burst_snd_vars (tcp_connection_t * tc); |
Florin Coras | 45ca73f | 2018-09-27 09:19:29 -0700 | [diff] [blame] | 320 | u32 tcp_snd_space (tcp_connection_t * tc); |
Florin Coras | be237bf | 2019-09-27 08:16:40 -0700 | [diff] [blame] | 321 | int tcp_fastrecovery_prr_snd_space (tcp_connection_t * tc); |
Florin Coras | 6080e0d | 2020-03-13 20:39:43 +0000 | [diff] [blame] | 322 | void tcp_reschedule (tcp_connection_t * tc); |
Florin Coras | f6359c8 | 2017-06-19 12:26:09 -0400 | [diff] [blame] | 323 | fib_node_index_t tcp_lookup_rmt_in_fib (tcp_connection_t * tc); |
Florin Coras | 14ed6df | 2019-03-06 21:13:42 -0800 | [diff] [blame] | 324 | u32 tcp_session_push_header (transport_connection_t * tconn, |
| 325 | vlib_buffer_t * b); |
Florin Coras | 9f86d22 | 2020-03-23 15:34:22 +0000 | [diff] [blame] | 326 | int tcp_session_custom_tx (void *conn, transport_send_params_t * sp); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 327 | |
| 328 | void tcp_connection_timers_init (tcp_connection_t * tc); |
| 329 | void tcp_connection_timers_reset (tcp_connection_t * tc); |
Florin Coras | 4eeeaaf | 2017-09-05 14:03:37 -0400 | [diff] [blame] | 330 | void tcp_init_snd_vars (tcp_connection_t * tc); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 331 | void tcp_connection_init_vars (tcp_connection_t * tc); |
Florin Coras | c44a558 | 2018-11-01 16:30:54 -0700 | [diff] [blame] | 332 | void tcp_connection_tx_pacer_update (tcp_connection_t * tc); |
| 333 | void tcp_connection_tx_pacer_reset (tcp_connection_t * tc, u32 window, |
| 334 | u32 start_bucket); |
Florin Coras | 7a3a866 | 2020-02-22 02:27:21 +0000 | [diff] [blame] | 335 | void tcp_program_cleanup (tcp_worker_ctx_t * wrk, tcp_connection_t * tc); |
Florin Coras | d67f112 | 2018-05-21 17:47:40 -0700 | [diff] [blame] | 336 | |
Florin Coras | 999840c | 2020-03-18 20:31:34 +0000 | [diff] [blame] | 337 | void tcp_punt_unknown (vlib_main_t * vm, u8 is_ip4, u8 is_add); |
| 338 | int tcp_configure_v4_source_address_range (vlib_main_t * vm, |
| 339 | ip4_address_t * start, |
| 340 | ip4_address_t * end, u32 table_id); |
| 341 | int tcp_configure_v6_source_address_range (vlib_main_t * vm, |
| 342 | ip6_address_t * start, |
| 343 | ip6_address_t * end, u32 table_id); |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 344 | |
Florin Coras | 999840c | 2020-03-18 20:31:34 +0000 | [diff] [blame] | 345 | clib_error_t *vnet_tcp_enable_disable (vlib_main_t * vm, u8 is_en); |
Florin Coras | 5281473 | 2019-06-12 15:38:19 -0700 | [diff] [blame] | 346 | |
Florin Coras | 999840c | 2020-03-18 20:31:34 +0000 | [diff] [blame] | 347 | format_function_t format_tcp_state; |
| 348 | format_function_t format_tcp_flags; |
| 349 | format_function_t format_tcp_sacks; |
| 350 | format_function_t format_tcp_rcv_sacks; |
| 351 | format_function_t format_tcp_connection; |
| 352 | format_function_t format_tcp_connection_id; |
Florin Coras | d206724 | 2019-08-16 10:33:49 -0700 | [diff] [blame] | 353 | |
Florin Coras | 93992a9 | 2017-05-24 18:03:56 -0700 | [diff] [blame] | 354 | #define tcp_validate_txf_size(_tc, _a) \ |
| 355 | ASSERT(_tc->state != TCP_STATE_ESTABLISHED \ |
Florin Coras | 31c9955 | 2019-03-01 13:00:58 -0800 | [diff] [blame] | 356 | || transport_max_tx_dequeue (&_tc->connection) >= _a) |
Florin Coras | 93992a9 | 2017-05-24 18:03:56 -0700 | [diff] [blame] | 357 | |
Dave Barach | 68b0fb0 | 2017-02-28 15:15:56 -0500 | [diff] [blame] | 358 | #endif /* _vnet_tcp_h_ */ |
| 359 | |
| 360 | /* |
| 361 | * fd.io coding-style-patch-verification: ON |
| 362 | * |
| 363 | * Local Variables: |
| 364 | * eval: (c-set-style "gnu") |
| 365 | * End: |
| 366 | */ |