diff mbox series

[PATCHv2,bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled

Message ID 20220802163324.1873044-1-jolsa@kernel.org (mailing list archive)
State Accepted
Commit f1d41f7720c89705c20e4335a807b1c518c2e7be
Delegated to: BPF
Headers show
Series [PATCHv2,bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -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: 1007 this patch: 1007
netdev/cc_maintainers warning 5 maintainers not CCed: davem@davemloft.net netdev@vger.kernel.org edumazet@google.com kuba@kernel.org pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 125 this patch: 125
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1014 this patch: 1014
netdev/checkpatch warning WARNING: 'difinition' may be misspelled - perhaps 'definition'?
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-1 success Logs for Kernel LATEST on ubuntu-latest with gcc
bpf/vmtest-bpf-next-VM_Test-2 success Logs for Kernel LATEST on ubuntu-latest with llvm-16
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-3 success Logs for Kernel LATEST on z15 with gcc

Commit Message

Jiri Olsa Aug. 2, 2022, 4:33 p.m. UTC
The btf_sock_ids array needs struct mptcp_sock BTF ID for
the bpf_skc_to_mptcp_sock helper.

When CONFIG_MPTCP is disabled, the 'struct mptcp_sock' is not
defined and resolve_btfids will complain with:

  BTFIDS  vmlinux
WARN: resolve_btfids: unresolved symbol mptcp_sock

Adding empty difinition for struct mptcp_sock when CONFIG_MPTCP
is disabled.

Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 include/net/mptcp.h | 4 ++++
 1 file changed, 4 insertions(+)

v2 changes:
  - moved the new empty struct declaration next to the inline
    bpf_mptcp_sock_from_subflow function [Mat]

Comments

Mat Martineau Aug. 2, 2022, 10:36 p.m. UTC | #1
On Tue, 2 Aug 2022, Jiri Olsa wrote:

> The btf_sock_ids array needs struct mptcp_sock BTF ID for
> the bpf_skc_to_mptcp_sock helper.
>
> When CONFIG_MPTCP is disabled, the 'struct mptcp_sock' is not
> defined and resolve_btfids will complain with:
>
>  BTFIDS  vmlinux
> WARN: resolve_btfids: unresolved symbol mptcp_sock
>
> Adding empty difinition for struct mptcp_sock when CONFIG_MPTCP
> is disabled.
>
> Acked-by: Martin KaFai Lau <kafai@fb.com>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>

Thanks Jiri, v2 looks good to merge in bpf-next:

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>


> ---
> include/net/mptcp.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> v2 changes:
>  - moved the new empty struct declaration next to the inline
>    bpf_mptcp_sock_from_subflow function [Mat]
>
> diff --git a/include/net/mptcp.h b/include/net/mptcp.h
> index ac9cf7271d46..412479ebf5ad 100644
> --- a/include/net/mptcp.h
> +++ b/include/net/mptcp.h
> @@ -291,4 +291,8 @@ struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk);
> static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk) { return NULL; }
> #endif
>
> +#if !IS_ENABLED(CONFIG_MPTCP)
> +struct mptcp_sock { };
> +#endif
> +
> #endif /* __NET_MPTCP_H */
> -- 
> 2.37.1
>
>

--
Mat Martineau
Intel
patchwork-bot+netdevbpf@kernel.org Aug. 8, 2022, 1:40 p.m. UTC | #2
Hello:

This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Tue,  2 Aug 2022 18:33:24 +0200 you wrote:
> The btf_sock_ids array needs struct mptcp_sock BTF ID for
> the bpf_skc_to_mptcp_sock helper.
> 
> When CONFIG_MPTCP is disabled, the 'struct mptcp_sock' is not
> defined and resolve_btfids will complain with:
> 
>   BTFIDS  vmlinux
> WARN: resolve_btfids: unresolved symbol mptcp_sock
> 
> [...]

Here is the summary with links:
  - [PATCHv2,bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled
    https://git.kernel.org/bpf/bpf/c/f1d41f7720c8

You are awesome, thank you!
diff mbox series

Patch

diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index ac9cf7271d46..412479ebf5ad 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -291,4 +291,8 @@  struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk);
 static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk) { return NULL; }
 #endif
 
+#if !IS_ENABLED(CONFIG_MPTCP)
+struct mptcp_sock { };
+#endif
+
 #endif /* __NET_MPTCP_H */