From cc4d6d022fb0d4b4f0ea9f63e9c6b1c0e8d95cca Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Wed, 29 Jul 2020 23:03:39 -0700 Subject: tcp: track reorder with sacks Type: feature Change-Id: I041bff2e8d589c171661de286fa1503531dff891 Signed-off-by: Florin Coras --- src/vnet/tcp/tcp_input.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/vnet/tcp/tcp_input.c') diff --git a/src/vnet/tcp/tcp_input.c b/src/vnet/tcp/tcp_input.c index 5fa7bf23c72..de9d89181fa 100644 --- a/src/vnet/tcp/tcp_input.c +++ b/src/vnet/tcp/tcp_input.c @@ -689,7 +689,7 @@ tcp_cc_init_congestion (tcp_connection_t * tc) * three segments that have left the network and should've been * buffered at the receiver XXX */ if (!tcp_opts_sack_permitted (&tc->rcv_opts)) - tc->cwnd += 3 * tc->snd_mss; + tc->cwnd += TCP_DUPACK_THRESHOLD * tc->snd_mss; tc->fr_occurences += 1; TCP_EVT (TCP_EVT_CC_EVT, tc, 4); @@ -720,14 +720,6 @@ tcp_cc_is_spurious_retransmit (tcp_connection_t * tc) return (tcp_cc_is_spurious_timeout_rxt (tc)); } -static inline u8 -tcp_should_fastrecover_sack (tcp_connection_t * tc) -{ - return (tc->sack_sb.lost_bytes - || ((TCP_DUPACK_THRESHOLD - 1) * tc->snd_mss - < tc->sack_sb.sacked_bytes)); -} - static inline u8 tcp_should_fastrecover (tcp_connection_t * tc, u8 has_sack) { @@ -752,8 +744,7 @@ tcp_should_fastrecover (tcp_connection_t * tc, u8 has_sack) return 0; } } - return ((tc->rcv_dupacks == TCP_DUPACK_THRESHOLD) - || tcp_should_fastrecover_sack (tc)); + return tc->sack_sb.lost_bytes || tc->rcv_dupacks >= tc->sack_sb.reorder; } static int -- cgit 1.2.3-korg