aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-06-26 01:22:41 -0700
committerFlorin Coras <florin.coras@gmail.com>2018-06-26 18:17:17 +0000
commit352c2c40c720acefaa49ade61cf9e8fdef3c846f (patch)
tree7d0f822114b41c45404e505eea498738e4a265fb /src
parent235a47e371c8ffea352790c001ef39876f2aaef5 (diff)
tcp: avoid doing work in tcp_rcv_sacks for no sacks
Change-Id: I00a0d7f57dc144d338d5ad45b0a6e3720c32c400 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-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 c99d6cca6fe..1e6a8eb4eae 100644
--- a/src/vnet/tcp/tcp_input.c
+++ b/src/vnet/tcp/tcp_input.c
@@ -823,14 +823,15 @@ tcp_rcv_sacks (tcp_connection_t * tc, u32 ack)
int i, j;
sb->last_sacked_bytes = 0;
- sb->snd_una_adv = 0;
- old_sacked_bytes = sb->sacked_bytes;
sb->last_bytes_delivered = 0;
+ sb->snd_una_adv = 0;
if (!tcp_opts_sack (&tc->rcv_opts)
&& sb->head == TCP_INVALID_SACK_HOLE_INDEX)
return;
+ old_sacked_bytes = sb->sacked_bytes;
+
/* Remove invalid blocks */
blk = tc->rcv_opts.sacks;
while (blk < vec_end (tc->rcv_opts.sacks))