[PATCH mptcp-next] Squash to "bpf: add bpf_skc_to_mptcp_sock_proto"

Geliang Tang posted 1 patch 2 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/ffd704984e4e76741161d35ef127fde082d0add1.1648624018.git.geliang.tang@suse.com
Maintainers: Martin KaFai Lau <kafai@fb.com>, Andrii Nakryiko <andrii@kernel.org>, Matthieu Baerts <matthieu.baerts@tessares.net>, Alexei Starovoitov <ast@kernel.org>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, KP Singh <kpsingh@kernel.org>, John Fastabend <john.fastabend@gmail.com>, Yonghong Song <yhs@fb.com>, Mat Martineau <mathew.j.martineau@linux.intel.com>, Song Liu <songliubraving@fb.com>, Daniel Borkmann <daniel@iogearbox.net>
There is a newer version of this series
include/linux/bpf.h | 9 ---------
include/net/mptcp.h | 6 ++++++
2 files changed, 6 insertions(+), 9 deletions(-)
[PATCH mptcp-next] Squash to "bpf: add bpf_skc_to_mptcp_sock_proto"
Posted by Geliang Tang 2 years ago
Fix the build breaks reported by kernel test robot:

[mptcp:export 32/40] ld.lld: error: undefined symbol: bpf_mptcp_sock_from_subflow
[mptcp:export 32/40] filter.c:undefined reference to `bpf_mptcp_sock_from_subflow'

- add defined(CONFIG_BPF_JIT) too.
- move bpf_mptcp_sock_from_subflow from bpf.h to mptcp.h.

base-commit: export/20220329T195411

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 include/linux/bpf.h | 9 ---------
 include/net/mptcp.h | 6 ++++++
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 117ae3f9451e..bdb5298735ce 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -2372,15 +2372,6 @@ static inline u32 bpf_xdp_sock_convert_ctx_access(enum bpf_access_type type,
 }
 #endif /* CONFIG_INET */
 
-#if defined(CONFIG_MPTCP) && defined(CONFIG_BPF_SYSCALL)
-struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk);
-#else
-static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk)
-{
-	return NULL;
-}
-#endif /* defined(CONFIG_MPTCP) && defined(CONFIG_BPF_SYSCALL) */
-
 enum bpf_text_poke_type {
 	BPF_MOD_CALL,
 	BPF_MOD_JUMP,
diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index 8b1afd6f5cc4..877077b53200 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -284,4 +284,10 @@ static inline int mptcpv6_init(void) { return 0; }
 static inline void mptcpv6_handle_mapped(struct sock *sk, bool mapped) { }
 #endif
 
+#if defined(CONFIG_MPTCP) && defined(CONFIG_BPF_JIT) && defined(CONFIG_BPF_SYSCALL)
+struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk);
+#else
+static inline struct mptcp_sock *bpf_mptcp_sock_from_subflow(struct sock *sk) { return NULL; }
+#endif
+
 #endif /* __NET_MPTCP_H */
-- 
2.34.1


Re: [PATCH mptcp-next] Squash to "bpf: add bpf_skc_to_mptcp_sock_proto"
Posted by Matthieu Baerts 2 years ago
Hi Geliang,

On 30/03/2022 09:08, Geliang Tang wrote:
> Fix the build breaks reported by kernel test robot:
> 
> [mptcp:export 32/40] ld.lld: error: undefined symbol: bpf_mptcp_sock_from_subflow
> [mptcp:export 32/40] filter.c:undefined reference to `bpf_mptcp_sock_from_subflow'
> 
> - add defined(CONFIG_BPF_JIT) too.

Thanks for the fix!

> - move bpf_mptcp_sock_from_subflow from bpf.h to mptcp.h.

Should we add an explicit #include <net/mptcp.h> in filter.c.

But maybe it is enough to have net/mptcp.h in net/tcp.h?

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

Re: [PATCH mptcp-next] Squash to "bpf: add bpf_skc_to_mptcp_sock_proto"
Posted by Geliang Tang 2 years ago
On Wed, Mar 30, 2022 at 03:29:06PM +0200, Matthieu Baerts wrote:
> Hi Geliang,
> 
> On 30/03/2022 09:08, Geliang Tang wrote:
> > Fix the build breaks reported by kernel test robot:
> > 
> > [mptcp:export 32/40] ld.lld: error: undefined symbol: bpf_mptcp_sock_from_subflow
> > [mptcp:export 32/40] filter.c:undefined reference to `bpf_mptcp_sock_from_subflow'
> > 
> > - add defined(CONFIG_BPF_JIT) too.
> 
> Thanks for the fix!
> 
> > - move bpf_mptcp_sock_from_subflow from bpf.h to mptcp.h.
> 
> Should we add an explicit #include <net/mptcp.h> in filter.c.
> 
> But maybe it is enough to have net/mptcp.h in net/tcp.h?

Yes, net/mptcp.h is included in net/tcp.h already. So no need to add it
in filter.c explicitly. No build errors for this occurred in my test.

Thanks,
-Geliang

> 
> Cheers,
> Matt
> -- 
> Tessares | Belgium | Hybrid Access Solutions
> www.tessares.net
> 


Re: [PATCH mptcp-next] Squash to "bpf: add bpf_skc_to_mptcp_sock_proto"
Posted by Matthieu Baerts 2 years ago
On 30/03/2022 16:22, Geliang Tang wrote:
> On Wed, Mar 30, 2022 at 03:29:06PM +0200, Matthieu Baerts wrote:
>> Hi Geliang,
>>
>> On 30/03/2022 09:08, Geliang Tang wrote:
>>> Fix the build breaks reported by kernel test robot:
>>>
>>> [mptcp:export 32/40] ld.lld: error: undefined symbol: bpf_mptcp_sock_from_subflow
>>> [mptcp:export 32/40] filter.c:undefined reference to `bpf_mptcp_sock_from_subflow'
>>>
>>> - add defined(CONFIG_BPF_JIT) too.
>>
>> Thanks for the fix!
>>
>>> - move bpf_mptcp_sock_from_subflow from bpf.h to mptcp.h.
>>
>> Should we add an explicit #include <net/mptcp.h> in filter.c.
>>
>> But maybe it is enough to have net/mptcp.h in net/tcp.h?
> 
> Yes, net/mptcp.h is included in net/tcp.h already. So no need to add it
> in filter.c explicitly. No build errors for this occurred in my test.

Yes but I don't know if the recommendation is to add mptcp.h directly
just in case instead of "indirectly" via tcp.h. But that's more a
question for BPF maintainers, easy to fix later if needed!

So good for me to apply this and avoid issues reported by Intel's KBuild!

Now in our tree:

- 3b9cc9f027bf: "squashed" in "bpf: add bpf_skc_to_mptcp_sock_proto"
- Results: d2b06f03e554..ccc95f7c14d9 (export)

Builds and tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20220330T145030
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net