summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_newreno.c
diff options
context:
space:
mode:
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,