From: Michal Kubecek <mkubecek@suse.cz>
Date: Fri, 21 Jan 2022 01:15:39 +0100
Subject: net: allow retransmitting a TCP packet if original is still in queue
Patch-mainline: Never, temporary workaround
References: bsc#1188605 bsc#1187428
This effectively reverts mainline commit 1f3279ae0c13 ("tcp: avoid
retransmits of TCP packets hanging in host queues") so that the retransmit
can unblock the previous transmit of a TCP packet if it was left in the
qdisc queue of pfifo_fast due to a race condition in lockless qdisc code.
Rather than a full revert, just let skb_still_in_host_queue() always return
false so that everything else works exactly as before.
This is only a temporary workaround until the bsc#1188605 race condition is
identified and fixed.
Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
---
net/ipv4/tcp_output.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2541,7 +2541,9 @@ static bool skb_still_in_host_queue(const struct sock *sk,
if (unlikely(skb_fclone_busy(sk, skb))) {
NET_INC_STATS(sock_net(sk),
LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES);
- return true;
+ /* unclog the qdisc queue if previous transmit is still there
+ * because of a race condition
+ */
}
return false;
}