]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: add tp->dup_ack_counter
authorEric Dumazet <edumazet@google.com>
Thu, 30 Apr 2020 17:35:41 +0000 (10:35 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Apr 2020 20:24:01 +0000 (13:24 -0700)
commitf0312b7fb3e90e8e912453be29fecd803e23899a
treebbb5e20a0e2c8cb06bb28d316d89b7b821672cdc
parent79d0161a1a3cece8d53040b0ba50160cd8626156
tcp: add tp->dup_ack_counter

In commit 101d440dd269 ("tcp: defer SACK compression after DupThresh")
I added a TCP_FASTRETRANS_THRESH bias to tp->compressed_ack in order
to enable sack compression only after 3 dupacks.

Since we plan to relax this rule for flows that involve
stacks not requiring this old rule, this patch adds
a distinct tp->dup_ack_counter.

This means the TCP_FASTRETRANS_THRESH value is now used
in a single location that a future patch can adjust:

if (tp->dup_ack_counter < TCP_FASTRETRANS_THRESH) {
tp->dup_ack_counter++;
goto send_now;
}

This patch also introduces tcp_sack_compress_send_ack()
helper to ease following patch comprehension.

This patch refines LINUX_MIB_TCPACKCOMPRESSED to not
count the acks that we had to send if the timer expires
or tcp_sack_compress_send_ack() is sending an ack.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/tcp.h
net/ipv4/tcp_input.c
net/ipv4/tcp_output.c
net/ipv4/tcp_timer.c