FD.io VPP  v19.01.2-3-gf61a1a8
Vector Packet Processing
tcp_output.c File Reference
+ Include dependency graph for tcp_output.c:

Go to the source code of this file.

Data Structures

struct  tcp_tx_trace_t
 

Macros

#define foreach_tcp4_output_next
 
#define foreach_tcp6_output_next
 
#define tcp_error(n, s)   s,
 
#define scoreboard_rescue_rxt_valid(_sb, _tc)
 
#define foreach_tcp4_reset_next
 
#define foreach_tcp6_reset_next
 

Typedefs

typedef enum _tcp_output_next tcp_output_next_t
 
typedef enum _tcp_reset_next tcp_reset_next_t
 

Functions

u8format_tcp_tx_trace (u8 *s, va_list *args)
 
static u8 tcp_window_compute_scale (u32 window)
 
void tcp_update_rcv_mss (tcp_connection_t *tc)
 Update max segment size we're able to process. More...
 
static u32 tcp_initial_wnd_unscaled (tcp_connection_t *tc)
 TCP's initial window. More...
 
u32 tcp_initial_window_to_advertise (tcp_connection_t *tc)
 Compute initial window and scale factor. More...
 
static void tcp_update_rcv_wnd (tcp_connection_t *tc)
 
static u32 tcp_window_to_advertise (tcp_connection_t *tc, tcp_state_t state)
 Compute and return window to advertise, scaled as per RFC1323. More...
 
static u32 tcp_options_write (u8 *data, tcp_options_t *opts)
 Write TCP options to segment. More...
 
static int tcp_make_syn_options (tcp_options_t *opts, u8 wnd_scale)
 
static int tcp_make_synack_options (tcp_connection_t *tc, tcp_options_t *opts)
 
static int tcp_make_established_options (tcp_connection_t *tc, tcp_options_t *opts)
 
static int tcp_make_options (tcp_connection_t *tc, tcp_options_t *opts, tcp_state_t state)
 
void tcp_update_burst_snd_vars (tcp_connection_t *tc)
 Update burst send vars. More...
 
void tcp_init_mss (tcp_connection_t *tc)
 
static int tcp_alloc_tx_buffers (tcp_worker_ctx_t *wrk, u16 *n_bufs, u32 wanted)
 
static int tcp_get_free_buffer_index (tcp_worker_ctx_t *wrk, u32 *bidx)
 
static void * tcp_reuse_buffer (vlib_main_t *vm, vlib_buffer_t *b)
 
static void * tcp_init_buffer (vlib_main_t *vm, vlib_buffer_t *b)
 
static void tcp_make_ack_i (tcp_connection_t *tc, vlib_buffer_t *b, tcp_state_t state, u8 flags)
 Prepare ACK. More...
 
void tcp_make_ack (tcp_connection_t *tc, vlib_buffer_t *b)
 Convert buffer to ACK. More...
 
void tcp_make_fin (tcp_connection_t *tc, vlib_buffer_t *b)
 Convert buffer to FIN-ACK. More...
 
void tcp_make_syn (tcp_connection_t *tc, vlib_buffer_t *b)
 Convert buffer to SYN. More...
 
void tcp_make_synack (tcp_connection_t *tc, vlib_buffer_t *b)
 Convert buffer to SYN-ACK. More...
 
static void tcp_enqueue_to_ip_lookup_i (tcp_worker_ctx_t *wrk, vlib_buffer_t *b, u32 bi, u8 is_ip4, u32 fib_index, u8 flush)
 
static void tcp_enqueue_to_ip_lookup_now (tcp_worker_ctx_t *wrk, vlib_buffer_t *b, u32 bi, u8 is_ip4, u32 fib_index)
 
static void tcp_enqueue_to_ip_lookup (tcp_worker_ctx_t *wrk, vlib_buffer_t *b, u32 bi, u8 is_ip4, u32 fib_index)
 
static void tcp_enqueue_to_output_i (tcp_worker_ctx_t *wrk, vlib_buffer_t *b, u32 bi, u8 is_ip4, u8 flush)
 
static void tcp_enqueue_to_output (tcp_worker_ctx_t *wrk, vlib_buffer_t *b, u32 bi, u8 is_ip4)
 
static void tcp_enqueue_to_output_now (tcp_worker_ctx_t *wrk, vlib_buffer_t *b, u32 bi, u8 is_ip4)
 
static int tcp_make_reset_in_place (vlib_main_t *vm, vlib_buffer_t *b0, tcp_state_t state, u8 thread_index, u8 is_ip4)
 
void tcp_send_reset_w_pkt (tcp_connection_t *tc, vlib_buffer_t *pkt, u32 thread_index, u8 is_ip4)
 Send reset without reusing existing buffer. More...
 
void tcp_send_reset (tcp_connection_t *tc)
 Build and set reset packet for connection. More...
 
static void tcp_push_ip_hdr (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, vlib_buffer_t *b)
 
void tcp_send_syn (tcp_connection_t *tc)
 Send SYN. More...
 
void tcp_send_synack (tcp_connection_t *tc)
 
void tcp_flush_frame_to_output (tcp_worker_ctx_t *wrk, u8 is_ip4)
 Flush tx frame populated by retransmits and timer pops. More...
 
static void tcp_flush_frame_to_ip_lookup (tcp_worker_ctx_t *wrk, u8 is_ip4)
 Flush ip lookup tx frames populated by timer pops. More...
 
void tcp_flush_frames_to_output (tcp_worker_ctx_t *wrk)
 Flush v4 and v6 tcp and ip-lookup tx frames for thread index. More...
 
void tcp_send_fin (tcp_connection_t *tc)
 Send FIN. More...
 
static u8 tcp_make_state_flags (tcp_connection_t *tc, tcp_state_t next_state)
 
static void tcp_push_hdr_i (tcp_connection_t *tc, vlib_buffer_t *b, tcp_state_t next_state, u8 compute_opts, u8 maybe_burst)
 Push TCP header and update connection variables. More...
 
u32 tcp_push_header (tcp_connection_t *tc, vlib_buffer_t *b)
 
void tcp_send_ack (tcp_connection_t *tc)
 
void tcp_program_ack (tcp_worker_ctx_t *wrk, tcp_connection_t *tc)
 
void tcp_program_dupack (tcp_worker_ctx_t *wrk, tcp_connection_t *tc)
 
void tcp_send_acks (tcp_worker_ctx_t *wrk)
 
void tcp_timer_delack_handler (u32 index)
 Delayed ack timer handler. More...
 
static int tcp_prepare_segment (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, u32 offset, u32 max_deq_bytes, vlib_buffer_t **b)
 Allocate a new buffer and build a new tcp segment. More...
 
static u32 tcp_prepare_retransmit_segment (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, u32 offset, u32 max_deq_bytes, vlib_buffer_t **b)
 Build a retransmit segment. More...
 
static void tcp_rxt_timeout_cc (tcp_connection_t *tc)
 Reset congestion control, switch cwnd to loss window and try again. More...
 
static void tcp_timer_retransmit_handler_i (u32 index, u8 is_syn)
 
void tcp_timer_retransmit_handler (u32 index)
 
void tcp_timer_retransmit_syn_handler (u32 index)
 
void tcp_timer_persist_handler (u32 index)
 Got 0 snd_wnd from peer, try to do something about it. More...
 
int tcp_retransmit_first_unacked (tcp_worker_ctx_t *wrk, tcp_connection_t *tc)
 Retransmit first unacked segment. More...
 
static int tcp_fast_retransmit_unsent (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, u32 burst_size)
 
int tcp_fast_retransmit_sack (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, u32 burst_size)
 Do fast retransmit with SACKs. More...
 
int tcp_fast_retransmit_no_sack (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, u32 burst_size)
 Fast retransmit without SACK info. More...
 
int tcp_fast_retransmit (tcp_worker_ctx_t *wrk, tcp_connection_t *tc, u32 burst_size)
 Do fast retransmit. More...
 
static void tcp_output_handle_link_local (tcp_connection_t *tc0, vlib_buffer_t *b0, u16 *next0, u32 *error0)
 
static void tcp46_output_trace_frame (vlib_main_t *vm, vlib_node_runtime_t *node, u32 *to_next, u32 n_bufs)
 
static void tcp_output_push_ip (vlib_main_t *vm, vlib_buffer_t *b0, tcp_connection_t *tc0, u8 is_ip4)
 
static void tcp_output_handle_packet (tcp_connection_t *tc0, vlib_buffer_t *b0, u32 *error0, u16 *next0, u8 is_ip4)
 
static uword tcp46_output_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_ip4)
 
static uword tcp4_output (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword tcp6_output (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (tcp4_output_node, tcp4_output)
 
 VLIB_NODE_FUNCTION_MULTIARCH (tcp6_output_node, tcp6_output)
 
static uword tcp46_send_reset_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame, u8 is_ip4)
 
static uword tcp4_send_reset (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
static uword tcp6_send_reset (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
 
 VLIB_NODE_FUNCTION_MULTIARCH (tcp4_reset_node, tcp4_send_reset)
 
 VLIB_NODE_FUNCTION_MULTIARCH (tcp6_reset_node, tcp6_send_reset)
 

Variables

vlib_node_registration_t tcp4_output_node
 (constructor) VLIB_REGISTER_NODE (tcp4_output_node) More...
 
vlib_node_registration_t tcp6_output_node
 (constructor) VLIB_REGISTER_NODE (tcp6_output_node) More...
 
static char * tcp_error_strings []
 
u16 dummy_mtu = 1460
 
vlib_node_registration_t tcp4_reset_node
 (constructor) VLIB_REGISTER_NODE (tcp4_reset_node) More...
 
vlib_node_registration_t tcp6_reset_node
 (constructor) VLIB_REGISTER_NODE (tcp6_reset_node) More...
 

Macro Definition Documentation

#define foreach_tcp4_output_next
Value:
_ (DROP, "error-drop") \
_ (IP_LOOKUP, "ip4-lookup") \
_ (IP_REWRITE, "ip4-rewrite") \
_ (IP_ARP, "ip4-arp")
DROP
Definition: error.def:41

Definition at line 32 of file tcp_output.c.

#define foreach_tcp4_reset_next
Value:
_(DROP, "error-drop") \
_(IP_LOOKUP, "ip4-lookup")
DROP
Definition: error.def:41

Definition at line 2278 of file tcp_output.c.

#define foreach_tcp6_output_next
Value:
_ (DROP, "error-drop") \
_ (IP_LOOKUP, "ip6-lookup") \
_ (IP_REWRITE, "ip6-rewrite") \
_ (IP_ARP, "ip6-discover-neighbor")
DROP
Definition: error.def:41

Definition at line 38 of file tcp_output.c.

#define foreach_tcp6_reset_next
Value:
_(DROP, "error-drop") \
_(IP_LOOKUP, "ip6-lookup")
DROP
Definition: error.def:41

Definition at line 2282 of file tcp_output.c.

#define scoreboard_rescue_rxt_valid (   _sb,
  _tc 
)
Value:
(seq_geq (_sb->rescue_rxt, _tc->snd_una) \
&& seq_leq (_sb->rescue_rxt, _tc->snd_congestion))
#define seq_leq(_s1, _s2)
Definition: tcp.h:646
#define seq_geq(_s1, _s2)
Definition: tcp.h:648

Definition at line 1832 of file tcp_output.c.

#define tcp_error (   n,
 
)    s,

Typedef Documentation

typedef enum _tcp_output_next tcp_output_next_t
typedef enum _tcp_reset_next tcp_reset_next_t

Function Documentation

u8* format_tcp_tx_trace ( u8 s,
va_list *  args 
)

Definition at line 59 of file tcp_output.c.

+ Here is the call graph for this function:

static uword tcp46_output_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame,
int  is_ip4 
)
inlinestatic

Definition at line 2136 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp46_output_trace_frame ( vlib_main_t vm,
vlib_node_runtime_t node,
u32 to_next,
u32  n_bufs 
)
static

Definition at line 2060 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword tcp46_send_reset_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame,
u8  is_ip4 
)
static

Definition at line 2287 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static uword tcp4_output ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 2212 of file tcp_output.c.

+ Here is the call graph for this function:

static uword tcp4_send_reset ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 2357 of file tcp_output.c.

+ Here is the call graph for this function:

static uword tcp6_output ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 2219 of file tcp_output.c.

+ Here is the call graph for this function:

static uword tcp6_send_reset ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t from_frame 
)
static

Definition at line 2364 of file tcp_output.c.

+ Here is the call graph for this function:

static int tcp_alloc_tx_buffers ( tcp_worker_ctx_t wrk,
u16 n_bufs,
u32  wanted 
)
static

Definition at line 468 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_enqueue_to_ip_lookup ( tcp_worker_ctx_t wrk,
vlib_buffer_t b,
u32  bi,
u8  is_ip4,
u32  fib_index 
)
static

Definition at line 690 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_enqueue_to_ip_lookup_i ( tcp_worker_ctx_t wrk,
vlib_buffer_t b,
u32  bi,
u8  is_ip4,
u32  fib_index,
u8  flush 
)
inlinestatic

Definition at line 647 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_enqueue_to_ip_lookup_now ( tcp_worker_ctx_t wrk,
vlib_buffer_t b,
u32  bi,
u8  is_ip4,
u32  fib_index 
)
static

Definition at line 683 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_enqueue_to_output ( tcp_worker_ctx_t wrk,
vlib_buffer_t b,
u32  bi,
u8  is_ip4 
)
static

Definition at line 731 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_enqueue_to_output_i ( tcp_worker_ctx_t wrk,
vlib_buffer_t b,
u32  bi,
u8  is_ip4,
u8  flush 
)
inlinestatic

Definition at line 699 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_enqueue_to_output_now ( tcp_worker_ctx_t wrk,
vlib_buffer_t b,
u32  bi,
u8  is_ip4 
)
static

Definition at line 738 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tcp_fast_retransmit ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
u32  burst_size 
)

Do fast retransmit.

Definition at line 2018 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tcp_fast_retransmit_no_sack ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
u32  burst_size 
)

Fast retransmit without SACK info.

Definition at line 1949 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tcp_fast_retransmit_sack ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
u32  burst_size 
)

Do fast retransmit with SACKs.

Definition at line 1840 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int tcp_fast_retransmit_unsent ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
u32  burst_size 
)
static

Definition at line 1807 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_flush_frame_to_ip_lookup ( tcp_worker_ctx_t wrk,
u8  is_ip4 
)
static

Flush ip lookup tx frames populated by timer pops.

Definition at line 1056 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_flush_frame_to_output ( tcp_worker_ctx_t wrk,
u8  is_ip4 
)

Flush tx frame populated by retransmits and timer pops.

Definition at line 1041 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_flush_frames_to_output ( tcp_worker_ctx_t wrk)

Flush v4 and v6 tcp and ip-lookup tx frames for thread index.

Definition at line 1072 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int tcp_get_free_buffer_index ( tcp_worker_ctx_t wrk,
u32 bidx 
)
inlinestatic

Definition at line 483 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* tcp_init_buffer ( vlib_main_t vm,
vlib_buffer_t b 
)
static

Definition at line 519 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_init_mss ( tcp_connection_t tc)

Definition at line 444 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 tcp_initial_window_to_advertise ( tcp_connection_t tc)

Compute initial window and scale factor.

As per RFC1323, window field in SYN and SYN-ACK segments is never scaled.

Definition at line 119 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_initial_wnd_unscaled ( tcp_connection_t tc)
inlinestatic

TCP's initial window.

Definition at line 100 of file tcp_output.c.

+ Here is the caller graph for this function:

void tcp_make_ack ( tcp_connection_t tc,
vlib_buffer_t b 
)

Convert buffer to ACK.

Definition at line 561 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_make_ack_i ( tcp_connection_t tc,
vlib_buffer_t b,
tcp_state_t  state,
u8  flags 
)
static

Prepare ACK.

Definition at line 536 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int tcp_make_established_options ( tcp_connection_t tc,
tcp_options_t opts 
)
static

Definition at line 358 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_make_fin ( tcp_connection_t tc,
vlib_buffer_t b 
)

Convert buffer to FIN-ACK.

Definition at line 575 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int tcp_make_options ( tcp_connection_t tc,
tcp_options_t opts,
tcp_state_t  state 
)
inlinestatic

Definition at line 389 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int tcp_make_reset_in_place ( vlib_main_t vm,
vlib_buffer_t b0,
tcp_state_t  state,
u8  thread_index,
u8  is_ip4 
)
static

Definition at line 745 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 tcp_make_state_flags ( tcp_connection_t tc,
tcp_state_t  next_state 
)
inlinestatic

Definition at line 1127 of file tcp_output.c.

+ Here is the caller graph for this function:

void tcp_make_syn ( tcp_connection_t tc,
vlib_buffer_t b 
)

Convert buffer to SYN.

Definition at line 593 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int tcp_make_syn_options ( tcp_options_t opts,
u8  wnd_scale 
)
static

Definition at line 294 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_make_synack ( tcp_connection_t tc,
vlib_buffer_t b 
)

Convert buffer to SYN-ACK.

Definition at line 618 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int tcp_make_synack_options ( tcp_connection_t tc,
tcp_options_t opts 
)
static

Definition at line 323 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_options_write ( u8 data,
tcp_options_t opts 
)
static

Write TCP options to segment.

Definition at line 211 of file tcp_output.c.

+ Here is the caller graph for this function:

static void tcp_output_handle_link_local ( tcp_connection_t tc0,
vlib_buffer_t b0,
u16 next0,
u32 error0 
)
static

Definition at line 2028 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_output_handle_packet ( tcp_connection_t tc0,
vlib_buffer_t b0,
u32 error0,
u16 next0,
u8  is_ip4 
)
inlinestatic

Definition at line 2111 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_output_push_ip ( vlib_main_t vm,
vlib_buffer_t b0,
tcp_connection_t tc0,
u8  is_ip4 
)
inlinestatic

Definition at line 2083 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 tcp_prepare_retransmit_segment ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
u32  offset,
u32  max_deq_bytes,
vlib_buffer_t **  b 
)
static

Build a retransmit segment.

Returns
the number of bytes in the segment or 0 if there's nothing to retransmit

Definition at line 1446 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int tcp_prepare_segment ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
u32  offset,
u32  max_deq_bytes,
vlib_buffer_t **  b 
)
static

Allocate a new buffer and build a new tcp segment.

Parameters
wrktcp worker
tcconnection for which the segment will be allocated
offsetoffset of the first byte in the tx fifo
max_deq_bytesegment size
[out]bpointer to buffer allocated
Returns
the number of bytes in the segment or 0 if buffer cannot be allocated or no data available

Definition at line 1336 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_program_ack ( tcp_worker_ctx_t wrk,
tcp_connection_t tc 
)

Definition at line 1258 of file tcp_output.c.

+ Here is the caller graph for this function:

void tcp_program_dupack ( tcp_worker_ctx_t wrk,
tcp_connection_t tc 
)

Definition at line 1268 of file tcp_output.c.

+ Here is the caller graph for this function:

static void tcp_push_hdr_i ( tcp_connection_t tc,
vlib_buffer_t b,
tcp_state_t  next_state,
u8  compute_opts,
u8  maybe_burst 
)
inlinestatic

Push TCP header and update connection variables.

Definition at line 1157 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u32 tcp_push_header ( tcp_connection_t tc,
vlib_buffer_t b 
)

Definition at line 1216 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_push_ip_hdr ( tcp_worker_ctx_t wrk,
tcp_connection_t tc,
vlib_buffer_t b 
)
static

Definition at line 955 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tcp_retransmit_first_unacked ( tcp_worker_ctx_t wrk,
tcp_connection_t tc 
)

Retransmit first unacked segment.

Definition at line 1784 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void* tcp_reuse_buffer ( vlib_main_t vm,
vlib_buffer_t b 
)
static

Definition at line 503 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void tcp_rxt_timeout_cc ( tcp_connection_t tc)
static

Reset congestion control, switch cwnd to loss window and try again.

Definition at line 1497 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_ack ( tcp_connection_t tc)

Definition at line 1239 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_acks ( tcp_worker_ctx_t wrk)

Definition at line 1280 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_fin ( tcp_connection_t tc)

Send FIN.

Definition at line 1084 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_reset ( tcp_connection_t tc)

Build and set reset packet for connection.

Definition at line 909 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_reset_w_pkt ( tcp_connection_t tc,
vlib_buffer_t pkt,
u32  thread_index,
u8  is_ip4 
)

Send reset without reusing existing buffer.

It extracts connection info out of original packet

Definition at line 829 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_syn ( tcp_connection_t tc)

Send SYN.

Builds a SYN packet for a half-open connection and sends it to ipx_lookup. The packet is not forwarded through tcpx_output to avoid doing lookups in the half_open pool.

Definition at line 987 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_send_synack ( tcp_connection_t tc)

Definition at line 1020 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_timer_delack_handler ( u32  index)

Delayed ack timer handler.

Sends delayed ACK when timer expires

Definition at line 1313 of file tcp_output.c.

+ Here is the call graph for this function:

void tcp_timer_persist_handler ( u32  index)

Got 0 snd_wnd from peer, try to do something about it.

Definition at line 1704 of file tcp_output.c.

+ Here is the call graph for this function:

void tcp_timer_retransmit_handler ( u32  index)

Definition at line 1688 of file tcp_output.c.

+ Here is the call graph for this function:

static void tcp_timer_retransmit_handler_i ( u32  index,
u8  is_syn 
)
inlinestatic

Definition at line 1522 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_timer_retransmit_syn_handler ( u32  index)

Definition at line 1694 of file tcp_output.c.

+ Here is the call graph for this function:

void tcp_update_burst_snd_vars ( tcp_connection_t tc)

Update burst send vars.

  • Updates snd_mss to reflect the effective segment size that we can send by taking into account all TCP options, including SACKs.
  • Cache 'on the wire' options for reuse
  • Updates receive window which can be reused for a burst.

This should only be called when doing bursts

Definition at line 424 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void tcp_update_rcv_mss ( tcp_connection_t tc)

Update max segment size we're able to process.

The value is constrained by our interface's MTU and IP options. It is also what we advertise to our peer.

Definition at line 90 of file tcp_output.c.

+ Here is the caller graph for this function:

static void tcp_update_rcv_wnd ( tcp_connection_t tc)
static

Definition at line 139 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u8 tcp_window_compute_scale ( u32  window)
static

Definition at line 75 of file tcp_output.c.

+ Here is the caller graph for this function:

static u32 tcp_window_to_advertise ( tcp_connection_t tc,
tcp_state_t  state 
)
static

Compute and return window to advertise, scaled as per RFC1323.

Definition at line 188 of file tcp_output.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

VLIB_NODE_FUNCTION_MULTIARCH ( tcp4_output_node  ,
tcp4_output   
)
VLIB_NODE_FUNCTION_MULTIARCH ( tcp6_output_node  ,
tcp6_output   
)
VLIB_NODE_FUNCTION_MULTIARCH ( tcp4_reset_node  ,
tcp4_send_reset   
)
VLIB_NODE_FUNCTION_MULTIARCH ( tcp6_reset_node  ,
tcp6_send_reset   
)

Variable Documentation

u16 dummy_mtu = 1460

Definition at line 56 of file tcp_output.c.

vlib_node_registration_t tcp4_output_node
Initial value:
=
{
.function = tcp4_output,
.name = "tcp4-output",
.vector_size = sizeof (u32),
.n_errors = TCP_N_ERROR,
.protocol_hint = VLIB_NODE_PROTO_HINT_TCP,
.error_strings = tcp_error_strings,
.n_next_nodes = TCP_OUTPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_buffer = format_tcp_header,
.format_trace = format_tcp_tx_trace,
}
u8 * format_tcp_tx_trace(u8 *s, va_list *args)
Definition: tcp_output.c:59
unsigned int u32
Definition: types.h:88
#define foreach_tcp4_output_next
Definition: tcp_output.c:32
format_function_t format_tcp_header
Definition: format.h:101
static char * tcp_error_strings[]
Definition: tcp_output.c:44
static uword tcp4_output(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: tcp_output.c:2212

(constructor) VLIB_REGISTER_NODE (tcp4_output_node)

Definition at line 20 of file tcp_output.c.

vlib_node_registration_t tcp4_reset_node
Initial value:
= {
.function = tcp4_send_reset,
.name = "tcp4-reset",
.vector_size = sizeof (u32),
.n_errors = TCP_N_ERROR,
.error_strings = tcp_error_strings,
.n_next_nodes = TCP_RESET_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_trace = format_tcp_tx_trace,
}
static uword tcp4_send_reset(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: tcp_output.c:2357
#define foreach_tcp4_reset_next
Definition: tcp_output.c:2278
u8 * format_tcp_tx_trace(u8 *s, va_list *args)
Definition: tcp_output.c:59
unsigned int u32
Definition: types.h:88
static char * tcp_error_strings[]
Definition: tcp_output.c:44

(constructor) VLIB_REGISTER_NODE (tcp4_reset_node)

Definition at line 2371 of file tcp_output.c.

vlib_node_registration_t tcp6_output_node
Initial value:
=
{
.function = tcp6_output,
.name = "tcp6-output",
.vector_size = sizeof (u32),
.n_errors = TCP_N_ERROR,
.protocol_hint = VLIB_NODE_PROTO_HINT_TCP,
.error_strings = tcp_error_strings,
.n_next_nodes = TCP_OUTPUT_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_buffer = format_tcp_header,
.format_trace = format_tcp_tx_trace,
}
u8 * format_tcp_tx_trace(u8 *s, va_list *args)
Definition: tcp_output.c:59
unsigned int u32
Definition: types.h:88
#define foreach_tcp6_output_next
Definition: tcp_output.c:38
format_function_t format_tcp_header
Definition: format.h:101
static uword tcp6_output(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: tcp_output.c:2219
static char * tcp_error_strings[]
Definition: tcp_output.c:44

(constructor) VLIB_REGISTER_NODE (tcp6_output_node)

Definition at line 21 of file tcp_output.c.

vlib_node_registration_t tcp6_reset_node
Initial value:
= {
.function = tcp6_send_reset,
.name = "tcp6-reset",
.vector_size = sizeof (u32),
.n_errors = TCP_N_ERROR,
.error_strings = tcp_error_strings,
.n_next_nodes = TCP_RESET_N_NEXT,
.next_nodes = {
#define _(s,n)
},
.format_trace = format_tcp_tx_trace,
}
u8 * format_tcp_tx_trace(u8 *s, va_list *args)
Definition: tcp_output.c:59
unsigned int u32
Definition: types.h:88
static uword tcp6_send_reset(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *from_frame)
Definition: tcp_output.c:2364
#define foreach_tcp6_reset_next
Definition: tcp_output.c:2282
static char * tcp_error_strings[]
Definition: tcp_output.c:44

(constructor) VLIB_REGISTER_NODE (tcp6_reset_node)

Definition at line 2390 of file tcp_output.c.

char* tcp_error_strings[]
static
Initial value:
= {
#define tcp_error(n,s)
}

Definition at line 44 of file tcp_output.c.