From c792b9f5e905c168f77ab1a262351ecd2fb4b511 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Tue, 15 Mar 2022 14:24:59 -0700 Subject: tcp: limit persist segment size if window available Type: improvement Signed-off-by: Florin Coras Change-Id: Ie1ae401d5105aa42761d3cac5dfbe523f3995c87 --- src/vnet/tcp/tcp_output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/vnet/tcp/tcp_output.c') diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index 88cd91330b0..f5035006822 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -1565,8 +1565,10 @@ tcp_timer_persist_handler (tcp_connection_t * tc) tcp_validate_txf_size (tc, offset); tc->snd_opts_len = tcp_make_options (tc, &tc->snd_opts, tc->state); - max_snd_bytes = clib_min (tc->snd_mss, + max_snd_bytes = clib_min (clib_min (tc->snd_mss, available_bytes), tm->bytes_per_buffer - TRANSPORT_MAX_HDRS_LEN); + if (tc->snd_wnd > 0) + max_snd_bytes = clib_min (tc->snd_wnd, max_snd_bytes); n_bytes = session_tx_fifo_peek_bytes (&tc->connection, data, offset, max_snd_bytes); b->current_length = n_bytes; -- cgit 1.2.3-korg