aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_cubic.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-07-03 17:47:22 -0700
committerDamjan Marion <dmarion@me.com>2019-07-05 11:58:34 +0000
commita3c3265b20c2a382656957b4afd2003bddccd9bb (patch)
tree3b45bd4faca1ab99ecf9d45573359d3fbc6d266a /src/vnet/tcp/tcp_cubic.c
parentba6abfa0629f04830cc4908a93101ac4ce3bd474 (diff)
tcp: add loss signal to cc algo
Type:feature Change-Id: Ibe1a4c555b55fb929d55b02599aaf099ed522cdf Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_cubic.c')
-rw-r--r--src/vnet/tcp/tcp_cubic.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp_cubic.c b/src/vnet/tcp/tcp_cubic.c
index 80d4308bbb7..0b4226d6f12 100644
--- a/src/vnet/tcp/tcp_cubic.c
+++ b/src/vnet/tcp/tcp_cubic.c
@@ -106,6 +106,18 @@ cubic_congestion (tcp_connection_t * tc)
}
static void
+cubic_loss (tcp_connection_t * tc)
+{
+ cubic_data_t *cd = (cubic_data_t *) tcp_cc_data (tc);
+
+ tc->ssthresh = clib_max (tc->cwnd * beta_cubic, 2 * tc->snd_mss);
+ tc->cwnd = tcp_loss_wnd (tc);
+ cd->t_start = cubic_time (tc->c_thread_index);
+ cd->K = 0;
+ cd->w_max = 0;
+}
+
+static void
cubic_recovered (tcp_connection_t * tc)
{
cubic_data_t *cd = (cubic_data_t *) tcp_cc_data (tc);
@@ -217,6 +229,7 @@ const static tcp_cc_algorithm_t tcp_cubic = {
.name = "cubic",
.unformat_cfg = cubic_unformat_config,
.congestion = cubic_congestion,
+ .loss = cubic_loss,
.recovered = cubic_recovered,
.rcv_ack = cubic_rcv_ack,
.rcv_cong_ack = newreno_rcv_cong_ack,