]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
tcp: fix mishandling when the sack compression is deferred.
authorfuyuanli <fuyuanli@didiglobal.com>
Wed, 31 May 2023 08:01:50 +0000 (16:01 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 4 Sep 2023 09:10:23 +0000 (11:10 +0200)
commitb90204110d274b5e340e807efcbc4a5ad43ef86a
treeedb60df061a44ba07ce3fbcd15eb6daa222ef128
parent1bc892543847579f4b5d8682c5da2c87e890b6ed
tcp: fix mishandling when the sack compression is deferred.

BugLink: https://bugs.launchpad.net/bugs/2029808
[ Upstream commit 30c6f0bf9579debce27e45fac34fdc97e46acacc ]

In this patch, we mainly try to handle sending a compressed ack
correctly if it's deferred.

Here are more details in the old logic:
When sack compression is triggered in the tcp_compressed_ack_kick(),
if the sock is owned by user, it will set TCP_DELACK_TIMER_DEFERRED
and then defer to the release cb phrase. Later once user releases
the sock, tcp_delack_timer_handler() should send a ack as expected,
which, however, cannot happen due to lack of ICSK_ACK_TIMER flag.
Therefore, the receiver would not sent an ack until the sender's
retransmission timeout. It definitely increases unnecessary latency.

Fixes: 5d9f4262b7ea ("tcp: add SACK compression")
Suggested-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: fuyuanli <fuyuanli@didiglobal.com>
Signed-off-by: Jason Xing <kerneljasonxing@gmail.com>
Link: https://lore.kernel.org/netdev/20230529113804.GA20300@didi-ThinkCentre-M920t-N000/
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20230531080150.GA20424@didi-ThinkCentre-M920t-N000
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/net/tcp.h
net/ipv4/tcp_input.c
net/ipv4/tcp_timer.c