diff options
author | David S. Miller <davem@davemloft.net> | 2020-05-15 23:48:59 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-15 23:48:59 +0300 |
commit | da07f52d3caf6c24c6dbffb5500f379d819e04bd (patch) | |
tree | 836e51994554f1aeddeebb6cb6ee568944a467e7 /include/net/tcp.h | |
parent | 93d43e58683efd958a0421b932a273df74e0e008 (diff) | |
parent | f85c1598ddfe83f61d0656bd1d2025fa3b148b99 (diff) | |
download | linux-da07f52d3caf6c24c6dbffb5500f379d819e04bd.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Move the bpf verifier trace check into the new switch statement in
HEAD.
Resolve the overlapping changes in hinic, where bug fixes overlap
the addition of VF support.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 43b87a8d4790..b681338a8320 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1372,7 +1372,6 @@ static inline void tcp_sack_reset(struct tcp_options_received *rx_opt) rx_opt->num_sacks = 0; } -u32 tcp_default_init_rwnd(u32 mss); void tcp_cwnd_restart(struct sock *sk, s32 delta); static inline void tcp_slow_start_after_idle_check(struct sock *sk) @@ -1417,6 +1416,19 @@ static inline int tcp_full_space(const struct sock *sk) return tcp_win_from_space(sk, READ_ONCE(sk->sk_rcvbuf)); } +/* We provision sk_rcvbuf around 200% of sk_rcvlowat. + * If 87.5 % (7/8) of the space has been consumed, we want to override + * SO_RCVLOWAT constraint, since we are receiving skbs with too small + * len/truesize ratio. + */ +static inline bool tcp_rmem_pressure(const struct sock *sk) +{ + int rcvbuf = READ_ONCE(sk->sk_rcvbuf); + int threshold = rcvbuf - (rcvbuf >> 3); + + return atomic_read(&sk->sk_rmem_alloc) > threshold; +} + extern void tcp_openreq_init_rwin(struct request_sock *req, const struct sock *sk_listener, const struct dst_entry *dst); |