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.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp_newreno.c b/src/vnet/tcp/tcp_newreno.c
index 103fea4c194..7ae7f484b56 100644
--- a/src/vnet/tcp/tcp_newreno.c
+++ b/src/vnet/tcp/tcp_newreno.c
@@ -36,8 +36,14 @@ newreno_rcv_ack (tcp_connection_t * tc)
}
else
{
- /* Round up to 1 if needed */
- tc->cwnd += clib_max ((tc->snd_mss * tc->snd_mss) / tc->cwnd, 1);
+ /* tc->cwnd += clib_max ((tc->snd_mss * tc->snd_mss) / tc->cwnd, 1); */
+ tc->cwnd_acc_bytes += tc->bytes_acked;
+ if (tc->cwnd_acc_bytes >= tc->cwnd)
+ {
+ u32 inc = tc->cwnd_acc_bytes / tc->cwnd;
+ tc->cwnd += inc * tc->snd_mss;
+ tc->cwnd_acc_bytes -= inc * tc->cwnd;
+ }
}
}