summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_newreno.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_newreno.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_newreno.c')
-rw-r--r--src/vnet/tcp/tcp_newreno.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/vnet/tcp/tcp_newreno.c b/src/vnet/tcp/tcp_newreno.c
index 3887b34b7ea..7e37efb1052 100644
--- a/src/vnet/tcp/tcp_newreno.c
+++ b/src/vnet/tcp/tcp_newreno.c
@@ -15,19 +15,26 @@
#include <vnet/tcp/tcp.h>
-void
+static void
newreno_congestion (tcp_connection_t * tc)
{
tc->ssthresh = clib_max (tcp_flight_size (tc) / 2, 2 * tc->snd_mss);
}
-void
+static void
+newreno_loss (tcp_connection_t * tc)
+{
+ tc->ssthresh = clib_max (tcp_flight_size (tc) / 2, 2 * tc->snd_mss);
+ tc->cwnd = tcp_loss_wnd (tc);
+}
+
+static void
newreno_recovered (tcp_connection_t * tc)
{
tc->cwnd = tc->ssthresh;
}
-void
+static void
newreno_rcv_ack (tcp_connection_t * tc, tcp_rate_sample_t * rs)
{
if (tcp_in_slowstart (tc))
@@ -72,7 +79,7 @@ newreno_rcv_cong_ack (tcp_connection_t * tc, tcp_cc_ack_t ack_type,
}
}
-void
+static void
newreno_conn_init (tcp_connection_t * tc)
{
tc->ssthresh = tc->snd_wnd;
@@ -82,6 +89,7 @@ newreno_conn_init (tcp_connection_t * tc)
const static tcp_cc_algorithm_t tcp_newreno = {
.name = "newreno",
.congestion = newreno_congestion,
+ .loss = newreno_loss,
.recovered = newreno_recovered,
.rcv_ack = newreno_rcv_ack,
.rcv_cong_ack = newreno_rcv_cong_ack,