FD.io VPP  v19.08.3-2-gbabecb413
Vector Packet Processing
tcp.c File Reference

TCP host stack utilities. More...

+ Include dependency graph for tcp.c:

Go to the source code of this file.

Data Structures

struct  tcp_add_del_adj_args_t
 

Functions

static void tcp_add_del_adj_cb (tcp_add_del_adj_args_t *args)
 
static void tcp_add_del_adjacency (tcp_connection_t *tc, u8 is_add)
 
static void tcp_cc_init (tcp_connection_t *tc)
 
static void tcp_cc_cleanup (tcp_connection_t *tc)
 
void tcp_cc_algo_register (tcp_cc_algorithm_type_e type, const tcp_cc_algorithm_t *vft)
 Register exiting cc algo type. More...
 
tcp_cc_algorithm_ttcp_cc_algo_get (tcp_cc_algorithm_type_e type)
 
tcp_cc_algorithm_type_e tcp_cc_algo_new_type (const tcp_cc_algorithm_t *vft)
 Register new cc algo type. More...
 
static u32 tcp_connection_bind (u32 session_index, transport_endpoint_t *lcl)
 
static u32 tcp_session_bind (u32 session_index, transport_endpoint_t *tep)
 
static void tcp_connection_unbind (u32 listener_index)
 
static u32 tcp_session_unbind (u32 listener_index)
 
static transport_connection_ttcp_session_get_listener (u32 listener_index)
 
static void tcp_half_open_connection_del (tcp_connection_t *tc)
 Cleanup half-open connection. More...
 
int tcp_half_open_connection_cleanup (tcp_connection_t *tc)
 Try to cleanup half-open connection. More...
 
static tcp_connection_ttcp_half_open_connection_new (void)
 
void tcp_connection_cleanup (tcp_connection_t *tc)
 Cleans up connection state. More...
 
void tcp_connection_del (tcp_connection_t *tc)
 Connection removal. More...
 
tcp_connection_ttcp_connection_alloc (u8 thread_index)
 
tcp_connection_ttcp_connection_alloc_w_base (u8 thread_index, tcp_connection_t *base)
 
void tcp_connection_free (tcp_connection_t *tc)
 
void tcp_connection_reset (tcp_connection_t *tc)
 Notify session that connection has been reset. More...
 
void tcp_connection_close (tcp_connection_t *tc)
 Begin connection closing procedure. More...
 
static void tcp_session_close (u32 conn_index, u32 thread_index)
 
static void tcp_session_cleanup (u32 conn_index, u32 thread_index)
 
static void tcp_session_reset (u32 conn_index, u32 thread_index)
 
void tcp_connection_timers_init (tcp_connection_t *tc)
 Initialize all connection timers as invalid. More...
 
void tcp_connection_timers_reset (tcp_connection_t *tc)
 Stop all connection timers. More...
 
static u32 tcp_generate_random_iss (tcp_connection_t *tc)
 Generate random iss as per rfc6528. More...
 
static void tcp_init_rcv_mss (tcp_connection_t *tc)
 Initialize max segment size we're able to process. More...
 
static void tcp_init_mss (tcp_connection_t *tc)
 
void tcp_init_snd_vars (tcp_connection_t *tc)
 Initialize connection send variables. More...
 
void tcp_enable_pacing (tcp_connection_t *tc)
 
void tcp_connection_init_vars (tcp_connection_t *tc)
 Initialize tcp connection variables. More...
 
static int tcp_alloc_custom_local_endpoint (tcp_main_t *tm, ip46_address_t *lcl_addr, u16 *lcl_port, u8 is_ip4)
 
static int tcp_session_open (transport_endpoint_cfg_t *rmt)
 
u8format_tcp_state (u8 *s, va_list *args)
 
static u8format_tcp_cfg_flags (u8 *s, va_list *args)
 
static u8format_tcp_connection_flags (u8 *s, va_list *args)
 
static u8format_tcp_timers (u8 *s, va_list *args)
 
static u8format_tcp_congestion_status (u8 *s, va_list *args)
 
static i32 tcp_rcv_wnd_available (tcp_connection_t *tc)
 
static u8format_tcp_congestion (u8 *s, va_list *args)
 
static u8format_tcp_stats (u8 *s, va_list *args)
 
static u8format_tcp_vars (u8 *s, va_list *args)
 
u8format_tcp_connection_id (u8 *s, va_list *args)
 
u8format_tcp_connection (u8 *s, va_list *args)
 
static u8format_tcp_session (u8 *s, va_list *args)
 
static u8format_tcp_listener_session (u8 *s, va_list *args)
 
static u8format_tcp_half_open_session (u8 *s, va_list *args)
 
u8format_tcp_sacks (u8 *s, va_list *args)
 
u8format_tcp_rcv_sacks (u8 *s, va_list *args)
 
static u8format_tcp_sack_hole (u8 *s, va_list *args)
 
u8format_tcp_scoreboard (u8 *s, va_list *args)
 
static transport_connection_ttcp_session_get_transport (u32 conn_index, u32 thread_index)
 
static transport_connection_ttcp_half_open_session_get_transport (u32 conn_index)
 
static u16 tcp_session_cal_goal_size (tcp_connection_t *tc)
 
static u16 tcp_session_send_mss (transport_connection_t *trans_conn)
 Compute maximum segment size for session layer. More...
 
static u32 tcp_round_snd_space (tcp_connection_t *tc, u32 snd_space)
 
static u32 tcp_snd_space_inline (tcp_connection_t *tc)
 Compute tx window session is allowed to fill. More...
 
u32 tcp_snd_space (tcp_connection_t *tc)
 
static u32 tcp_session_send_space (transport_connection_t *trans_conn)
 
static u32 tcp_session_tx_fifo_offset (transport_connection_t *trans_conn)
 
static void tcp_update_time (f64 now, u8 thread_index)
 
static void tcp_session_flush_data (transport_connection_t *tconn)
 
void tcp_connection_tx_pacer_update (tcp_connection_t *tc)
 
void tcp_connection_tx_pacer_reset (tcp_connection_t *tc, u32 window, u32 start_bucket)
 
static void tcp_timer_waitclose_handler (u32 conn_index, u32 thread_index)
 
static void tcp_expired_timers_dispatch (u32 *expired_timers)
 
static void tcp_initialize_timer_wheels (tcp_main_t *tm)
 
static void tcp_initialize_iss_seed (tcp_main_t *tm)
 
static clib_error_ttcp_main_enable (vlib_main_t *vm)
 
clib_error_tvnet_tcp_enable_disable (vlib_main_t *vm, u8 is_en)
 
void tcp_punt_unknown (vlib_main_t *vm, u8 is_ip4, u8 is_add)
 
static void tcp_configuration_init (void)
 Initialize default values for tcp parameters. More...
 
static clib_error_ttcp_init (vlib_main_t *vm)
 
uword unformat_tcp_cc_algo (unformat_input_t *input, va_list *va)
 
uword unformat_tcp_cc_algo_cfg (unformat_input_t *input, va_list *va)
 
static clib_error_ttcp_config_fn (vlib_main_t *vm, unformat_input_t *input)
 
int tcp_configure_v4_source_address_range (vlib_main_t *vm, ip4_address_t *start, ip4_address_t *end, u32 table_id)
 Configure an ipv4 source address range. More...
 
int tcp_configure_v6_source_address_range (vlib_main_t *vm, ip6_address_t *start, ip6_address_t *end, u32 table_id)
 Configure an ipv6 source address range. More...
 
static clib_error_ttcp_src_address (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd_arg)
 
static u8tcp_scoreboard_dump_trace (u8 *s, sack_scoreboard_t *sb)
 
static clib_error_ttcp_show_scoreboard_trace_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd_arg)
 
u8tcp_scoreboard_replay (u8 *s, tcp_connection_t *tc, u8 verbose)
 
static clib_error_ttcp_scoreboard_trace_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd_arg)
 
static clib_error_tshow_tcp_punt_fn (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd_arg)
 

Variables

tcp_main_t tcp_main
 
const char * tcp_fsm_states []
 
const char * tcp_cfg_flags_str []
 
const char * tcp_connection_flags_str []
 
const char * tcp_conn_timers []
 
static const transport_proto_vft_t tcp_proto
 
static timer_expiration_handlertimer_expiration_handlers [TCP_N_TIMERS]
 
static vlib_cli_command_t tcp_src_address_command
 (constructor) VLIB_CLI_COMMAND (tcp_src_address_command) More...
 
static vlib_cli_command_t tcp_show_scoreboard_trace_command
 (constructor) VLIB_CLI_COMMAND (tcp_show_scoreboard_trace_command) More...
 
static vlib_cli_command_t tcp_replay_scoreboard_command
 (constructor) VLIB_CLI_COMMAND (tcp_replay_scoreboard_command) More...
 
static vlib_cli_command_t show_tcp_punt_command
 (constructor) VLIB_CLI_COMMAND (show_tcp_punt_command) More...
 

Detailed Description

TCP host stack utilities.

Definition in file tcp.c.

Function Documentation

◆ format_tcp_cfg_flags()

static u8* format_tcp_cfg_flags ( u8 s,
va_list *  args 
)
static

Definition at line 855 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_congestion()

static u8* format_tcp_congestion ( u8 s,
va_list *  args 
)
static

Definition at line 946 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_congestion_status()

static u8* format_tcp_congestion_status ( u8 s,
va_list *  args 
)
static

Definition at line 927 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_connection()

u8* format_tcp_connection ( u8 s,
va_list *  args 
)

Definition at line 1060 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_connection_flags()

static u8* format_tcp_connection_flags ( u8 s,
va_list *  args 
)
static

Definition at line 880 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_connection_id()

u8* format_tcp_connection_id ( u8 s,
va_list *  args 
)

Definition at line 1036 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_half_open_session()

static u8* format_tcp_half_open_session ( u8 s,
va_list *  args 
)
static

Definition at line 1108 of file tcp.c.

◆ format_tcp_listener_session()

static u8* format_tcp_listener_session ( u8 s,
va_list *  args 
)
static

Definition at line 1095 of file tcp.c.

◆ format_tcp_rcv_sacks()

u8* format_tcp_rcv_sacks ( u8 s,
va_list *  args 
)

Definition at line 1141 of file tcp.c.

+ Here is the call graph for this function:

◆ format_tcp_sack_hole()

static u8* format_tcp_sack_hole ( u8 s,
va_list *  args 
)
static

Definition at line 1165 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_sacks()

u8* format_tcp_sacks ( u8 s,
va_list *  args 
)

Definition at line 1117 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_scoreboard()

u8* format_tcp_scoreboard ( u8 s,
va_list *  args 
)

Definition at line 1177 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_session()

static u8* format_tcp_session ( u8 s,
va_list *  args 
)
static

Definition at line 1079 of file tcp.c.

+ Here is the call graph for this function:

◆ format_tcp_state()

u8* format_tcp_state ( u8 s,
va_list *  args 
)

Definition at line 837 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_stats()

static u8* format_tcp_stats ( u8 s,
va_list *  args 
)
static

Definition at line 973 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_timers()

static u8* format_tcp_timers ( u8 s,
va_list *  args 
)
static

Definition at line 905 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_tcp_vars()

static u8* format_tcp_vars ( u8 s,
va_list *  args 
)
static

Definition at line 994 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show_tcp_punt_fn()

static clib_error_t* show_tcp_punt_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd_arg 
)
static

Definition at line 2285 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_add_del_adj_cb()

static void tcp_add_del_adj_cb ( tcp_add_del_adj_args_t args)
static

Definition at line 42 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_add_del_adjacency()

static void tcp_add_del_adjacency ( tcp_connection_t tc,
u8  is_add 
)
static

Definition at line 60 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_alloc_custom_local_endpoint()

static int tcp_alloc_custom_local_endpoint ( tcp_main_t tm,
ip46_address_t *  lcl_addr,
u16 lcl_port,
u8  is_ip4 
)
static

Definition at line 753 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_cc_algo_get()

tcp_cc_algorithm_t* tcp_cc_algo_get ( tcp_cc_algorithm_type_e  type)

Definition at line 98 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_cc_algo_new_type()

tcp_cc_algorithm_type_e tcp_cc_algo_new_type ( const tcp_cc_algorithm_t vft)

Register new cc algo type.

Definition at line 105 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_cc_algo_register()

void tcp_cc_algo_register ( tcp_cc_algorithm_type_e  type,
const tcp_cc_algorithm_t vft 
)

Register exiting cc algo type.

Definition at line 87 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_cc_cleanup()

static void tcp_cc_cleanup ( tcp_connection_t tc)
static

Definition at line 80 of file tcp.c.

+ Here is the caller graph for this function:

◆ tcp_cc_init()

static void tcp_cc_init ( tcp_connection_t tc)
static

Definition at line 74 of file tcp.c.

+ Here is the caller graph for this function:

◆ tcp_config_fn()

static clib_error_t* tcp_config_fn ( vlib_main_t vm,
unformat_input_t input 
)
static

Definition at line 1761 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_configuration_init()

static void tcp_configuration_init ( void  )
static

Initialize default values for tcp parameters.

Definition at line 1658 of file tcp.c.

+ Here is the caller graph for this function:

◆ tcp_configure_v4_source_address_range()

int tcp_configure_v4_source_address_range ( vlib_main_t vm,
ip4_address_t start,
ip4_address_t end,
u32  table_id 
)

Configure an ipv4 source address range.

Parameters
vmvlib_main_t pointer
startfirst ipv4 address in the source address range
endlast ipv4 address in the source address range
table_idVRF / table ID, 0 for the default FIB
Returns
0 if all OK, else an error indication from api_errno.h

Definition at line 1850 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_configure_v6_source_address_range()

int tcp_configure_v6_source_address_range ( vlib_main_t vm,
ip6_address_t start,
ip6_address_t end,
u32  table_id 
)

Configure an ipv6 source address range.

Parameters
vmvlib_main_t pointer
startfirst ipv6 address in the source address range
endlast ipv6 address in the source address range
table_idVRF / table ID, 0 for the default FIB
Returns
0 if all OK, else an error indication from api_errno.h

Definition at line 1938 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_alloc()

tcp_connection_t* tcp_connection_alloc ( u8  thread_index)

Definition at line 299 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_alloc_w_base()

tcp_connection_t* tcp_connection_alloc_w_base ( u8  thread_index,
tcp_connection_t base 
)

Definition at line 312 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_bind()

static u32 tcp_connection_bind ( u32  session_index,
transport_endpoint_t lcl 
)
static

Definition at line 113 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_cleanup()

void tcp_connection_cleanup ( tcp_connection_t tc)

Cleans up connection state.

No notifications.

Definition at line 239 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_close()

void tcp_connection_close ( tcp_connection_t tc)

Begin connection closing procedure.

If at the end the connection is not in CLOSED state, it is not removed. Instead, we rely on on TCP to advance through state machine to either 1) LAST_ACK (passive close) whereby when the last ACK is received tcp_connection_del is called. This notifies session of the delete and calls cleanup. 2) TIME_WAIT (active close) whereby after 2MSL the 2MSL timer triggers and cleanup is called.

N.B. Half-close connections are not supported

Definition at line 402 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_del()

void tcp_connection_del ( tcp_connection_t tc)

Connection removal.

This should be called only once connection enters CLOSED state. Note that it notifies the session of the removal event, so if the goal is to just remove the connection, call tcp_connection_cleanup instead.

Definition at line 292 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_free()

void tcp_connection_free ( tcp_connection_t tc)

Definition at line 325 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_init_vars()

void tcp_connection_init_vars ( tcp_connection_t tc)

Initialize tcp connection variables.

Should be called after having received a msg from the peer, i.e., a SYN or a SYNACK, such that connection options have already been exchanged.

Definition at line 724 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_reset()

void tcp_connection_reset ( tcp_connection_t tc)

Notify session that connection has been reset.

Switch state to closed and wait for session to call cleanup.

Definition at line 343 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_timers_init()

void tcp_connection_timers_init ( tcp_connection_t tc)

Initialize all connection timers as invalid.

Definition at line 503 of file tcp.c.

+ Here is the caller graph for this function:

◆ tcp_connection_timers_reset()

void tcp_connection_timers_reset ( tcp_connection_t tc)

Stop all connection timers.

Definition at line 520 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_tx_pacer_reset()

void tcp_connection_tx_pacer_reset ( tcp_connection_t tc,
u32  window,
u32  start_bucket 
)

Definition at line 1402 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_tx_pacer_update()

void tcp_connection_tx_pacer_update ( tcp_connection_t tc)

Definition at line 1392 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_connection_unbind()

static void tcp_connection_unbind ( u32  listener_index)
static

Definition at line 154 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_enable_pacing()

void tcp_enable_pacing ( tcp_connection_t tc)

Definition at line 711 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_expired_timers_dispatch()

static void tcp_expired_timers_dispatch ( u32 expired_timers)
static

Definition at line 1489 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_generate_random_iss()

static u32 tcp_generate_random_iss ( tcp_connection_t tc)
static

Generate random iss as per rfc6528.

Definition at line 630 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_half_open_connection_cleanup()

int tcp_half_open_connection_cleanup ( tcp_connection_t tc)

Try to cleanup half-open connection.

If called from a thread that doesn't own tc, the call won't have any effect.

Parameters
tc- connection to be cleaned up
Returns
non-zero if cleanup failed.

Definition at line 211 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_half_open_connection_del()

static void tcp_half_open_connection_del ( tcp_connection_t tc)
static

Cleanup half-open connection.

Definition at line 191 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_half_open_connection_new()

static tcp_connection_t* tcp_half_open_connection_new ( void  )
static

Definition at line 222 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_half_open_session_get_transport()

static transport_connection_t* tcp_half_open_session_get_transport ( u32  conn_index)
static

Definition at line 1220 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_init()

static clib_error_t* tcp_init ( vlib_main_t vm)
static

Definition at line 1685 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_init_mss()

static void tcp_init_mss ( tcp_connection_t tc)
static

Definition at line 664 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_init_rcv_mss()

static void tcp_init_rcv_mss ( tcp_connection_t tc)
static

Initialize max segment size we're able to process.

The value is constrained by the output interface's MTU and by the size of the IP and TCP headers (see RFC6691). It is also what we advertise to our peer.

Definition at line 655 of file tcp.c.

+ Here is the caller graph for this function:

◆ tcp_init_snd_vars()

void tcp_init_snd_vars ( tcp_connection_t tc)

Initialize connection send variables.

Definition at line 692 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_initialize_iss_seed()

static void tcp_initialize_iss_seed ( tcp_main_t tm)
static

Definition at line 1542 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_initialize_timer_wheels()

static void tcp_initialize_timer_wheels ( tcp_main_t tm)
static

Definition at line 1527 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_main_enable()

static clib_error_t* tcp_main_enable ( vlib_main_t vm)
static

Definition at line 1552 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_punt_unknown()

void tcp_punt_unknown ( vlib_main_t vm,
u8  is_ip4,
u8  is_add 
)

Definition at line 1645 of file tcp.c.

+ Here is the caller graph for this function:

◆ tcp_rcv_wnd_available()

static i32 tcp_rcv_wnd_available ( tcp_connection_t tc)
static

Definition at line 940 of file tcp.c.

+ Here is the caller graph for this function:

◆ tcp_round_snd_space()

static u32 tcp_round_snd_space ( tcp_connection_t tc,
u32  snd_space 
)
inlinestatic

Definition at line 1261 of file tcp.c.

+ Here is the caller graph for this function:

◆ tcp_scoreboard_dump_trace()

static u8* tcp_scoreboard_dump_trace ( u8 s,
sack_scoreboard_t sb 
)
static

Definition at line 2098 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_scoreboard_replay()

u8* tcp_scoreboard_replay ( u8 s,
tcp_connection_t tc,
u8  verbose 
)

Definition at line 2161 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_scoreboard_trace_fn()

static clib_error_t* tcp_scoreboard_trace_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd_arg 
)
static

Definition at line 2242 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_bind()

static u32 tcp_session_bind ( u32  session_index,
transport_endpoint_t tep 
)
static

Definition at line 148 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_cal_goal_size()

static u16 tcp_session_cal_goal_size ( tcp_connection_t tc)
static

Definition at line 1227 of file tcp.c.

+ Here is the caller graph for this function:

◆ tcp_session_cleanup()

static void tcp_session_cleanup ( u32  conn_index,
u32  thread_index 
)
static

Definition at line 476 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_close()

static void tcp_session_close ( u32  conn_index,
u32  thread_index 
)
static

Definition at line 468 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_flush_data()

static void tcp_session_flush_data ( transport_connection_t tconn)
static

Definition at line 1353 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_get_listener()

static transport_connection_t* tcp_session_get_listener ( u32  listener_index)
static

Definition at line 178 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_get_transport()

static transport_connection_t* tcp_session_get_transport ( u32  conn_index,
u32  thread_index 
)
static

Definition at line 1211 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_open()

static int tcp_session_open ( transport_endpoint_cfg_t rmt)
static

Definition at line 783 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_reset()

static void tcp_session_reset ( u32  conn_index,
u32  thread_index 
)
static

Definition at line 487 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_send_mss()

static u16 tcp_session_send_mss ( transport_connection_t trans_conn)
static

Compute maximum segment size for session layer.

Since the result needs to be the actual data length, it first computes the tcp options to be used in the next burst and subtracts their length from the connection's snd_mss.

Definition at line 1245 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_send_space()

static u32 tcp_session_send_space ( transport_connection_t trans_conn)
static

Definition at line 1324 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_session_tx_fifo_offset()

static u32 tcp_session_tx_fifo_offset ( transport_connection_t trans_conn)
static

Definition at line 1332 of file tcp.c.

◆ tcp_session_unbind()

static u32 tcp_session_unbind ( u32  listener_index)
static

Definition at line 171 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_show_scoreboard_trace_fn()

static clib_error_t* tcp_show_scoreboard_trace_fn ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd_arg 
)
static

Definition at line 2123 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_snd_space()

u32 tcp_snd_space ( tcp_connection_t tc)

Definition at line 1318 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_snd_space_inline()

static u32 tcp_snd_space_inline ( tcp_connection_t tc)
inlinestatic

Compute tx window session is allowed to fill.

Takes into account available send space, snd_mss and the congestion state of the connection. If possible, the value returned is a multiple of snd_mss.

Parameters
tctcp connection
Returns
number of bytes session is allowed to write

Definition at line 1288 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tcp_src_address()

static clib_error_t* tcp_src_address ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd_arg 
)
static

Definition at line 2010 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_timer_waitclose_handler()

static void tcp_timer_waitclose_handler ( u32  conn_index,
u32  thread_index 
)
static

Definition at line 1411 of file tcp.c.

+ Here is the call graph for this function:

◆ tcp_update_time()

static void tcp_update_time ( f64  now,
u8  thread_index 
)
static

Definition at line 1343 of file tcp.c.

+ Here is the call graph for this function:

◆ unformat_tcp_cc_algo()

uword unformat_tcp_cc_algo ( unformat_input_t input,
va_list *  va 
)

Definition at line 1718 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unformat_tcp_cc_algo_cfg()

uword unformat_tcp_cc_algo_cfg ( unformat_input_t input,
va_list *  va 
)

Definition at line 1738 of file tcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vnet_tcp_enable_disable()

clib_error_t* vnet_tcp_enable_disable ( vlib_main_t vm,
u8  is_en 
)

Definition at line 1627 of file tcp.c.

+ Here is the call graph for this function:

Variable Documentation

◆ show_tcp_punt_command

vlib_cli_command_t show_tcp_punt_command
static
Initial value:
=
{
.path = "show tcp punt",
.short_help = "show tcp punt",
.function = show_tcp_punt_fn,
}
static clib_error_t * show_tcp_punt_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd_arg)
Definition: tcp.c:2285

(constructor) VLIB_CLI_COMMAND (show_tcp_punt_command)

Definition at line 2299 of file tcp.c.

◆ tcp_cfg_flags_str

const char* tcp_cfg_flags_str[]
Initial value:
= {
#define _(sym, str)
}
#define foreach_tcp_cfg_flag
Connection configuration flags.
Definition: tcp.h:108

Definition at line 848 of file tcp.c.

◆ tcp_conn_timers

const char* tcp_conn_timers[]
Initial value:
= {
#define _(sym, str)
}
#define foreach_tcp_timer
TCP timers.
Definition: tcp.h:70

Definition at line 898 of file tcp.c.

◆ tcp_connection_flags_str

const char* tcp_connection_flags_str[]
Initial value:
= {
#define _(sym, str)
}
#define foreach_tcp_connection_flag
TCP connection flags.
Definition: tcp.h:131

Definition at line 873 of file tcp.c.

◆ tcp_fsm_states

const char* tcp_fsm_states[]
Initial value:
= {
#define _(sym, str)
}
#define foreach_tcp_fsm_state
TCP FSM state definitions as per RFC793.
Definition: tcp.h:43

Definition at line 830 of file tcp.c.

◆ tcp_main

tcp_main_t tcp_main

Definition at line 30 of file tcp.c.

◆ tcp_proto

const transport_proto_vft_t tcp_proto
static
Initial value:
= {
.start_listen = tcp_session_bind,
.stop_listen = tcp_session_unbind,
.push_header = tcp_session_push_header,
.get_connection = tcp_session_get_transport,
.get_listener = tcp_session_get_listener,
.connect = tcp_session_open,
.cleanup = tcp_session_cleanup,
.send_mss = tcp_session_send_mss,
.send_space = tcp_session_send_space,
.update_time = tcp_update_time,
.tx_fifo_offset = tcp_session_tx_fifo_offset,
.flush_data = tcp_session_flush_data,
.custom_tx = tcp_session_custom_tx,
.format_connection = format_tcp_session,
.format_listener = format_tcp_listener_session,
.format_half_open = format_tcp_half_open_session,
.transport_options = {
.tx_type = TRANSPORT_TX_PEEK,
.service_type = TRANSPORT_SERVICE_VC,
},
}
static void tcp_session_close(u32 conn_index, u32 thread_index)
Definition: tcp.c:468
static u8 * format_tcp_listener_session(u8 *s, va_list *args)
Definition: tcp.c:1095
static u32 tcp_session_send_space(transport_connection_t *trans_conn)
Definition: tcp.c:1324
static transport_connection_t * tcp_half_open_session_get_transport(u32 conn_index)
Definition: tcp.c:1220
static u32 tcp_session_tx_fifo_offset(transport_connection_t *trans_conn)
Definition: tcp.c:1332
u32 tcp_session_push_header(transport_connection_t *tconn, vlib_buffer_t *b)
Definition: tcp_output.c:1134
static u16 tcp_session_send_mss(transport_connection_t *trans_conn)
Compute maximum segment size for session layer.
Definition: tcp.c:1245
static u32 tcp_session_unbind(u32 listener_index)
Definition: tcp.c:171
static transport_connection_t * tcp_session_get_transport(u32 conn_index, u32 thread_index)
Definition: tcp.c:1211
static transport_connection_t * tcp_session_get_listener(u32 listener_index)
Definition: tcp.c:178
static void tcp_session_cleanup(u32 conn_index, u32 thread_index)
Definition: tcp.c:476
clib_error_t * vnet_tcp_enable_disable(vlib_main_t *vm, u8 is_en)
Definition: tcp.c:1627
virtual circuit service
static void tcp_session_flush_data(transport_connection_t *tconn)
Definition: tcp.c:1353
static int tcp_session_open(transport_endpoint_cfg_t *rmt)
Definition: tcp.c:783
reliable transport protos
static u32 tcp_session_bind(u32 session_index, transport_endpoint_t *tep)
Definition: tcp.c:148
static u8 * format_tcp_session(u8 *s, va_list *args)
Definition: tcp.c:1079
static u8 * format_tcp_half_open_session(u8 *s, va_list *args)
Definition: tcp.c:1108
static void tcp_update_time(f64 now, u8 thread_index)
Definition: tcp.c:1343
static void tcp_session_reset(u32 conn_index, u32 thread_index)
Definition: tcp.c:487
int tcp_session_custom_tx(void *conn, u32 max_burst_size)
Definition: tcp_output.c:2178

Definition at line 1363 of file tcp.c.

◆ tcp_replay_scoreboard_command

vlib_cli_command_t tcp_replay_scoreboard_command
static
Initial value:
=
{
.path = "tcp replay scoreboard",
.short_help = "tcp replay scoreboard <connection>",
}
static clib_error_t * tcp_scoreboard_trace_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd_arg)
Definition: tcp.c:2242

(constructor) VLIB_CLI_COMMAND (tcp_replay_scoreboard_command)

Definition at line 2276 of file tcp.c.

◆ tcp_show_scoreboard_trace_command

vlib_cli_command_t tcp_show_scoreboard_trace_command
static
Initial value:
=
{
.path = "show tcp scoreboard trace",
.short_help = "show tcp scoreboard trace <connection>",
}
static clib_error_t * tcp_show_scoreboard_trace_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd_arg)
Definition: tcp.c:2123

(constructor) VLIB_CLI_COMMAND (tcp_show_scoreboard_trace_command)

Definition at line 2152 of file tcp.c.

◆ tcp_src_address_command

vlib_cli_command_t tcp_src_address_command
static
Initial value:
=
{
.path = "tcp src-address",
.short_help = "tcp src-address <ip-addr> [- <ip-addr>] add src address range",
.function = tcp_src_address,
}
static clib_error_t * tcp_src_address(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd_arg)
Definition: tcp.c:2010

(constructor) VLIB_CLI_COMMAND (tcp_src_address_command)

Definition at line 2089 of file tcp.c.

◆ timer_expiration_handlers

timer_expiration_handler* timer_expiration_handlers[TCP_N_TIMERS]
static
Initial value:
=
{
}
timer_expiration_handler tcp_timer_retransmit_handler
timer_expiration_handler tcp_timer_retransmit_syn_handler
timer_expiration_handler tcp_timer_persist_handler
static void tcp_timer_waitclose_handler(u32 conn_index, u32 thread_index)
Definition: tcp.c:1411
timer_expiration_handler tcp_timer_delack_handler

Definition at line 1478 of file tcp.c.