aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h14
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;
284extern int sysctl_tcp_early_retrans; 284extern int sysctl_tcp_early_retrans;
285extern int sysctl_tcp_limit_output_bytes; 285extern int sysctl_tcp_limit_output_bytes;
286extern int sysctl_tcp_challenge_ack_limit; 286extern int sysctl_tcp_challenge_ack_limit;
287extern unsigned int sysctl_tcp_notsent_lowat;
287 288
288extern atomic_long_t tcp_memory_allocated; 289extern atomic_long_t tcp_memory_allocated;
289extern struct percpu_counter tcp_sockets_allocated; 290extern struct percpu_counter tcp_sockets_allocated;
@@ -1539,6 +1540,19 @@ extern int tcp_gro_complete(struct sk_buff *skb);
1539extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, 1540extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr,
1540 __be32 daddr); 1541 __be32 daddr);
1541 1542
1543static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp)
1544{
1545 return tp->notsent_lowat ?: sysctl_tcp_notsent_lowat;
1546}
1547
1548static 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
1543extern int tcp4_proc_init(void); 1557extern int tcp4_proc_init(void);
1544extern void tcp4_proc_exit(void); 1558extern void tcp4_proc_exit(void);