summaryrefslogtreecommitdiffstats
path: root/src/vnet/tcp/tcp_input.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2019-02-22 09:07:20 -0800
committerDamjan Marion <dmarion@me.com>2019-02-22 20:45:19 +0000
commitb691f768a1427094f6788a2f4f268ccfe7e9d15b (patch)
treebd53ddfa4fa8bf79407552bf420bb46ed582f65c /src/vnet/tcp/tcp_input.c
parent18be9b90a145f5659a46edf7166a62f3c1a95c69 (diff)
tcp: keep snd sack block free list
Instead of constantly reallocating the new sack block list, keep the old one as a reusable free list. Change-Id: Iad79a72204f97b96352c1c6eea66c2839a35cfe6 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/tcp/tcp_input.c')
-rw-r--r--src/vnet/tcp/tcp_input.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c
index dbe1fc4de87..df8f53d8b7e 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -1714,7 +1714,7 @@ tcp_sack_vector_is_sane (sack_block_t * sacks)
void
tcp_update_sack_list (tcp_connection_t * tc, u32 start, u32 end)
{
- sack_block_t *new_list = 0, *block = 0;
+ sack_block_t *new_list = tc->snd_sacks_fl, *block = 0;
int i;
/* If the first segment is ooo add it to the list. Last write might've moved
@@ -1758,7 +1758,8 @@ tcp_update_sack_list (tcp_connection_t * tc, u32 start, u32 end)
ASSERT (vec_len (new_list) <= TCP_MAX_SACK_BLOCKS);
/* Replace old vector with new one */
- vec_free (tc->snd_sacks);
+ vec_reset_length (tc->snd_sacks);
+ tc->snd_sacks_fl = tc->snd_sacks;
tc->snd_sacks = new_list;
/* Segments should not 'touch' */