aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.h
diff options
context:
space:
mode:
authorVladimir Kropylev <vladimir.kropylev@enea.com>2019-06-26 12:56:21 +0300
committerFlorin Coras <florin.coras@gmail.com>2019-06-27 23:33:24 +0000
commit4f731f829f29c5579257ecf1ef4b129a9d79fac8 (patch)
tree6a0e95d9987241470779a68fb6140b8e70e3ec25 /src/vnet/tcp/tcp.h
parentb4ca8b11e4204bb95e47cd4b15f3b7430f160c00 (diff)
tcp: Setup initial CWND as configured
Type: feature Change-Id: I7f476f4f81994c9c6cc2e8091de08adff4bcbc77 Signed-off-by: Vladimir Kropylev <vladimir.kropylev@enea.com>
Diffstat (limited to 'src/vnet/tcp/tcp.h')
-rw-r--r--src/vnet/tcp/tcp.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h
index e4980dd64eb..8b943cdd5b5 100644
--- a/src/vnet/tcp/tcp.h
+++ b/src/vnet/tcp/tcp.h
@@ -532,6 +532,10 @@ typedef struct _tcp_main
/** Default MTU to be used when establishing connections */
u16 default_mtu;
+ /** Initial CWND multiplier, which multiplies MSS to determine initial CWND.
+ * Set 0 to determine the initial CWND by another way */
+ u16 initial_cwnd_multiplier;
+
/** Number of preallocated connections */
u32 preallocated_connections;
u32 preallocated_half_open_connections;
@@ -809,6 +813,9 @@ tcp_flight_size (const tcp_connection_t * tc)
always_inline u32
tcp_initial_cwnd (const tcp_connection_t * tc)
{
+ if (tcp_main.initial_cwnd_multiplier > 0)
+ return tcp_main.initial_cwnd_multiplier * tc->snd_mss;
+
if (tc->snd_mss > 2190)
return 2 * tc->snd_mss;
else if (tc->snd_mss > 1095)