fixes for "add mptcp_subflow bpf_iter" v10
Subsystems (5)
Geliang Tang
reviewercover fixes for "add mptcp_subflow bpf_iter" v10
From: Geliang Tang <[email protected]>
There's a building error in v10:
progs/mptcp_bpf_iters.c:24:8: error: call to undeclared function 'bpf_mptcp_sk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
24 | msk = bpf_mptcp_sk((struct sock *)sk);
| ^progs/mptcp_bpf_iters.c:24:6: error: incompatible integer to pointer conversion assigning to 'struct mptcp_sock *' from 'int' [-Wint-conversion]
24 | msk = bpf_mptcp_sk((struct sock *)sk);
bpf_mptcp_sk() definition is missing. It will be used in patch 4.
Depends on:
- "add mptcp_subflow bpf_iter" v10
Based-on: <[email protected]>
Geliang Tang (2):
Squash to "bpf: Register mptcp common kfunc set" Squash to "selftests/bpf: Add mptcp_subflow bpf_iter test prog"
net/mptcp/bpf.c | 6 ++++++ tools/testing/selftests/bpf/progs/mptcp_bpf.h | 1 + 2 files changed, 7 insertions(+)
Signature · 1 line
2.43.0
Geliang Tang
reviewerPATCH 1/2 Squash to "bpf: Register mptcp common kfunc set"
From: Geliang Tang <[email protected]>
bpf_mptcp_sk() definition is missing. It will be used in patch 4.
Please update the commit log:
'''
MPTCP helper mptcp_sk() is used to convert struct sock to mptcp_sock. Helpers mptcp_subflow_ctx() and mptcp_subflow_tcp_sock() are used to convert between struct mptcp_subflow_context and sock. They all will be used in MPTCP BPF programs too. This patch defines corresponding wrappers of them, and put the wrappers into mptcp common kfunc set and register the set with the flag BPF_PROG_TYPE_UNSPEC to let them accessible to all types of BPF programs.
'''
--- net/mptcp/bpf.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/mptcp/bpf.c +6 -0
@@ -216,6 +216,11 @@ struct bpf_iter_mptcp_subflow_kern {__bpf_kfunc_start_defs (); +__bpf_kfunc static struct mptcp_sock *bpf_mptcp_sk(struct sock *sk) +{ +return mptcp_sk (sk); +} + __bpf_kfunc static struct mptcp_subflow_context *bpf_mptcp_subflow_ctx (const struct sock *sk) {
@@ -291,6 +296,7 @@ __bpf_kfunc static bool bpf_mptcp_subflow_queues_empty(struct sock *sk)__bpf_kfunc_end_defs (); BTF_KFUNCS_START(bpf_mptcp_common_kfunc_ids) +BTF_ID_FLAGS(func, bpf_mptcp_sk) BTF_ID_FLAGS(func, bpf_mptcp_subflow_ctx) BTF_ID_FLAGS(func, bpf_mptcp_subflow_tcp_sock) BTF_ID_FLAGS(func, bpf_iter_mptcp_subflow_new, KF_ITER_NEW | KF_TRUSTED_ARGS)
Signature · 1 line
2.43.0
Geliang Tang
reviewerPATCH 2/2 Squash to "selftests/bpf: Add mptcp_subflow bpf_iter test prog"
In reply to Geliang TangFrom: Geliang Tang <[email protected]>
Export bpf_mptcp_sk(), it is used in this test program.
--- tools/testing/selftests/bpf/progs/mptcp_bpf.h | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/progs/mptcp_bpf.h +1 -0
@@ -46,6 +46,7 @@ mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow)extern struct mptcp_sock *bpf_mptcp_sock_acquire (struct mptcp_sock *msk) __ksym; extern void bpf_mptcp_sock_release(struct mptcp_sock *msk) __ksym; +extern struct mptcp_sock *bpf_mptcp_sk (struct sock *sk) __ksym;extern struct mptcp_subflow_context *bpf_mptcp_subflow_ctx (const struct sock *sk) __ksym; extern struct sock *
Signature · 1 line
2.43.0
Hi Geliang,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Script error! ❓
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/11383143433
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/a092947680a3
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=900181
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-normalFor 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)