BPF packet scheduler updates part 3
Subsystems (5)
cover BPF packet scheduler updates part 3
Some cleanups.
Geliang Tang (4):
Squash to "mptcp: add sched_data helpers" Squash to "bpf: Add bpf_mptcp_sched_kfunc_set" Squash to "selftests/bpf: add two mptcp netns helpers" Squash to "bpf: Export more bpf_burst related functions"
net/mptcp/bpf.c | 10 ++++++++-- net/mptcp/protocol.h | 6 ------ net/mptcp/sched.c | 6 ++++++ tools/testing/selftests/bpf/prog_tests/mptcp.c | 1 - 4 files changed, 14 insertions(+), 9 deletions(-)
Signature · 1 line
2.35.3
PATCH 1/4 Squash to "mptcp: add sched_data helpers"
Add "ignore -Wmissing-prototypes".
--- net/mptcp/protocol.h | 4 ---- net/mptcp/sched.c | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-)
net/mptcp/protocol.h +0 -4
@@ -672,10 +672,6 @@ int mptcp_init_sched(struct mptcp_sock *msk,void mptcp_release_sched (struct mptcp_sock *msk);void mptcp_subflow_set_scheduled (struct mptcp_subflow_context *subflow,bool scheduled); -void mptcp_sched_data_set_contexts (const struct mptcp_sock *msk, -struct mptcp_sched_data *data); -struct mptcp_subflow_context * -mptcp_subflow_ctx_by_pos (const struct mptcp_sched_data *data,unsigned int pos);struct sock *mptcp_subflow_get_send (struct mptcp_sock *msk);struct sock *mptcp_subflow_get_retrans (struct mptcp_sock *msk);int mptcp_sched_get_send (struct mptcp_sock *msk);
net/mptcp/sched.c +6 -0
@@ -127,6 +127,10 @@ void mptcp_subflow_set_scheduled(struct mptcp_subflow_context *subflow,WRITE_ONCE (subflow->scheduled, scheduled); } +__diag_push (); +__diag_ignore_all ("-Wmissing-prototypes" , +"kfuncs which will be used in BPF programs" ); +void mptcp_sched_data_set_contexts (const struct mptcp_sock *msk,struct mptcp_sched_data *data) {
@@ -155,6 +159,8 @@ mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos)return data->contexts[pos]; } +__diag_pop (); +int mptcp_sched_get_send (struct mptcp_sock *msk) {struct mptcp_subflow_context *subflow;
Signature · 1 line
2.35.3
PATCH 2/4 Squash to "bpf: Add bpf_mptcp_sched_kfunc_set"
In reply to Geliang TangRename bpf_mptcp_sched_kfunc_init to bpf_mptcp_kfunc_init. Since some kfuncs related "mptcpify" will init in this function too.
--- net/mptcp/bpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/mptcp/bpf.c +2 -2
@@ -171,12 +171,12 @@ static const struct btf_kfunc_id_set bpf_mptcp_sched_kfunc_set = { .set = &bpf_mptcp_sched_kfunc_ids, }; -static int __init bpf_mptcp_sched_kfunc_init (void ) +static int __init bpf_mptcp_kfunc_init (void ) {return register_btf_kfunc_id_set (BPF_PROG_TYPE_STRUCT_OPS , &bpf_mptcp_sched_kfunc_set); } -late_initcall (bpf_mptcp_sched_kfunc_init); +late_initcall (bpf_mptcp_kfunc_init);#endif /* CONFIG_BPF_JIT */ struct mptcp_sock *bpf_mptcp_sock_from_subflow (struct sock *sk)
Signature · 1 line
2.35.3
PATCH 3/4 Squash to "selftests/bpf: add two mptcp netns helpers"
In reply to Geliang TangJust drop a black line.
--- tools/testing/selftests/bpf/prog_tests/mptcp.c | 1 - 1 file changed, 1 deletion(-)
tools/testing/selftests/bpf/prog_tests/mptcp.c +0 -1
@@ -198,7 +198,6 @@ static void test_base(void) fail:cleanup_netns (nstoken); -close (cgroup_fd); }
Signature · 1 line
2.35.3
PATCH 4/4 Squash to "bpf: Export more bpf_burst related functions"
In reply to Geliang TangAdd "ignore -Wmissing-prototypes".
--- net/mptcp/bpf.c | 6 ++++++ net/mptcp/protocol.h | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-)
net/mptcp/bpf.c +6 -0
@@ -144,6 +144,10 @@ struct bpf_struct_ops bpf_mptcp_sched_ops = { .name = "mptcp_sched_ops", }; +__diag_push (); +__diag_ignore_all ("-Wmissing-prototypes" , +"kfuncs which will be used in BPF programs" ); +bool bpf_mptcp_subflow_memory_free (const struct sock *sk) {return sk_stream_memory_free (sk);
@@ -154,6 +158,8 @@ bool bpf_mptcp_subflow_queues_empty(const struct sock *sk)return tcp_rtx_and_write_queues_empty (sk); } +__diag_pop (); + BTF_SET8_START(bpf_mptcp_sched_kfunc_ids) BTF_ID_FLAGS(func, mptcp_subflow_set_scheduled) BTF_ID_FLAGS(func, mptcp_sched_data_set_contexts)
net/mptcp/protocol.h +0 -2
@@ -643,8 +643,6 @@ void mptcp_subflow_queue_clean(struct sock *sk, struct sock *ssk);void mptcp_sock_graft (struct sock *sk,struct socket *parent);u64 mptcp_wnd_end (const struct mptcp_sock *msk);void mptcp_set_timeout (struct sock *sk); -bool bpf_mptcp_subflow_memory_free (const struct sock *sk); -bool bpf_mptcp_subflow_queues_empty (const struct sock *sk);struct sock *__mptcp_nmpc_sk (struct mptcp_sock *msk);bool __mptcp_close (struct sock *sk,long timeout);void mptcp_cancel_work (struct sock *sk);
Signature · 1 line
2.35.3
Re: Squash to "bpf: Export more bpf_burst related functions": Build Failure
Hi Geliang,
Thank you for your modifications, that's great!
But sadly, our CI spotted some issues with it when trying to build it.
You can find more details there:
https://patchwork.kernel.org/project/mptcp/patch/d2bc86f8116310c2f3b2931fc3565ef7cce17027.1690801329.git.geliang.tang@suse.com/
https://github.com/multipath-tcp/mptcp_net-next/actions/runs/5714012631
Status: failure
Initiator: MPTCPimporter
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/23c0513506c6
Feel free to reply to this email if you cannot access logs, if you need some support to fix the error, if this doesn't seem to be caused by your modifications or if the error is a false positive one.
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (Tessares)
Re: Squash to "bpf: Export more bpf_burst related functions": Tests Results
In reply to Geliang TangHi Geliang,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5989050666975232
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5989050666975232/summary/summary.txt
- KVM Validation: normal (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/5426100713553920
- Summary: https://api.cirrus-ci.com/v1/artifact/task/5426100713553920/summary/summary.txt
- KVM Validation: debug (only selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/4722413271777280
- Summary: https://api.cirrus-ci.com/v1/artifact/task/4722413271777280/summary/summary.txt
- KVM Validation: debug (except selftest_mptcp_join):
- Success! ✅:
- Task: https://cirrus-ci.com/task/6552000620396544
- Summary: https://api.cirrus-ci.com/v1/artifact/task/6552000620396544/summary/summary.txt
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/23c0513506c6
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-debugFor 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)