netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: stream: fix TCP references when INET is not enabled
@ 2020-11-18 19:44 Randy Dunlap
  2020-11-20 21:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2020-11-18 19:44 UTC (permalink / raw)
  To: netdev; +Cc: Randy Dunlap, Eric Dumazet, Jakub Kicinski

Fix build of net/core/stream.o when CONFIG_INET is not enabled.
Fixes these build errors (sample):

ld: net/core/stream.o: in function `sk_stream_write_space':
(.text+0x27e): undefined reference to `tcp_stream_memory_free'
ld: (.text+0x29c): undefined reference to `tcp_stream_memory_free'
ld: (.text+0x2ab): undefined reference to `tcp_stream_memory_free'
ld: net/core/stream.o: in function `sk_stream_wait_memory':
(.text+0x5a1): undefined reference to `tcp_stream_memory_free'
ld: (.text+0x5bf): undefined reference to `tcp_stream_memory_free'

Fixes: 1c5f2ced136a ("tcp: avoid indirect call to tcp_stream_memory_free()")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
---
 include/net/sock.h |    5 +++++
 1 file changed, 5 insertions(+)

--- linux-next-20201118.orig/include/net/sock.h
+++ linux-next-20201118/include/net/sock.h
@@ -1271,10 +1271,15 @@ static inline bool __sk_stream_memory_fr
 	if (READ_ONCE(sk->sk_wmem_queued) >= READ_ONCE(sk->sk_sndbuf))
 		return false;
 
+#ifdef CONFIG_INET
 	return sk->sk_prot->stream_memory_free ?
 		INDIRECT_CALL_1(sk->sk_prot->stream_memory_free,
 			        tcp_stream_memory_free,
 				sk, wake) : true;
+#else
+	return sk->sk_prot->stream_memory_free ?
+		sk->sk_prot->stream_memory_free(sk, wake) : true;
+#endif
 }
 
 static inline bool sk_stream_memory_free(const struct sock *sk)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-20 21:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-18 19:44 [PATCH net-next] net: stream: fix TCP references when INET is not enabled Randy Dunlap
2020-11-20 21:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).