tcp: adjust rcv_ssthresh according to sk_reserved_mem
authorWei Wang <weiwan@google.com>
Wed, 29 Sep 2021 17:25:13 +0000 (10:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 30 Sep 2021 12:36:46 +0000 (13:36 +0100)
commit053f368412c9a7bfce2befec8c795113c8cfb0b1
tree30f0da3c75f0c65934cf3e42cd43c3fb8d4d0488
parentca057051cf25a8c198af7b73daf922ef65a3c016
tcp: adjust rcv_ssthresh according to sk_reserved_mem

When user sets SO_RESERVE_MEM socket option, in order to utilize the
reserved memory when in memory pressure state, we adjust rcv_ssthresh
according to the available reserved memory for the socket, instead of
using 4 * advmss always.

Signed-off-by: Wei Wang <weiwan@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/tcp.h
net/ipv4/tcp_input.c
net/ipv4/tcp_output.c