[PATCH mptcp-next] mptcp: bpf: fix compilation error without BPF_JIT

Matthieu Baerts (NGI0) posted 1 patch 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20240131134421.1045648-2-matttbe@kernel.org
net/mptcp/bpf.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH mptcp-next] mptcp: bpf: fix compilation error without BPF_JIT
Posted by Matthieu Baerts (NGI0) 9 months ago
'bpf_mptcp_sched_ops' is only declared is CONFIG_BPF_JIT is set.

I guess we don't want to define it if we don't need it. We could add a
new helper doing nothing if BPF_JIT is not enabled, but it is probably
enough to just add a ifdef here, in the init function.

Fixes: 8ac5b9528258 ("mptcp: bpf: adapt code to match upstream changes")
Fixes: e76812a9ec49 ("bpf: Add bpf_mptcp_sched_ops")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401312020.oG1MfzT1-lkp@intel.com/
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/bpf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
index 55a65899b179..6ba531032fce 100644
--- a/net/mptcp/bpf.c
+++ b/net/mptcp/bpf.c
@@ -238,7 +238,9 @@ static int __init bpf_mptcp_kfunc_init(void)
 	ret = register_btf_fmodret_id_set(&bpf_mptcp_fmodret_set);
 	ret = ret ?: register_btf_kfunc_id_set(BPF_PROG_TYPE_STRUCT_OPS,
 						&bpf_mptcp_sched_kfunc_set);
+#ifdef CONFIG_BPF_JIT
 	ret = ret ?: register_bpf_struct_ops(&bpf_mptcp_sched_ops, mptcp_sched_ops);
+#endif
 
 	return ret;
 }

base-commit: 2710fa51b8b5cdfc0bd517cfd6e1cb3d52fc8cd8
-- 
2.43.0
Re: mptcp: bpf: fix compilation error without BPF_JIT: Tests Results
Posted by MPTCP CI 9 months ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI (GitHub Action) did some validations and here is its report:

- KVM Validation: normal:
  - Success! ✅:
  - Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/7727148307

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/0192755fd7f4


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-normal

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 (NGI0 Core)
Re: [PATCH mptcp-next] mptcp: bpf: fix compilation error without BPF_JIT
Posted by Matthieu Baerts 9 months ago
Hello,

On 31/01/2024 14:44, Matthieu Baerts (NGI0) wrote:
> 'bpf_mptcp_sched_ops' is only declared is CONFIG_BPF_JIT is set.
> 
> I guess we don't want to define it if we don't need it. We could add a
> new helper doing nothing if BPF_JIT is not enabled, but it is probably
> enough to just add a ifdef here, in the init function.

I just applied this patch in our tree:

- 2a40d851a830: "squashed" (with conflicts) in "bpf: Add
bpf_mptcp_sched_ops"
- eefa3de9ecc1: conflict in t/bpf-Add-bpf_mptcp_sched_kfunc_set
- Results: 2710fa51b8b5..807457afb707 (export)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: mptcp: bpf: fix compilation error without BPF_JIT: Tests Results
Posted by MPTCP CI 9 months ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI (Cirrus) did some validations with a debug kernel and here is its report:

- {"code":404,"message":
  - "Can't find artifacts containing file conclusion.txt"}:
  - Task: https://cirrus-ci.com/task/5147216461955072
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/5147216461955072/summary/summary.txt

- {"code":404,"message":
  - "Can't find artifacts containing file conclusion.txt"}:
  - Task: https://cirrus-ci.com/task/6273116368797696
  - Summary: https://api.cirrus-ci.com/v1/artifact/task/6273116368797696/summary/summary.txt

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/0192755fd7f4


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 (NGI0 Core)
Re: mptcp: bpf: fix compilation error without BPF_JIT: Tests Results
Posted by Matthieu Baerts 9 months ago
Hello,

On 31/01/2024 14:57, MPTCP CI wrote:
> Hi Matthieu,
> 
> Thank you for your modifications, that's great!
> 
> Our CI (Cirrus) did some validations with a debug kernel and here is its report:
> 
> - {"code":404,"message":
>   - "Can't find artifacts containing file conclusion.txt"}:
>   - Task: https://cirrus-ci.com/task/5147216461955072
>   - Summary: https://api.cirrus-ci.com/v1/artifact/task/5147216461955072/summary/summary.txt
> 
> - {"code":404,"message":
>   - "Can't find artifacts containing file conclusion.txt"}:
>   - Task: https://cirrus-ci.com/task/6273116368797696
>   - Summary: https://api.cirrus-ci.com/v1/artifact/task/6273116368797696/summary/summary.txt

We just reached the monthly limit... (on the last day)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.