summaryrefslogtreecommitdiff
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-02-04 16:39:32 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-04 16:39:32 -0500
commitdd48dc34fe7639a8b2e22d8b609672f5f81aa7cb (patch)
treef16ace0ae09edab16bf6d0be9e8280dfbb7100da /include/net/tcp.h
parent8d9eb069eafce49307f839783e4a4673414b1fd5 (diff)
parent5962b35c1de3254a2f03b95efd3b7854b874d7b7 (diff)
downloadlinux-3.10-dd48dc34fe7639a8b2e22d8b609672f5f81aa7cb.tar.gz
linux-3.10-dd48dc34fe7639a8b2e22d8b609672f5f81aa7cb.tar.bz2
linux-3.10-dd48dc34fe7639a8b2e22d8b609672f5f81aa7cb.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 78880ba0f56..6b2acfce4cf 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -273,6 +273,14 @@ static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
return seq3 - seq2 >= seq1 - seq2;
}
+static inline bool tcp_out_of_memory(struct sock *sk)
+{
+ if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
+ sk_memory_allocated(sk) > sk_prot_mem_limits(sk, 2))
+ return true;
+ return false;
+}
+
static inline bool tcp_too_many_orphans(struct sock *sk, int shift)
{
struct percpu_counter *ocp = sk->sk_prot->orphan_count;
@@ -283,13 +291,11 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift)
if (orphans << shift > sysctl_tcp_max_orphans)
return true;
}
-
- if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
- sk_memory_allocated(sk) > sk_prot_mem_limits(sk, 2))
- return true;
return false;
}
+extern bool tcp_check_oom(struct sock *sk, int shift);
+
/* syncookies: remember time of last synqueue overflow */
static inline void tcp_synq_overflow(struct sock *sk)
{
@@ -311,6 +317,8 @@ extern struct proto tcp_prot;
#define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val)
#define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val)
+extern void tcp_init_mem(struct net *net);
+
extern void tcp_v4_err(struct sk_buff *skb, u32);
extern void tcp_shutdown (struct sock *sk, int how);