From c37ce790763fac7ce890a28120db3b16425b1ceb Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 29 Aug 2022 11:35:53 -0700 Subject: tcp: do not overcount ooo bytes Type: fix Signed-off-by: Florin Coras Change-Id: Ic81702bffb5b3189db48efe1ab3b237fa2bf75f2 --- src/vnet/tcp/tcp_input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/vnet/tcp') diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index 4950553fc7a..a6d135812e1 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -1149,7 +1149,6 @@ tcp_session_enqueue_data (tcp_connection_t * tc, vlib_buffer_t * b, ASSERT (data_len); written = session_enqueue_stream_connection (&tc->connection, b, 0, 1 /* queue event */ , 1); - tc->bytes_in += written; TCP_EVT (TCP_EVT_INPUT, tc, 0, data_len, written); @@ -1157,17 +1156,20 @@ tcp_session_enqueue_data (tcp_connection_t * tc, vlib_buffer_t * b, if (PREDICT_TRUE (written == data_len)) { tc->rcv_nxt += written; + tc->bytes_in += written; } /* If more data written than expected, account for out-of-order bytes. */ else if (written > data_len) { tc->rcv_nxt += written; + tc->bytes_in += data_len; TCP_EVT (TCP_EVT_CC_INPUT, tc, data_len, written); } else if (written > 0) { /* We've written something but FIFO is probably full now */ tc->rcv_nxt += written; + tc->bytes_in += written; error = TCP_ERROR_PARTIALLY_ENQUEUED; } else -- cgit 1.2.3-korg