aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vnet/tcp/tcp.c4
-rw-r--r--src/vnet/tcp/tcp.h4
-rw-r--r--src/vnet/tcp/tcp_output.c14
3 files changed, 15 insertions, 7 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index bd3a4c1160a..d060654a037 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -1587,6 +1587,7 @@ tcp_configuration_init (void)
tcp_cfg.initial_cwnd_multiplier = 0;
tcp_cfg.enable_tx_pacing = 1;
tcp_cfg.cc_algo = TCP_CC_NEWRENO;
+ tcp_cfg.rwnd_min_update_ack = 1;
/* Time constants defined as timer tick (100ms) multiples */
tcp_cfg.delack_time = 1; /* 0.1s */
@@ -1698,6 +1699,9 @@ tcp_config_fn (vlib_main_t * vm, unformat_input_t * input)
tcp_cfg.min_rx_fifo = memory_size;
else if (unformat (input, "mtu %u", &tcp_cfg.default_mtu))
;
+ else if (unformat (input, "rwnd-min-update-ack %d",
+ &tcp_cfg.rwnd_min_update_ack))
+ ;
else if (unformat (input, "initial-cwnd-multiplier %u",
&tcp_cfg.initial_cwnd_multiplier))
;
diff --git a/src/vnet/tcp/tcp.h b/src/vnet/tcp/tcp.h
index d55ff801c00..9e13de4472a 100644
--- a/src/vnet/tcp/tcp.h
+++ b/src/vnet/tcp/tcp.h
@@ -524,6 +524,10 @@ typedef struct tcp_configuration_
/** Default congestion control algorithm type */
tcp_cc_algorithm_type_e cc_algo;
+ /** Min rwnd, as number of snd_mss segments, for update ack to be sent after
+ * a zero rwnd advertisement */
+ u32 rwnd_min_update_ack;
+
/** Delayed ack time (disabled) */
u16 delack_time;
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index eb481582fae..20031b2ebbd 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1185,19 +1185,19 @@ tcp_timer_delack_handler (u32 index)
}
/**
- * Send Window Update ACK,
- * ensuring that it will be sent once, if RWND became non-zero,
- * after zero RWND has been advertised in ACK before
+ * Send window update ack
+ *
+ * Ensures that it will be sent only once, after a zero rwnd has been
+ * advertised in a previous ack, and only if rwnd has grown beyond a
+ * configurable value.
*/
void
tcp_send_window_update_ack (tcp_connection_t * tc)
{
- u32 win;
-
if (tcp_zero_rwnd_sent (tc))
{
- win = tcp_window_to_advertise (tc, tc->state);
- if (win > 0)
+ tcp_update_rcv_wnd (tc);
+ if (tc->rcv_wnd >= tcp_cfg.rwnd_min_update_ack * tc->snd_mss)
{
tcp_zero_rwnd_sent_off (tc);
tcp_program_ack (tc);