diff mbox series

[net] tcp: Add a stub for sk_defer_free_flush()

Message ID 20220120123440.9088-1-gal@nvidia.com (mailing list archive)
State Accepted
Commit 48cec899e357cfb92d022a9c0df6bbe72a7f6951
Delegated to: Netdev Maintainers
Headers show
Series [net] tcp: Add a stub for sk_defer_free_flush() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1100 this patch: 1100
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 148 this patch: 148
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1110 this patch: 1110
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Gal Pressman Jan. 20, 2022, 12:34 p.m. UTC
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")
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
---
 include/net/tcp.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Eric Dumazet Jan. 20, 2022, 12:39 p.m. UTC | #1
On Thu, Jan 20, 2022 at 4:34 AM Gal Pressman <gal@nvidia.com> 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'

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

Reviewed-by: Eric Dumazet <edumazet@google.com>
Jakub Kicinski Jan. 20, 2022, 4:05 p.m. UTC | #2
On Thu, 20 Jan 2022 04:39:19 -0800 Eric Dumazet wrote:
> On Thu, Jan 20, 2022 at 4:34 AM Gal Pressman <gal@nvidia.com> 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'  
> 
> 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?
Eric Dumazet Jan. 20, 2022, 4:13 p.m. UTC | #3
On Thu, Jan 20, 2022 at 8:05 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Thu, 20 Jan 2022 04:39:19 -0800 Eric Dumazet wrote:
> > On Thu, Jan 20, 2022 at 4:34 AM Gal Pressman <gal@nvidia.com> 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'
> >
> > 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 ?
Jakub Kicinski Jan. 20, 2022, 4:25 p.m. UTC | #4
On Thu, 20 Jan 2022 08:13:24 -0800 Eric Dumazet wrote:
> On Thu, Jan 20, 2022 at 8:05 AM Jakub Kicinski <kuba@kernel.org> wrote:
> > 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
patchwork-bot+netdevbpf@kernel.org Jan. 21, 2022, 6 a.m. UTC | #5
Hello:

This patch was applied to netdev/net.git (master)
by Jakub Kicinski <kuba@kernel.org>:

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!
diff mbox series

Patch

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 44e442bf23f9..b9fc978fb2ca 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -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);