* [PATCH] tcp: drain out_of_order_queue and update SACKs in tcp_send_rcvq()
@ 2026-09-19 21:52 Hui Peng
0 siblings, 0 replies; only message in thread
From: Hui Peng @ 2026-09-19 21:52 UTC (permalink / raw)
To: edumazet, ncardwell, kuniyu, davem, kuba, pabeni, horms
Cc: netdev, linux-kernel
When TCP_REPAIR injects data into the receive queue via tcp_send_rcvq() and
advances tp->copied_seq and tp->rcv_nxt, any segments already sitting in
tp->out_of_order_queue that are now covered or contiguous with rcv_nxt are
not coalesced or removed from tp->rx_opt.num_sacks. Drain
out_of_order_queue via tcp_ofo_queue(sk) and update SACK blocks via
tcp_sack_remove(tp) after advancing rcv_nxt in tcp_send_rcvq().
Fixes: 292e8d8c8538 ("tcp: Move rcvq sending to tcp_input.c")
Assisted-by: LLM
Signed-off-by: Hui Peng <benquike@gmail.com>
---
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 92bc60716f33..8a7c38a4b1ec 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5589,6 +5589,11 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
WARN_ON_ONCE(fragstolen); /* should not happen */
__kfree_skb(skb);
}
+ if (!RB_EMPTY_ROOT(&tcp_sk(sk)->out_of_order_queue)) {
+ tcp_ofo_queue(sk);
+ if (tcp_sk(sk)->rx_opt.num_sacks)
+ tcp_sack_remove(tcp_sk(sk));
+ }
return size;
err_free:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-19 21:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-19 21:52 [PATCH] tcp: drain out_of_order_queue and update SACKs in tcp_send_rcvq() Hui Peng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®