Skip to contentSkip to conversation

mptcp: bpf: fix compilation error without BPF_JIT

PATCH In review Matthieu Baerts (NGI0) 2 participants 5 messages Jan 31, 2024

Subsystems (2)
lore
Share & tools
lore

Matthieu Baerts (NGI0)

author maintainer
#0 lore raw

PATCH 1/1 mptcp: bpf: fix compilation error without BPF_JIT

'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")
---
 net/mptcp/bpf.c | 2 ++
 1 file changed, 2 insertions(+)
net/mptcp/bpf.c +2 -0
index 55a65899b179..6ba531032fce 100644
@@ -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

Signature · 1 line
2.43.0
#1 lore raw

Re: mptcp: bpf: fix compilation error without BPF_JIT: Tests Results

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)

author maintainer
#2 lore raw

Re: mptcp: bpf: fix compilation error without BPF_JIT: Tests Results

Hello,

Quoted 11 lines · MPTCP CI

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

Quoted 4 lines

- {"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

Signature · 1 line
Sponsored by the NGI0 Core fund.
author maintainer
#3 lore raw
In reply to Matthieu Baerts (NGI0)

Hello,

Quoted 5 lines · 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

Signature · 1 line
Sponsored by the NGI0 Core fund.
#4 lore raw

Re: mptcp: bpf: fix compilation error without BPF_JIT: Tests Results

In reply to Matthieu Baerts (NGI0)

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)