Commit 1a03edeb authored by Eric Dumazet's avatar Eric Dumazet Committed by Jakub Kicinski
Browse files

tcp: refine sk_rcvbuf increase for ooo packets



When a passive flow has not been accepted yet, it is
not wise to increase sk_rcvbuf when receiving ooo packets.

A very busy server might tune down tcp_rmem[1] to better
control how much memory can be used by sockets waiting
in its listeners accept queues.

Fixes: 63ad7dfe ("tcp: adjust rcvbuf in presence of reorders")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250707213900.1543248-2-edumazet@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ffdde7bf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5181,6 +5181,8 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
		skb_condense(skb);
		skb_set_owner_r(skb, sk);
	}
	/* do not grow rcvbuf for not-yet-accepted or orphaned sockets. */
	if (sk->sk_socket)
		tcp_rcvbuf_grow(sk);
}