Skip to contentSkip to conversation

tcp: Add a stub for sk_defer_free_flush()

PATCH Applied Gal Pressman 4 participants 6 messages Jan 20, 2022 – Jan 21, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: Add a stub for sk_defer_free_flush()

When compiling the kernel with CONFIG_INET disabled, the sk_defer_free_flush() should be defined as a nop.

This resolves the following compilation error:
ld: net/core/sock.o: in function `sk_defer_free_flush':
./include/net/tcp.h:1378: undefined reference to `__sk_defer_free_flush'

Fixes 79074a72d335 ("net: Flush deferred skb free on socket destroy")
---
 include/net/tcp.h | 4 ++++
 1 file changed, 4 insertions(+)
include/net/tcp.h +4 -0
index 44e442bf23f9..b9fc978fb2ca 100644
@@ -1369,6 +1369,7 @@ static inline bool tcp_checksum_complete(struct sk_buff *skb)
 
 bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb);
 
+#ifdef CONFIG_INET
 void __sk_defer_free_flush(struct sock *sk);
 
 static inline void sk_defer_free_flush(struct sock *sk)
@@ -1377,6 +1378,9 @@ static inline void sk_defer_free_flush(struct sock *sk)
 		return;
 	__sk_defer_free_flush(sk);
 }
+#else
+static inline void sk_defer_free_flush(struct sock *sk) {}
+#endif
 
 int tcp_filter(struct sock *sk, struct sk_buff *skb);
 void tcp_set_state(struct sock *sk, int state);
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Gal Pressman

When compiling the kernel with CONFIG_INET disabled, the sk_defer_free_flush() should be defined as a nop.

This resolves the following compilation error:
ld: net/core/sock.o: in function `sk_defer_free_flush':
./include/net/tcp.h:1378: undefined reference to `__sk_defer_free_flush'

Yes, this is one way to fix this, thanks.

maintainer
#2 lore raw
Quoted 9 lines · On Thu, 20 Jan 2022 04:39:19 -0800 Eric Dumazet wrote:
Quoted 6 lines · Gal Pressman

When compiling the kernel with CONFIG_INET disabled, the sk_defer_free_flush() should be defined as a nop.

This resolves the following compilation error:
ld: net/core/sock.o: in function `sk_defer_free_flush':
./include/net/tcp.h:1378: undefined reference to `__sk_defer_free_flush'

Yes, this is one way to fix this, thanks.

Yeah.. isn't it better to move __sk_defer_free_flush and co. out of TCP code?

#3 lore raw
Quoted 6 lines · Jakub Kicinski
Quoted 4 lines · On Thu, 20 Jan 2022 04:39:19 -0800 Eric Dumazet wrote:
Quoted 3 lines · Gal Pressman

When compiling the kernel with CONFIG_INET disabled, the sk_defer_free_flush() should be defined as a nop.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

This resolves the following compilation error:
ld: net/core/sock.o: in function `sk_defer_free_flush':
./include/net/tcp.h:1378: undefined reference to `__sk_defer_free_flush'

Yes, this is one way to fix this, thanks.

Yeah.. isn't it better to move __sk_defer_free_flush and co. out of TCP code?

sk->defer_list is currently only fed from tcp_eat_recv_skb(), I guess we can leave the code, until we have another user than TCP ?

maintainer
#4 lore raw
Quoted 9 lines · On Thu, 20 Jan 2022 08:13:24 -0800 Eric Dumazet wrote:
Quoted 5 lines · Jakub Kicinski
Quoted 1 line · On Thu, 20 Jan 2022 04:39:19 -0800 Eric Dumazet wrote:

Yes, this is one way to fix this, thanks.

Yeah.. isn't it better to move __sk_defer_free_flush and co. out of TCP code?

sk->defer_list is currently only fed from tcp_eat_recv_skb(), I guess we can leave the code, until we have another user than TCP ?

I was mostly thinking of a way to avoid the #ifdef-inery but I guess it's not too bad

#5 lore raw
In reply to Gal Pressman
This patch was applied to netdev/net.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Thu, 20 Jan 2022 14:34:40 +0200 you wrote:

When compiling the kernel with CONFIG_INET disabled, the sk_defer_free_flush() should be defined as a nop.

This resolves the following compilation error:
ld: net/core/sock.o: in function `sk_defer_free_flush':
./include/net/tcp.h:1378: undefined reference to `__sk_defer_free_flush'

[...]

Here is the summary with links:
- [net] tcp: Add a stub for sk_defer_free_flush()

    https://git.kernel.org/netdev/net/c/48cec899e357

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html