diff options
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index c5868471abae..18fc999dae3c 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -284,6 +284,7 @@ extern int sysctl_tcp_thin_dupack; | |||
284 | extern int sysctl_tcp_early_retrans; | 284 | extern int sysctl_tcp_early_retrans; |
285 | extern int sysctl_tcp_limit_output_bytes; | 285 | extern int sysctl_tcp_limit_output_bytes; |
286 | extern int sysctl_tcp_challenge_ack_limit; | 286 | extern int sysctl_tcp_challenge_ack_limit; |
287 | extern unsigned int sysctl_tcp_notsent_lowat; | ||
287 | 288 | ||
288 | extern atomic_long_t tcp_memory_allocated; | 289 | extern atomic_long_t tcp_memory_allocated; |
289 | extern struct percpu_counter tcp_sockets_allocated; | 290 | extern struct percpu_counter tcp_sockets_allocated; |
@@ -1539,6 +1540,19 @@ extern int tcp_gro_complete(struct sk_buff *skb); | |||
1539 | extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, | 1540 | extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, |
1540 | __be32 daddr); | 1541 | __be32 daddr); |
1541 | 1542 | ||
1543 | static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp) | ||
1544 | { | ||
1545 | return tp->notsent_lowat ?: sysctl_tcp_notsent_lowat; | ||
1546 | } | ||
1547 | |||
1548 | static inline bool tcp_stream_memory_free(const struct sock *sk) | ||
1549 | { | ||
1550 | const struct tcp_sock *tp = tcp_sk(sk); | ||
1551 | u32 notsent_bytes = tp->write_seq - tp->snd_nxt; | ||
1552 | |||
1553 | return notsent_bytes < tcp_notsent_lowat(tp); | ||
1554 | } | ||
1555 | |||
1542 | #ifdef CONFIG_PROC_FS | 1556 | #ifdef CONFIG_PROC_FS |
1543 | extern int tcp4_proc_init(void); | 1557 | extern int tcp4_proc_init(void); |
1544 | extern void tcp4_proc_exit(void); | 1558 | extern void tcp4_proc_exit(void); |