summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2020-11-13 07:08:08 -0800
committerJakub Kicinski <kuba@kernel.org>2020-11-14 16:09:56 -0800
commitd3cd4924e3853aa771c3acf6f3ea3fb2cccdfadd (patch)
tree94345aae2270f7f2fcdcdcc313c31572033d800a /include
parentae8cb93286e50ece1e45674661cbefcafe8b811c (diff)
downloadlinux-d3cd4924e3853aa771c3acf6f3ea3fb2cccdfadd.tar.bz2
tcp: uninline tcp_stream_memory_free()
Both IPv4 and IPv6 needs it via a function pointer. Following patch will avoid the indirect call. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/tcp.h13
1 files changed, 1 insertions, 12 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4aba0f069b05..d643ee4e4249 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1965,18 +1965,7 @@ static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp)
return tp->notsent_lowat ?: net->ipv4.sysctl_tcp_notsent_lowat;
}
-/* @wake is one when sk_stream_write_space() calls us.
- * This sends EPOLLOUT only if notsent_bytes is half the limit.
- * This mimics the strategy used in sock_def_write_space().
- */
-static inline bool tcp_stream_memory_free(const struct sock *sk, int wake)
-{
- const struct tcp_sock *tp = tcp_sk(sk);
- u32 notsent_bytes = READ_ONCE(tp->write_seq) -
- READ_ONCE(tp->snd_nxt);
-
- return (notsent_bytes << wake) < tcp_notsent_lowat(tp);
-}
+bool tcp_stream_memory_free(const struct sock *sk, int wake);
#ifdef CONFIG_PROC_FS
int tcp4_proc_init(void);