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 |
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
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 --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 */