aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_output.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-06-12 15:38:19 -0700
committerDave Barach <openvpp@barachs.net>2019-06-25 16:02:51 +0000
commit52814737c351b394d28a8b0ee1544176180f45e0 (patch)
tree76c8f32699624a6beb9554d4effa646c6270a791 /src/vnet/tcp/tcp_output.c
parent6e5baf29e2e48dc62a439d148f243dbb735de786 (diff)
tcp: delivery rate estimator
Type: feature First cut implementation with limited testing. The feature is not enabled by default and the expectation is that cc algorithms will enable it on demand. Change-Id: I92b70cb4dabcff0e9ccd1d725952c4880af394da Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_output.c')
-rw-r--r--src/vnet/tcp/tcp_output.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index 1adac95731f..d3c4ca4a314 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -422,6 +422,9 @@ tcp_update_burst_snd_vars (tcp_connection_t * tc)
&tc->snd_opts);
tcp_update_rcv_wnd (tc);
+
+ if (tc->flags & TCP_CONN_RATE_SAMPLE)
+ tc->flags |= TCP_CONN_TRACK_BURST;
}
void
@@ -1129,8 +1132,17 @@ u32
tcp_session_push_header (transport_connection_t * tconn, vlib_buffer_t * b)
{
tcp_connection_t *tc = (tcp_connection_t *) tconn;
+
+ if (tc->flags & TCP_CONN_TRACK_BURST)
+ {
+ tcp_bt_check_app_limited (tc);
+ tcp_bt_track_tx (tc);
+ tc->flags &= ~TCP_CONN_TRACK_BURST;
+ }
+
tcp_push_hdr_i (tc, b, tc->snd_nxt, /* compute opts */ 0, /* burst */ 1,
/* update_snd_nxt */ 1);
+
tc->snd_una_max = seq_max (tc->snd_nxt, tc->snd_una_max);
tcp_validate_txf_size (tc, tc->snd_una_max - tc->snd_una);
/* If not tracking an ACK, start tracking */
@@ -1418,7 +1430,11 @@ tcp_prepare_retransmit_segment (tcp_worker_ctx_t * wrk,
return 0;
if (tcp_in_fastrecovery (tc))
- tc->snd_rxt_bytes += n_bytes;
+ {
+ tc->snd_rxt_bytes += n_bytes;
+ if (tc->flags & TCP_CONN_RATE_SAMPLE)
+ tcp_bt_track_rxt (tc, start, start + n_bytes);
+ }
done:
TCP_EVT_DBG (TCP_EVT_CC_RTX, tc, offset, n_bytes);
@@ -1540,6 +1556,9 @@ tcp_timer_retransmit_handler_i (u32 index, u8 is_syn)
else
scoreboard_clear (&tc->sack_sb);
+ if (tc->flags & TCP_CONN_RATE_SAMPLE)
+ tcp_bt_flush_samples (tc);
+
/* If we've sent beyond snd_congestion, update it */
tc->snd_congestion = seq_max (tc->snd_nxt, tc->snd_congestion);