tcp: dequeue acked only once per burst
Avoid dequeuing acked bytes more than once per burst for a connection.
Although the fifos do not use locks, size decrements are atomic, so they
rely on locked instructions.
Change-Id: Id65f4ea40b2c10057461402dfd0393034e6472d5
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/tcp/tcp_output.c b/src/vnet/tcp/tcp_output.c
index b15cf9b..29a919b 100644
--- a/src/vnet/tcp/tcp_output.c
+++ b/src/vnet/tcp/tcp_output.c
@@ -1308,7 +1308,7 @@
}
}
- tcp_get_free_buffer_index (wrk, &bi);
+ (void) tcp_get_free_buffer_index (wrk, &bi);
ASSERT (bi != (u32) ~ 0);
*b = vlib_get_buffer (vm, bi);
data = tcp_init_buffer (vm, *b);
@@ -1908,7 +1908,7 @@
/* RFC 6582: Send a new segment if permitted by the new value of cwnd. */
snd_space = tcp_available_cc_snd_space (tc);
- if (snd_space < tc->snd_mss)
+ if (snd_space < tc->snd_mss || tc->snd_mss == 0)
goto done;
max_deq = session_tx_fifo_max_dequeue (&tc->connection);