format_white_space, indent, tc->snd_congestion - tc->iss,
tc->rcv_dupacks, tc->limited_transmit - tc->iss);
s = format (s, "%Urxt_bytes %u rxt_delivered %u rxt_head %u rxt_ts %u\n",
- format_white_space, indent, tc->snd_rxt_bytes,
- tc->rxt_delivered, tc->rxt_head - tc->iss,
- tcp_time_now_w_thread (tc->c_thread_index) - tc->snd_rxt_ts);
+ format_white_space, indent, tc->snd_rxt_bytes, tc->rxt_delivered,
+ tc->rxt_head - tc->iss, tcp_tstamp (tc) - tc->snd_rxt_ts);
if (tcp_in_fastrecovery (tc))
prr_space = tcp_fastrecovery_prr_snd_space (tc);
s = format (s, "%Uprr_start %u prr_delivered %u prr space %u\n",
s = format (s, " index: %u cfg: %U flags: %U timers: %U\n", tc->c_c_index,
format_tcp_cfg_flags, tc, format_tcp_connection_flags, tc,
format_tcp_timers, tc);
- s = format (s, " snd_una %u snd_nxt %u snd_una_max %u",
- tc->snd_una - tc->iss, tc->snd_nxt - tc->iss,
- tc->snd_una_max - tc->iss);
+ s = format (s, " snd_una %u snd_nxt %u", tc->snd_una - tc->iss,
+ tc->snd_nxt - tc->iss);
s = format (s, " rcv_nxt %u rcv_las %u\n",
tc->rcv_nxt - tc->irs, tc->rcv_las - tc->irs);
s = format (s, " snd_wnd %u rcv_wnd %u rcv_wscale %u ",
s = format (s, " tsval_recent %u\n", tc->tsval_recent);
s = format (s, " tsecr %u tsecr_last_ack %u tsval_recent_age %u",
tc->rcv_opts.tsecr, tc->tsecr_last_ack,
- tcp_time_now () - tc->tsval_recent_age);
+ tcp_time_tstamp (tc->c_thread_index) - tc->tsval_recent_age);
s = format (s, " snd_mss %u\n", tc->snd_mss);
- s = format (s, " rto %u rto_boff %u srtt %u us %.3f rttvar %u rtt_ts %.4f",
- tc->rto, tc->rto_boff, tc->srtt, tc->mrtt_us * 1000, tc->rttvar,
- tc->rtt_ts);
- s = format (s, " rtt_seq %u\n", tc->rtt_seq - tc->iss);
- s = format (s, " next_node %u opaque 0x%x fib_index %u\n",
- tc->next_node_index, tc->next_node_opaque, tc->c_fib_index);
+ s = format (s, " rto %u rto_boff %u srtt %.1f us %.3f rttvar %.1f",
+ tc->rto / 1000, tc->rto_boff, tc->srtt / 1000.0,
+ tc->mrtt_us * 1e3, tc->rttvar / 1000.0);
+ s = format (s, " rtt_ts %.4f rtt_seq %u\n", tc->rtt_ts,
+ tc->rtt_seq - tc->iss);
+ s = format (s, " next_node %u opaque 0x%x fib_index %u sw_if_index %d\n",
+ tc->next_node_index, tc->next_node_opaque, tc->c_fib_index,
+ tc->sw_if_index);
s = format (s, " cong: %U", format_tcp_congestion, tc);
if (tc->state >= TCP_STATE_ESTABLISHED)
if (!tc)
return s;
- s = format (s, "%-50U", format_tcp_connection_id, tc);
+ s = format (s, "%-" SESSION_CLI_ID_LEN "U", format_tcp_connection_id, tc);
if (verbose)
{
- s = format (s, "%-15U", format_tcp_state, tc->state);
+ s = format (s, "%-" SESSION_CLI_STATE_LEN "U", format_tcp_state,
+ tc->state);
if (verbose > 1)
s = format (s, "\n%U", format_tcp_vars, tc);
}
" rxt_sacked %u\n",
sb->sacked_bytes, sb->last_sacked_bytes, sb->lost_bytes,
sb->last_lost_bytes, sb->rxt_sacked);
- s = format (s, "%Ulast_delivered %u high_sacked %u is_reneging %u\n",
+ s = format (s, "%Ulast_delivered %u high_sacked %u is_reneging %u",
format_white_space, indent, sb->last_bytes_delivered,
sb->high_sacked - tc->iss, sb->is_reneging);
+ s = format (s, " reorder %u\n", sb->reorder);
s = format (s, "%Ucur_rxt_hole %u high_rxt %u rescue_rxt %u",
format_white_space, indent, sb->cur_rxt_hole,
sb->high_rxt - tc->iss, sb->rescue_rxt - tc->iss);
return VNET_API_ERROR_NEXT_HOP_NOT_IN_FIB;
sw_if_index = fib_entry_get_resolving_interface (fei);
+ if (sw_if_index == (u32) ~0)
+ return VNET_API_ERROR_NO_MATCHING_INTERFACE;
/* Configure proxy arp across the range */
rv = ip4_neighbor_proxy_add (fib_index, start, end);
/* Add local adjacencies for the range */
- receive_dpo_add_or_lock (DPO_PROTO_IP4, ~0 /* sw_if_index */ ,
+ receive_dpo_add_or_lock (DPO_PROTO_IP4, sw_if_index /* sw_if_index */,
NULL, &dpo);
prefix.fp_len = 32;
prefix.fp_proto = FIB_PROTOCOL_IP4;
ip6_neighbor_proxy_add (sw_if_index, start);
/* Add a receive adjacency for this address */
- receive_dpo_add_or_lock (DPO_PROTO_IP6, ~0 /* sw_if_index */ ,
+ receive_dpo_add_or_lock (DPO_PROTO_IP6, sw_if_index /* sw_if_index */,
NULL, &dpo);
fib_table_entry_special_dpo_update (fib_index,
return 0;
}
-/* *INDENT-OFF* */
VLIB_CLI_COMMAND (tcp_src_address_command, static) =
{
.path = "tcp src-address",
.short_help = "tcp src-address <ip-addr> [- <ip-addr>] add src address range",
.function = tcp_src_address_fn,
};
-/* *INDENT-ON* */
static u8 *
tcp_scoreboard_dump_trace (u8 * s, sack_scoreboard_t * sb)
return 0;
}
-/* *INDENT-OFF* */
VLIB_CLI_COMMAND (tcp_show_scoreboard_trace_command, static) =
{
.path = "show tcp scoreboard trace",
.short_help = "show tcp scoreboard trace <connection>",
.function = tcp_show_scoreboard_trace_fn,
};
-/* *INDENT-ON* */
u8 *
tcp_scoreboard_replay (u8 * s, tcp_connection_t * tc, u8 verbose)
int i, trace_len;
scoreboard_trace_elt_t *trace;
u32 next_ack, left, group, has_new_ack = 0;
- tcp_connection_t _dummy_tc, *dummy_tc = &_dummy_tc;
+ tcp_connection_t _placeholder_tc, *placeholder_tc = &_placeholder_tc;
sack_block_t *block;
if (!TCP_SCOREBOARD_TRACE)
if (!tc)
return s;
- clib_memset (dummy_tc, 0, sizeof (*dummy_tc));
- tcp_connection_timers_init (dummy_tc);
- scoreboard_init (&dummy_tc->sack_sb);
- dummy_tc->rcv_opts.flags |= TCP_OPTS_FLAG_SACK;
+ clib_memset (placeholder_tc, 0, sizeof (*placeholder_tc));
+ tcp_connection_timers_init (placeholder_tc);
+ scoreboard_init (&placeholder_tc->sack_sb);
+ placeholder_tc->rcv_opts.flags |= TCP_OPTS_FLAG_SACK;
#if TCP_SCOREBOARD_TRACE
trace = tc->sack_sb.trace;
{
if (trace[i].ack != 0)
{
- dummy_tc->snd_una = trace[i].ack - 1448;
- dummy_tc->snd_una_max = trace[i].ack;
+ placeholder_tc->snd_una = trace[i].ack - 1448;
+ placeholder_tc->snd_nxt = trace[i].ack;
}
}
while (left < trace_len)
{
group = trace[left].group;
- vec_reset_length (dummy_tc->rcv_opts.sacks);
+ vec_reset_length (placeholder_tc->rcv_opts.sacks);
has_new_ack = 0;
while (trace[left].group == group)
{
{
if (verbose)
s = format (s, "Adding ack %u, snd_una_max %u, segs: ",
- trace[left].ack, trace[left].snd_una_max);
- dummy_tc->snd_una_max = trace[left].snd_una_max;
+ trace[left].ack, trace[left].snd_nxt);
+ placeholder_tc->snd_nxt = trace[left].snd_nxt;
next_ack = trace[left].ack;
has_new_ack = 1;
}
if (verbose)
s = format (s, "[%u, %u], ", trace[left].start,
trace[left].end);
- vec_add2 (dummy_tc->rcv_opts.sacks, block, 1);
+ vec_add2 (placeholder_tc->rcv_opts.sacks, block, 1);
block->start = trace[left].start;
block->end = trace[left].end;
}
}
/* Push segments */
- tcp_rcv_sacks (dummy_tc, next_ack);
+ tcp_rcv_sacks (placeholder_tc, next_ack);
if (has_new_ack)
- dummy_tc->snd_una = next_ack;
+ placeholder_tc->snd_una = next_ack;
if (verbose)
s = format (s, "result: %U", format_tcp_scoreboard,
- &dummy_tc->sack_sb);
+ &placeholder_tc->sack_sb);
}
- s = format (s, "result: %U", format_tcp_scoreboard, &dummy_tc->sack_sb);
+ s =
+ format (s, "result: %U", format_tcp_scoreboard, &placeholder_tc->sack_sb);
return s;
}
return 0;
}
-/* *INDENT-OFF* */
VLIB_CLI_COMMAND (tcp_replay_scoreboard_command, static) =
{
.path = "tcp replay scoreboard",
.short_help = "tcp replay scoreboard <connection>",
.function = tcp_scoreboard_trace_fn,
};
-/* *INDENT-ON* */
static clib_error_t *
show_tcp_punt_fn (vlib_main_t * vm, unformat_input_t * input,
tm->punt_unknown6 ? "enabled" : "disabled");
return 0;
}
-/* *INDENT-OFF* */
VLIB_CLI_COMMAND (show_tcp_punt_command, static) =
{
.path = "show tcp punt",
.short_help = "show tcp punt",
.function = show_tcp_punt_fn,
};
-/* *INDENT-ON* */
static clib_error_t *
show_tcp_stats_fn (vlib_main_t * vm, unformat_input_t * input,
return 0;
}
-/* *INDENT-OFF* */
VLIB_CLI_COMMAND (show_tcp_stats_command, static) =
{
.path = "show tcp stats",
.short_help = "show tcp stats",
.function = show_tcp_stats_fn,
};
-/* *INDENT-ON* */
static clib_error_t *
clear_tcp_stats_fn (vlib_main_t * vm, unformat_input_t * input,
return 0;
}
-/* *INDENT-OFF* */
VLIB_CLI_COMMAND (clear_tcp_stats_command, static) =
{
.path = "clear tcp stats",
.short_help = "clear tcp stats",
.function = clear_tcp_stats_fn,
};
-/* *INDENT-ON* */
uword
unformat_tcp_cc_algo (unformat_input_t * input, va_list * va)
static clib_error_t *
tcp_config_fn (vlib_main_t * vm, unformat_input_t * input)
{
- u32 cwnd_multiplier, tmp_time;
+ u32 cwnd_multiplier, tmp_time, mtu, max_gso_size, tmp;
uword memory_size;
while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
if (unformat (input, "preallocated-connections %d",
&tcp_cfg.preallocated_connections))
;
- else if (unformat (input, "preallocated-half-open-connections %d",
- &tcp_cfg.preallocated_half_open_connections))
+ /* Config deprecated. Will be removed in a later release */
+ else if (unformat (input, "preallocated-half-open-connections %d", &tmp))
;
else if (unformat (input, "buffer-fail-fraction %f",
&tcp_cfg.buffer_fail_fraction))
}
tcp_cfg.min_rx_fifo = memory_size;
}
- else if (unformat (input, "mtu %u", &tcp_cfg.default_mtu))
- ;
+ else if (unformat (input, "mtu %u", &mtu))
+ tcp_cfg.default_mtu = mtu;
else if (unformat (input, "rwnd-min-update-ack %d",
&tcp_cfg.rwnd_min_update_ack))
;
tcp_cfg.allow_tso = 1;
else if (unformat (input, "no-csum-offload"))
tcp_cfg.csum_offload = 0;
+ else if (unformat (input, "max-gso-size %u", &max_gso_size))
+ tcp_cfg.max_gso_size = clib_min (max_gso_size, TCP_MAX_GSO_SZ);
else if (unformat (input, "cc-algo %U", unformat_tcp_cc_algo,
&tcp_cfg.cc_algo))
;
tcp_cfg.lastack_time = tmp_time / TCP_TIMER_TICK;
else if (unformat (input, "closing-time %u", &tmp_time))
tcp_cfg.closing_time = tmp_time / TCP_TIMER_TICK;
+ else if (unformat (input, "alloc-err-timeout %u", &tmp_time))
+ tcp_cfg.alloc_err_timeout = tmp_time / TCP_TIMER_TICK;
else if (unformat (input, "cleanup-time %u", &tmp_time))
tcp_cfg.cleanup_time = tmp_time / 1000.0;
else