From: Martin KaFai Lau <kafai@fb.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Mat Martineau <mathew.j.martineau@linux.intel.com>,
Matthieu Baerts <matthieu.baerts@tessares.net>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@chromium.org>,
Geliang Tang <geliang.tang@suse.com>,
mptcp@lists.linux.dev
Subject: Re: [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled
Date: Mon, 11 Jul 2022 13:27:56 -0700 [thread overview]
Message-ID: <20220711202756.he4wdhb6zx6ipjge@kafai-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20220711130731.3231188-1-jolsa@kernel.org>
On Mon, Jul 11, 2022 at 03:07:31PM +0200, 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
BTF_TYPE_EMIT(struct mptcp_sock) did not help here because
'struct mptcp_sock' is not defined anywhere in the include/ ? :(
>
> Adding empty difinition for struct mptcp_sock when CONFIG_MPTCP
> is disabled.
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
> include/net/mptcp.h | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/include/net/mptcp.h b/include/net/mptcp.h
> index ac9cf7271d46..25741a52c666 100644
> --- a/include/net/mptcp.h
> +++ b/include/net/mptcp.h
> @@ -59,6 +59,10 @@ struct mptcp_addr_info {
> };
> };
>
> +#if !IS_ENABLED(CONFIG_MPTCP)
> +struct mptcp_sock { };
> +#endif
Considering a similar case in the existing 'struct mptcp_out_options',
this seems reasonable.
Acked-by: Martin KaFai Lau <kafai@fb.com>
> +
> struct mptcp_out_options {
> #if IS_ENABLED(CONFIG_MPTCP)
> u16 suboptions;
> --
> 2.35.3
>
next prev parent reply other threads:[~2022-07-11 20:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 13:07 [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled Jiri Olsa
2022-07-11 14:41 ` mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled: Tests Results MPTCP CI
2022-07-11 20:27 ` Martin KaFai Lau [this message]
2022-07-11 21:21 ` [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled Mat Martineau
2022-07-12 9:06 ` Matthieu Baerts
2022-07-12 12:12 ` Jiri Olsa
2022-07-12 13:06 ` Matthieu Baerts
2022-07-12 17:05 ` Mat Martineau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220711202756.he4wdhb6zx6ipjge@kafai-mbp.dhcp.thefacebook.com \
--to=kafai@fb.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=geliang.tang@suse.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@chromium.org \
--cc=mathew.j.martineau@linux.intel.com \
--cc=matthieu.baerts@tessares.net \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).