aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-08-29 11:35:53 -0700
committerDamjan Marion <dmarion@0xa5.net>2022-08-30 18:14:26 +0000
commitc37ce790763fac7ce890a28120db3b16425b1ceb (patch)
tree2ac1f80b1ea2182c7f431365995971e82f148f4e /src
parent4cbc8b20c78cbc2b8037f97078106e5e1a31a637 (diff)
tcp: do not overcount ooo bytes
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: Ic81702bffb5b3189db48efe1ab3b237fa2bf75f2
Diffstat (limited to 'src')
-rw-r--r--src/vnet/tcp/tcp_input.c4
1 files changed, 3 insertions, 1 deletions
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