summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2017-05-17 14:21:51 -0700
committerDave Barach <openvpp@barachs.net>2017-05-18 21:53:24 +0000
commit06d110189e54220c533c5fe0cea7f23e531284b9 (patch)
treed8d8221df3757eba65085b10cf10077f8ee6e1f8 /src/vnet/tcp/tcp.c
parent324fe29346e16228d5dca349ea509254c9cd4ea5 (diff)
Improve sack bytes accounting and testing
Change-Id: Iabeda0d0615b0f6fe20dd00611cb4c594d90b7eb Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp.c')
-rw-r--r--src/vnet/tcp/tcp.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/vnet/tcp/tcp.c b/src/vnet/tcp/tcp.c
index e365fa0ed82..36d85e46f0c 100644
--- a/src/vnet/tcp/tcp.c
+++ b/src/vnet/tcp/tcp.c
@@ -565,6 +565,48 @@ format_tcp_half_open_session (u8 * s, va_list * args)
return format (s, "%U", format_tcp_connection, tc);
}
+u8 *
+format_tcp_sacks (u8 * s, va_list * args)
+{
+ tcp_connection_t *tc = va_arg (*args, tcp_connection_t *);
+ sack_block_t *sacks = tc->snd_sacks;
+ sack_block_t *block;
+ vec_foreach (block, sacks)
+ {
+ s = format (s, " start %u end %u\n", block->start - tc->irs,
+ block->end - tc->irs);
+ }
+ return s;
+}
+
+u8 *
+format_tcp_sack_hole (u8 * s, va_list * args)
+{
+ sack_scoreboard_hole_t *hole = va_arg (*args, sack_scoreboard_hole_t *);
+ s = format (s, "[%u, %u]", hole->start, hole->end);
+ return s;
+}
+
+u8 *
+format_tcp_scoreboard (u8 * s, va_list * args)
+{
+ sack_scoreboard_t *sb = va_arg (*args, sack_scoreboard_t *);
+ sack_scoreboard_hole_t *hole;
+ s = format (s, "head %u tail %u snd_una_adv %u\n", sb->head, sb->tail,
+ sb->snd_una_adv);
+ s = format (s, "sacked_bytes %u last_sacked_bytes %u", sb->sacked_bytes,
+ sb->last_sacked_bytes);
+ s = format (s, " max_byte_sacked %u\n", sb->max_byte_sacked);
+ s = format (s, "holes:\n");
+ hole = scoreboard_first_hole (sb);
+ while (hole)
+ {
+ s = format (s, "%U", format_tcp_sack_hole, hole);
+ hole = scoreboard_next_hole (sb, hole);
+ }
+ return s;
+}
+
transport_connection_t *
tcp_session_get_transport (u32 conn_index, u32 thread_index)
{