summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_newreno.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-04-18 16:40:55 -0700
committerFlorin Coras <fcoras@cisco.com>2018-04-20 05:33:43 -0700
commit62166004a9f0861e9ea50101b2194881ef1a35aa (patch)
treecf7a52e59565489d4922bb8fd39f3ab40003b124 /src/vnet/tcp/tcp_newreno.c
parent00cd22d627325a4a2869bedac68d0c1dd4d8ade7 (diff)
tcp: make newreno byte instead of acks dependent
Should be more resilient to ack losses Change-Id: Icec3b93c1d290dec437fcc4e6fe5171906c9ba8a 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.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;
+ }
}
}