diff options
Diffstat (limited to 'include/net/tcp.h')
| -rw-r--r-- | include/net/tcp.h | 16 | 
1 files changed, 14 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 5fa9eacd965a..6f8e60c6fbc7 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -51,7 +51,7 @@ extern struct inet_hashinfo tcp_hashinfo;  extern struct percpu_counter tcp_orphan_count;  void tcp_time_wait(struct sock *sk, int state, int timeo); -#define MAX_TCP_HEADER	(128 + MAX_HEADER) +#define MAX_TCP_HEADER	L1_CACHE_ALIGN(128 + MAX_HEADER)  #define MAX_TCP_OPTION_SPACE 40  #define TCP_MIN_SND_MSS		48  #define TCP_MIN_GSO_SIZE	(TCP_MIN_SND_MSS - MAX_TCP_OPTION_SPACE) @@ -1376,7 +1376,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) @@ -1421,6 +1420,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);  | 
