* [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled @ 2022-07-11 13:07 Jiri Olsa 2022-07-11 14:41 ` mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled: Tests Results MPTCP CI ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: Jiri Olsa @ 2022-07-11 13:07 UTC (permalink / raw) To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Mat Martineau, Matthieu Baerts Cc: netdev, bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend, KP Singh, Geliang Tang, mptcp 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. 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 + struct mptcp_out_options { #if IS_ENABLED(CONFIG_MPTCP) u16 suboptions; -- 2.35.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled: Tests Results 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 CI 2022-07-11 20:27 ` [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled Martin KaFai Lau 2022-07-11 21:21 ` Mat Martineau 2 siblings, 0 replies; 8+ messages in thread From: MPTCP CI @ 2022-07-11 14:41 UTC (permalink / raw) To: Jiri Olsa; +Cc: mptcp Hi Jiri, Thank you for your modifications, that's great! Our CI did some validations and here is its report: - KVM Validation: normal: - Unstable: 2 failed test(s): selftest_mptcp_join selftest_simult_flows 🔴: - Task: https://cirrus-ci.com/task/5307521400307712 - Summary: https://api.cirrus-ci.com/v1/artifact/task/5307521400307712/summary/summary.txt - KVM Validation: debug: - Unstable: 1 failed test(s): selftest_mptcp_join 🔴: - Task: https://cirrus-ci.com/task/6433421307150336 - Summary: https://api.cirrus-ci.com/v1/artifact/task/6433421307150336/summary/summary.txt Initiator: Patchew Applier Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/1d9ed6cb0b33 If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.: $ cd [kernel source code] $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \ --pull always mptcp/mptcp-upstream-virtme-docker:latest \ auto-debug For more details: https://github.com/multipath-tcp/mptcp-upstream-virtme-docker Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-) Cheers, MPTCP GH Action bot Bot operated by Matthieu Baerts (Tessares) ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled 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 2022-07-11 21:21 ` Mat Martineau 2 siblings, 0 replies; 8+ messages in thread From: Martin KaFai Lau @ 2022-07-11 20:27 UTC (permalink / raw) To: Jiri Olsa Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Mat Martineau, Matthieu Baerts, netdev, bpf, Song Liu, Yonghong Song, John Fastabend, KP Singh, Geliang Tang, mptcp 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 > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled 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 ` [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled Martin KaFai Lau @ 2022-07-11 21:21 ` Mat Martineau 2022-07-12 9:06 ` Matthieu Baerts 2 siblings, 1 reply; 8+ messages in thread From: Mat Martineau @ 2022-07-11 21:21 UTC (permalink / raw) To: Jiri Olsa Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Matthieu Baerts, netdev, bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend, KP Singh, Geliang Tang, mptcp On Mon, 11 Jul 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. > > 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 The only use of struct mptcp_sock I see with !CONFIG_MPTCP is from this stub at the end of mptcp.h: static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk) { return NULL; } It's normally defined in net/mptcp/protocol.h for the MPTCP subsystem code. The conditional could be added on the line before the stub to make it clear that the empty struct is associated with that inline stub. > + > struct mptcp_out_options { > #if IS_ENABLED(CONFIG_MPTCP) > u16 suboptions; > -- > 2.35.3 > > -- Mat Martineau Intel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled 2022-07-11 21:21 ` Mat Martineau @ 2022-07-12 9:06 ` Matthieu Baerts 2022-07-12 12:12 ` Jiri Olsa 0 siblings, 1 reply; 8+ messages in thread From: Matthieu Baerts @ 2022-07-12 9:06 UTC (permalink / raw) To: Mat Martineau, Jiri Olsa Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, netdev, bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend, KP Singh, Geliang Tang, mptcp Hi Jiri, Mat, On 11/07/2022 23:21, Mat Martineau wrote: > On Mon, 11 Jul 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. >> >> 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 > > The only use of struct mptcp_sock I see with !CONFIG_MPTCP is from this > stub at the end of mptcp.h: > > static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock > *sk) { return NULL; } > > It's normally defined in net/mptcp/protocol.h for the MPTCP subsystem code. > > The conditional could be added on the line before the stub to make it > clear that the empty struct is associated with that inline stub. If this is required only for this specific BPF function, why not modifying this stub (or add a define) to return "void *" instead of "struct mptcp_sock *"? Cheers, Matt -- Tessares | Belgium | Hybrid Access Solutions www.tessares.net ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled 2022-07-12 9:06 ` Matthieu Baerts @ 2022-07-12 12:12 ` Jiri Olsa 2022-07-12 13:06 ` Matthieu Baerts 0 siblings, 1 reply; 8+ messages in thread From: Jiri Olsa @ 2022-07-12 12:12 UTC (permalink / raw) To: Matthieu Baerts Cc: Mat Martineau, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, netdev, bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend, KP Singh, Geliang Tang, mptcp On Tue, Jul 12, 2022 at 11:06:38AM +0200, Matthieu Baerts wrote: > Hi Jiri, Mat, > > On 11/07/2022 23:21, Mat Martineau wrote: > > On Mon, 11 Jul 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. > >> > >> 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 > > > > The only use of struct mptcp_sock I see with !CONFIG_MPTCP is from this > > stub at the end of mptcp.h: > > > > static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock > > *sk) { return NULL; } > > > > It's normally defined in net/mptcp/protocol.h for the MPTCP subsystem code. > > > > The conditional could be added on the line before the stub to make it > > clear that the empty struct is associated with that inline stub. > > If this is required only for this specific BPF function, why not > modifying this stub (or add a define) to return "void *" instead of > "struct mptcp_sock *"? so btf_sock_ids array needs BTF ID for 'struct mptcp_sock' and if CONFIG_MPTCP is not enabled, then resolve_btfids (which resolves and populate all BTF IDs) won't find it and will complain btf_sock_ids keeps all socket IDs regardles the state of their CONFIG options, and relies that sock structs are defined even if related CONFIG option is disabled if that is false assumption then maybe we need to make btf_sock_ids values optional somehow jirka ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled 2022-07-12 12:12 ` Jiri Olsa @ 2022-07-12 13:06 ` Matthieu Baerts 2022-07-12 17:05 ` Mat Martineau 0 siblings, 1 reply; 8+ messages in thread From: Matthieu Baerts @ 2022-07-12 13:06 UTC (permalink / raw) To: Jiri Olsa Cc: Mat Martineau, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, netdev, bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend, KP Singh, Geliang Tang, mptcp Hi Jiri, On 12/07/2022 14:12, Jiri Olsa wrote: > On Tue, Jul 12, 2022 at 11:06:38AM +0200, Matthieu Baerts wrote: >> Hi Jiri, Mat, >> >> On 11/07/2022 23:21, Mat Martineau wrote: >>> On Mon, 11 Jul 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. >>>> >>>> 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 >>> >>> The only use of struct mptcp_sock I see with !CONFIG_MPTCP is from this >>> stub at the end of mptcp.h: >>> >>> static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock >>> *sk) { return NULL; } >>> >>> It's normally defined in net/mptcp/protocol.h for the MPTCP subsystem code. >>> >>> The conditional could be added on the line before the stub to make it >>> clear that the empty struct is associated with that inline stub. >> >> If this is required only for this specific BPF function, why not >> modifying this stub (or add a define) to return "void *" instead of >> "struct mptcp_sock *"? > > so btf_sock_ids array needs BTF ID for 'struct mptcp_sock' and if CONFIG_MPTCP > is not enabled, then resolve_btfids (which resolves and populate all BTF IDs) > won't find it and will complain > > btf_sock_ids keeps all socket IDs regardles the state of their CONFIG options, > and relies that sock structs are defined even if related CONFIG option is disabled Thank you for the explanation. I didn't know about that. Then it is fine for me to leave it in mptcp.h. If it is not directly linked to bpf_mptcp_sock_from_subflow(), I guess it can stay there but maybe better to wait for Mat's answer about that. > if that is false assumption then maybe we need to make btf_sock_ids values optional > somehow Cheers, Matt -- Tessares | Belgium | Hybrid Access Solutions www.tessares.net ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled 2022-07-12 13:06 ` Matthieu Baerts @ 2022-07-12 17:05 ` Mat Martineau 0 siblings, 0 replies; 8+ messages in thread From: Mat Martineau @ 2022-07-12 17:05 UTC (permalink / raw) To: Matthieu Baerts Cc: Jiri Olsa, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, netdev, bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend, KP Singh, Geliang Tang, mptcp [-- Attachment #1: Type: text/plain, Size: 2973 bytes --] On Tue, 12 Jul 2022, Matthieu Baerts wrote: > Hi Jiri, > > On 12/07/2022 14:12, Jiri Olsa wrote: >> On Tue, Jul 12, 2022 at 11:06:38AM +0200, Matthieu Baerts wrote: >>> Hi Jiri, Mat, >>> >>> On 11/07/2022 23:21, Mat Martineau wrote: >>>> On Mon, 11 Jul 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. >>>>> >>>>> 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 >>>> >>>> The only use of struct mptcp_sock I see with !CONFIG_MPTCP is from this >>>> stub at the end of mptcp.h: >>>> >>>> static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock >>>> *sk) { return NULL; } >>>> >>>> It's normally defined in net/mptcp/protocol.h for the MPTCP subsystem code. >>>> >>>> The conditional could be added on the line before the stub to make it >>>> clear that the empty struct is associated with that inline stub. >>> >>> If this is required only for this specific BPF function, why not >>> modifying this stub (or add a define) to return "void *" instead of >>> "struct mptcp_sock *"? >> >> so btf_sock_ids array needs BTF ID for 'struct mptcp_sock' and if CONFIG_MPTCP >> is not enabled, then resolve_btfids (which resolves and populate all BTF IDs) >> won't find it and will complain >> >> btf_sock_ids keeps all socket IDs regardles the state of their CONFIG options, >> and relies that sock structs are defined even if related CONFIG option is disabled > > Thank you for the explanation. I didn't know about that. > > Then it is fine for me to leave it in mptcp.h. If it is not directly > linked to bpf_mptcp_sock_from_subflow(), I guess it can stay there but > maybe better to wait for Mat's answer about that. > >> if that is false assumption then maybe we need to make btf_sock_ids values optional >> somehow > I'd rather keep the full mptcp_sock definition in net/mptcp/protocol.h since moving it would require also moving a few other structs it depends on. Defining the empty struct in mptcp.h is fine with me and it sounds like that meets the needs of btf_sock_ids - but I'd like a v2 of this patch that moves the new empty struct declaration next to the inline btf_mptcp_sock_from_subflow function in mptcp.h -- Mat Martineau Intel ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-07-12 17:05 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 ` [PATCH bpf-next] mptcp: Add struct mptcp_sock definition when CONFIG_MPTCP is disabled Martin KaFai Lau 2022-07-11 21:21 ` 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
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).