aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2021-11-15 11:02:38 -0800
committerDavid S. Miller <davem@davemloft.net>2021-11-16 13:10:34 +0000
commit6c302e799a0d4be1362f505453b714fe05d91f2a (patch)
tree03a82488a6c332025094440f27957d56916f3801 /include/net/sock.h
parentnet: shrink struct sock by 8 bytes (diff)
downloadlinux-dev-6c302e799a0d4be1362f505453b714fe05d91f2a.tar.xz
linux-dev-6c302e799a0d4be1362f505453b714fe05d91f2a.zip
net: forward_alloc_get depends on CONFIG_MPTCP
(struct proto)->sk_forward_alloc is currently only used by MPTCP. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 2333ab081789..cb97c448472a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1206,7 +1206,9 @@ struct proto {
unsigned int inuse_idx;
#endif
+#if IS_ENABLED(CONFIG_MPTCP)
int (*forward_alloc_get)(const struct sock *sk);
+#endif
bool (*stream_memory_free)(const struct sock *sk, int wake);
bool (*sock_is_readable)(struct sock *sk);
@@ -1295,10 +1297,11 @@ INDIRECT_CALLABLE_DECLARE(bool tcp_stream_memory_free(const struct sock *sk, int
static inline int sk_forward_alloc_get(const struct sock *sk)
{
- if (!sk->sk_prot->forward_alloc_get)
- return sk->sk_forward_alloc;
-
- return sk->sk_prot->forward_alloc_get(sk);
+#if IS_ENABLED(CONFIG_MPTCP)
+ if (sk->sk_prot->forward_alloc_get)
+ return sk->sk_prot->forward_alloc_get(sk);
+#endif
+ return sk->sk_forward_alloc;
}
static inline bool __sk_stream_memory_free(const struct sock *sk, int wake)