diff options
author | Florin Coras <fcoras@cisco.com> | 2022-01-05 12:55:35 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2022-01-06 23:08:09 +0000 |
commit | b56f24bbc474e2d5350b63268877ec713f903e70 (patch) | |
tree | 571ea7d80d65f54530dd1a6392fe69d5401b4a72 /src/vnet/tcp/tcp_input.c | |
parent | 0f8b91f5d8e4bc2f9a0166440abaf00b2bda29bb (diff) |
tcp: exit retransmit before processing feedback
Type: refactor
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I5838e4c370d0c02a21b5eadb4af3baae781df097
Diffstat (limited to 'src/vnet/tcp/tcp_input.c')
-rw-r--r-- | src/vnet/tcp/tcp_input.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index 5f165c01b4c..058b1c0517e 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -742,7 +742,7 @@ tcp_should_fastrecover (tcp_connection_t * tc, u8 has_sack) } static int -tcp_cc_recover (tcp_connection_t * tc) +tcp_cc_try_recover (tcp_connection_t *tc) { sack_scoreboard_hole_t *hole; u8 is_spurious = 0; @@ -763,8 +763,7 @@ tcp_cc_recover (tcp_connection_t * tc) if (tc->sack_sb.sacked_bytes) { tc->snd_congestion = tc->snd_nxt; - tcp_program_retransmit (tc); - return is_spurious; + return -1; } tc->rxt_delivered = 0; @@ -790,7 +789,7 @@ tcp_cc_recover (tcp_connection_t * tc) ASSERT (!tcp_in_cong_recovery (tc)); ASSERT (tcp_scoreboard_is_sane_post_recovery (tc)); - return is_spurious; + return 0; } static void @@ -857,6 +856,20 @@ tcp_cc_handle_event (tcp_connection_t * tc, tcp_rate_sample_t * rs, */ /* + * See if we can exit and stop retransmitting + */ + if (seq_geq (tc->snd_una, tc->snd_congestion)) + { + /* If successfully recovered, treat ack as congestion avoidance ack + * and return. Otherwise, we're still congested so process feedback */ + if (!tcp_cc_try_recover (tc)) + { + tcp_cc_rcv_ack (tc, rs); + return; + } + } + + /* * Process (re)transmit feedback. Output path uses this to decide how much * more data to release into the network */ @@ -890,23 +903,6 @@ tcp_cc_handle_event (tcp_connection_t * tc, tcp_rate_sample_t * rs, tcp_fastrecovery_first_on (tc); } - /* - * See if we can exit and stop retransmitting - */ - if (seq_geq (tc->snd_una, tc->snd_congestion)) - { - /* If spurious return, we've already updated everything */ - if (tcp_cc_recover (tc)) - { - tc->tsecr_last_ack = tc->rcv_opts.tsecr; - return; - } - - /* Treat as congestion avoidance ack */ - tcp_cc_rcv_ack (tc, rs); - return; - } - tcp_program_retransmit (tc); /* |