From 87a9bf8c0399bc5424fbc129e31967cf504810a1 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Wed, 12 Jun 2019 11:26:35 -0700 Subject: [PATCH] tcp: better estimate snd space for rxt with no sacks Type: refactor Use tcp_available_cc_snd_space instead of sack scoreboard last_delivered_bytes to estimate available space when retransmitting with no sack support Change-Id: I938c637279eaf8c5634c4e97f0633fa2d0054fac Signed-off-by: Florin Coras --- src/vnet/tcp/tcp_input.c | 2 -- src/vnet/tcp/tcp_output.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index a438709a532..e843edb9d6e 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -1549,8 +1549,6 @@ partial_ack: else { tcp_fastrecovery_first_on (tc); - /* Reuse last bytes delivered to track total bytes acked */ - tc->sack_sb.last_bytes_delivered += tc->bytes_acked; if (tc->snd_rxt_bytes > tc->bytes_acked) tc->snd_rxt_bytes -= tc->bytes_acked; else diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c index c9ffd00d016..77065cd5200 100644 --- a/src/vnet/tcp/tcp_output.c +++ b/src/vnet/tcp/tcp_output.c @@ -1904,12 +1904,13 @@ tcp_fast_retransmit_no_sack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc, ASSERT (tcp_in_fastrecovery (tc)); TCP_EVT_DBG (TCP_EVT_CC_EVT, tc, 0); + snd_space = tcp_available_cc_snd_space (tc); + if (!tcp_fastrecovery_first (tc)) goto send_unsent; /* RFC 6582: [If a partial ack], retransmit the first unacknowledged * segment. */ - snd_space = tc->sack_sb.last_bytes_delivered; while (snd_space > 0 && n_segs < burst_size) { n_written = tcp_prepare_retransmit_segment (wrk, tc, offset, @@ -1932,7 +1933,6 @@ tcp_fast_retransmit_no_sack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc, send_unsent: /* RFC 6582: Send a new segment if permitted by the new value of cwnd. */ - snd_space = tcp_available_cc_snd_space (tc); if (snd_space < tc->snd_mss || tc->snd_mss == 0) goto done; -- 2.16.6