summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_input.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-05-19 09:49:19 -0700
committerDave Barach <openvpp@barachs.net>2017-05-20 19:05:39 +0000
commitbb292f4d3fbecfc6b1bac695f833b0da78369116 (patch)
tree54881b3d7f809764bd6d5b82d6533500c167fb1a /src/vnet/tcp/tcp_input.c
parent95827e430762a2858f4e56e1248a4a93d629a938 (diff)
Improve session debugging
Also improves builtin client code. Change-Id: I8bca1aa632028f95c373726efb0abf2ee0eff414 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_input.c')
-rw-r--r--src/vnet/tcp/tcp_input.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index 9d3f4cc39e9..35bc90943b4 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -722,9 +722,11 @@ tcp_update_snd_wnd (tcp_connection_t * tc, u32 seq, u32 ack, u32 snd_wnd)
TCP_EVT_DBG (TCP_EVT_SND_WND, tc);
/* Set probe timer if we just got 0 wnd */
- if (tc->snd_wnd < tc->snd_mss
- && !tcp_timer_is_active (tc, TCP_TIMER_PERSIST))
- tcp_persist_timer_set (tc);
+ if (tc->snd_wnd < tc->snd_mss)
+ {
+ if (!tcp_timer_is_active (tc, TCP_TIMER_PERSIST))
+ tcp_persist_timer_set (tc);
+ }
else
tcp_persist_timer_reset (tc);
}
@@ -763,6 +765,7 @@ static void
tcp_cc_rcv_ack (tcp_connection_t * tc, vlib_buffer_t * b)
{
u8 partial_ack;
+ u32 bytes_advanced;
if (tcp_in_fastrecovery (tc))
{
@@ -804,10 +807,14 @@ tcp_cc_rcv_ack (tcp_connection_t * tc, vlib_buffer_t * b)
tc->rcv_dupacks = 0;
if (tcp_in_recovery (tc))
{
- tc->rtx_bytes -= clib_min (tc->bytes_acked, tc->rtx_bytes);
+ bytes_advanced = tc->bytes_acked + tc->sack_sb.snd_una_adv;
+ tc->rtx_bytes -= clib_min (bytes_advanced, tc->rtx_bytes);
tc->rto = clib_min (tc->srtt + (tc->rttvar << 2), TCP_RTO_MAX);
if (seq_geq (tc->snd_una, tc->snd_congestion))
- tcp_recovery_off (tc);
+ {
+ tc->rtx_bytes = 0;
+ tcp_recovery_off (tc);
+ }
}
}
}
@@ -1221,7 +1228,7 @@ format_tcp_rx_trace (u8 * s, va_list * args)
s = format (s, "%U\n%U%U",
format_tcp_header, &t->tcp_header, 128,
format_white_space, indent,
- format_tcp_connection_verbose, &t->tcp_connection);
+ format_tcp_connection, &t->tcp_connection, 1);
return s;
}
@@ -1236,7 +1243,7 @@ format_tcp_rx_trace_short (u8 * s, va_list * args)
s = format (s, "%d -> %d (%U)",
clib_net_to_host_u16 (t->tcp_header.src_port),
clib_net_to_host_u16 (t->tcp_header.dst_port), format_tcp_state,
- &t->tcp_connection.state);
+ t->tcp_connection.state);
return s;
}
@@ -2165,6 +2172,7 @@ tcp46_listen_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
child0->c_rmt_port = th0->src_port;
child0->c_is_ip4 = is_ip4;
child0->c_thread_index = my_thread_index;
+ child0->state = TCP_STATE_SYN_RCVD;
if (is_ip4)
{
@@ -2194,7 +2202,6 @@ tcp46_listen_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
child0->irs = vnet_buffer (b0)->tcp.seq_number;
child0->rcv_nxt = vnet_buffer (b0)->tcp.seq_number + 1;
child0->rcv_las = child0->rcv_nxt;
- child0->state = TCP_STATE_SYN_RCVD;
/* RFC1323: TSval timestamps sent on {SYN} and {SYN,ACK}
* segments are used to initialize PAWS. */
@@ -2450,7 +2457,7 @@ tcp46_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
if (error0 == TCP_ERROR_DISPATCH)
clib_warning ("disp error state %U flags %U",
- format_tcp_state, &state0, format_tcp_flags,
+ format_tcp_state, state0, format_tcp_flags,
(int) flags0);
}
}