Skip to content

Commit 1a03ede

Browse files
edumazetkuba-moo
authored andcommitted
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: 63ad7df ("tcp: adjust rcvbuf in presence of reorders") Signed-off-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ffdde7b commit 1a03ede

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/ipv4/tcp_input.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5181,7 +5181,9 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
51815181
skb_condense(skb);
51825182
skb_set_owner_r(skb, sk);
51835183
}
5184-
tcp_rcvbuf_grow(sk);
5184+
/* do not grow rcvbuf for not-yet-accepted or orphaned sockets. */
5185+
if (sk->sk_socket)
5186+
tcp_rcvbuf_grow(sk);
51855187
}
51865188

51875189
static int __must_check tcp_queue_rcv(struct sock *sk, struct sk_buff *skb,

0 commit comments

Comments
 (0)