From d3ef00098cd27e01bb24db15e3440fabbc025aa8 Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Wed, 1 Nov 2023 13:44:28 -0700 Subject: tcp: remove redundant ack checks Type: improvement Signed-off-by: Florin Coras Change-Id: I4001f39afde8c33b60c15f74034bcce013fbbf70 --- src/vnet/tcp/tcp_input.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/vnet/tcp') diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index 5e85f13cbac..88ae0a32b60 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -362,17 +362,10 @@ tcp_rcv_ack_no_cc (tcp_connection_t * tc, vlib_buffer_t * b, u32 * error) if (!(seq_leq (tc->snd_una, vnet_buffer (b)->tcp.ack_number) && seq_leq (vnet_buffer (b)->tcp.ack_number, tc->snd_nxt))) { - if (seq_leq (vnet_buffer (b)->tcp.ack_number, tc->snd_nxt) - && seq_gt (vnet_buffer (b)->tcp.ack_number, tc->snd_una)) - { - tc->snd_nxt = vnet_buffer (b)->tcp.ack_number; - goto acceptable; - } *error = TCP_ERROR_ACK_INVALID; return -1; } -acceptable: tc->bytes_acked = vnet_buffer (b)->tcp.ack_number - tc->snd_una; tc->snd_una = vnet_buffer (b)->tcp.ack_number; *error = TCP_ERROR_ACK_OK; @@ -939,15 +932,6 @@ tcp_rcv_ack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc, vlib_buffer_t * b, /* If the ACK acks something not yet sent (SEG.ACK > SND.NXT) */ if (PREDICT_FALSE (seq_gt (vnet_buffer (b)->tcp.ack_number, tc->snd_nxt))) { - /* We've probably entered recovery and the peer still has some - * of the data we've sent. Update snd_nxt and accept the ack */ - if (seq_leq (vnet_buffer (b)->tcp.ack_number, tc->snd_nxt) - && seq_gt (vnet_buffer (b)->tcp.ack_number, tc->snd_una)) - { - tc->snd_nxt = vnet_buffer (b)->tcp.ack_number; - goto process_ack; - } - tc->errors.above_ack_wnd += 1; *error = TCP_ERROR_ACK_FUTURE; TCP_EVT (TCP_EVT_ACK_RCV_ERR, tc, 0, vnet_buffer (b)->tcp.ack_number); @@ -970,8 +954,6 @@ tcp_rcv_ack (tcp_worker_ctx_t * wrk, tcp_connection_t * tc, vlib_buffer_t * b, return 0; } -process_ack: - /* * Looks okay, process feedback */ -- cgit 1.2.3-korg