mbox series

[mptcp-next,v12,0/8] add mptcp_subflow bpf_iter

Message ID cover.1729267039.git.tanggeliang@kylinos.cn (mailing list archive)
Headers show
Series add mptcp_subflow bpf_iter | expand

Message

Geliang Tang Oct. 18, 2024, 4 p.m. UTC
From: Geliang Tang <tanggeliang@kylinos.cn>

v12:
 - squash patch 4 and patch 6 into one.
 - use TCP_IS_MPTCP instead of TCP_CONGESTION.

v11:
 - fix building errors in v10.
 - update patch 5, change bpf test IP addresses more like that of mptcp
   join selftests from:

	#define ADDR_1	"10.0.1.1"
	#define ADDR_2	"10.0.1.2"
	#define ADDR_3	"10.0.1.3"
	#define ADDR_4	"10.0.1.4"

   to 

	#define ADDR_1 "10.0.1.1"
	#define ADDR_2 "10.0.2.1"
	#define ADDR_3 "10.0.3.1"
	#define ADDR_4 "10.0.4.1"

   This ensures that it can be expanded to two namespaces in the future.

v10:
 - rename bpf prog to "mptcp_bpf_iters.c" and change it as
   "cgroup/getsockopt" type. Since another bpf_iter "mptcp_address",
   to traverse all address entries on userspace_pm_local_addr_list of
   an MPTCP socket for implementing the MPTCP BPF path manager, will be
   added in the next set. The test program for "mptcp_address" bpf_iter
   will be added into this "mptcp_bpf_iters.c" file too and also defined
   as "cgroup/getsockopt" type.
 - change all bpf kfunc static as Matt suggested.
 - drop mptcp_subflow_active and mptcp_subflow_set_scheduled from the
   test program as Matt suggested.

v9:
 - rename bpf prog to "mptcp_bpf_iters_subflow.c"
 - drop the helper bpf_mptcp_sk(), it's not used in this test.

v8:
 - Make the test prog in patch 4 more like a bpf packet scheduler.
 - Export more mptcp helpers into BPF in patch 1.

v7:
 - As Martin recently replied, mptcp_stubflow bpf_iter can still be
used in tracing. So go back to the tracing selftest.

v6:
 - add KF_TRUSTED_ARGS flag in patch 2 (Andrii, Martin), then acquire
and release helpers (patch 3) are needed to be implemented.
 - test mptcp_subflow bpf_iter in "cgroup/getsockopt" (patch 5),
instead of testing them in "tracing" (Martin).

v5:
 - update patch 1 as Andrii suggested: if msk is NULL, initialize
kit->msk to NULL in _new() and check it in _next().

v4:
 - squash patch 1/5 and 3/5 in v3 together as Matt suggested.
 - a new squash-to patch to drop mptcp_subflow_active declaration in
   bpf_burst.

v3:
 - drop bpf_iter__mptcp_subflow, __diag_push, __diag_pop and
 __diag_ignore_all
 - drop declarations for bpf kfuncs

v2:
 - update patch 1 as Martin and Andrii suggested.
 - fix warnings and errors reported by MPTCP CI.

This patch set adds a mptcp_subflow type bpf_iter, and self tests.

Geliang Tang (8):
  bpf: Register mptcp common kfunc set
  bpf: Add mptcp_subflow bpf_iter
  bpf: Acquire and release mptcp socket
  selftests/bpf: More endpoints for endpoint_init
  selftests/bpf: Add mptcp_subflow bpf_iter subtest
  Squash to "selftests/bpf: Add bpf scheduler test"
  Revert "bpf: Export more bpf_burst related functions"
  Squash to "bpf: Add bpf_mptcp_sched_kfunc_set"

 net/mptcp/bpf.c                               |  99 ++++++++++++-
 net/mptcp/protocol.h                          |   1 -
 .../testing/selftests/bpf/bpf_experimental.h  |   7 +
 .../testing/selftests/bpf/prog_tests/mptcp.c  | 131 +++++++++++++++++-
 tools/testing/selftests/bpf/progs/mptcp_bpf.h |   9 ++
 .../selftests/bpf/progs/mptcp_bpf_iters.c     |  64 +++++++++
 6 files changed, 298 insertions(+), 13 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_iters.c

Comments

MPTCP CI Oct. 18, 2024, 5:11 p.m. UTC | #1
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): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/11407291080

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/a649b4b1bfca
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=900798


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)
Matthieu Baerts Oct. 21, 2024, 5:37 p.m. UTC | #2
Hi Geliang,

On 18/10/2024 18:00, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v12:
>  - squash patch 4 and patch 6 into one.
>  - use TCP_IS_MPTCP instead of TCP_CONGESTION.

Thank you for the new version. The new test looks good to me.

I just applied the series in our tree, before the BPF sched patches.
There were quite a few conflicts I had to resolve, and code to move from
already applied patches, to the new ones here. I also fixed a few issues
reported by checkpatch while at it: __aligned(), s/veriable/variable/,
and go to the new lines for some long lines. Can you please check
everything has been applied as expected?

New patches for t/upstream:
- d5e58ecf7fa8: Squash to "selftests/bpf: Add bpf scheduler test"
- 5a74aa7f2e5e: Revert "bpf: Export more bpf_burst related functions"
- 5ad76db0b5cb: Squash to "bpf: Add bpf_mptcp_sched_kfunc_set"
- 11fcde02a32a: tg:msg: update after the recent squash-to patch
- dae167c2e8d9: conflict in t/mptcp-add-sched_data-helpers-2
- e5a676e5c48d: conflict in t/mptcp-add-bpf_mptcp_sched_ops
- 0f852643d30d: conflict in t/bpf-Add-bpf_mptcp_sched_kfunc_set
- 0bb27f0be108: conflict in t/selftests-bpf-Add-bpf-scheduler-test
- 637c2378c777: conflict in t/selftests-bpf-add-bpf_first-scheduler
- 5ac242f7d4d0: conflict in t/bpf-Export-more-bpf_burst-related-functions
- Results: 096928239c3d..cb54960b2b51 (export)

- d5e58ecf7fa8: "squashed" patch 6/8 in "selftests/bpf: Add bpf
scheduler test"
- 5a74aa7f2e5e: "squashed" patch 7/8 in "bpf: Export more bpf_burst
related functions"
- 5ad76db0b5cb: "squashed" patch 8/8 in "bpf: Add bpf_mptcp_sched_kfunc_set"
- Results: cb54960b2b51..95f1f908edb3 (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/f2798ec6af402483b2dde42f108c05363fef8706/checks

Cheers,
Matt