[PATCH mptcp-next v9 0/8] refactor mptcp bpf tests

Geliang Tang posted 8 patches 2 weeks, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/cover.1713321357.git.tanggeliang@kylinos.cn
.../testing/selftests/bpf/prog_tests/mptcp.c  | 249 +++++-------------
1 file changed, 69 insertions(+), 180 deletions(-)
[PATCH mptcp-next v9 0/8] refactor mptcp bpf tests
Posted by Geliang Tang 2 weeks, 1 day ago
From: Geliang Tang <tanggeliang@kylinos.cn>

v9:
 - extract a new helper test_bpf_sched() from MPTCP_SCHED_TEST() to make
   the macro simpler as Mat suggested. (thanks)
 - squash MPTCP_SCHED_TEST() into "selftests/bpf: Add bpf_first
   scheduler & test", not "selftests/bpf: Add bpf scheduler test" to
   avoid a build error "test_bpf_sched is not used".

v8:
 - change argument types of send_data_and_verify from strings to
   booleans as Matt suggested.

v7:
 - address Matt's comments in v6 (thanks)
 - add more commit logs.
 - use WITH_DATA/WITHOUT_DATA instead of 1/0.
 - make patch 3 as a squash-to patch.

v6:
- drop patch 1 in v5 and rebased.

v5:
 - drop patch 5 in v4:
  Squash to "selftests/bpf: Add bpf scheduler test" 4 cleanup

v4:
 - add set_nonblock to make BPF tests stable.
 - split 'Squash to "selftests/bpf: Add bpf scheduler test"' into 4 patches.

v3:
 - part 1, bpf schedulers.

v2:
 - add two more helpers, send_single_byte and send_recv_data.

Refactor mptcp bpf tests using newly added macros MPTCP_BASE_TEST,
RUN_MPTCP_TEST and MPTCP_SCHED_TEST macro.

Geliang Tang (8):
  selftests/bpf: Add RUN_MPTCP_TEST macro
  Squash to "selftests/bpf: Add bpf scheduler test" 1 verify
  Squash to "selftests/bpf: Add bpf scheduler test" 2 time
  Squash to "selftests/bpf: Add bpf_first scheduler & test"
  Squash to "selftests/bpf: Add bpf_bkup scheduler & test"
  Squash to "selftests/bpf: Add bpf_rr scheduler & test"
  Squash to "selftests/bpf: Add bpf_red scheduler & test"
  Squash to "selftests/bpf: Add bpf_burst scheduler & test"

 .../testing/selftests/bpf/prog_tests/mptcp.c  | 249 +++++-------------
 1 file changed, 69 insertions(+), 180 deletions(-)

-- 
2.40.1
Re: [PATCH mptcp-next v9 0/8] refactor mptcp bpf tests
Posted by Matthieu Baerts 1 week, 6 days ago
Hi Geliang, Mat,

On 17/04/2024 04:38, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
> 
> v9:
>  - extract a new helper test_bpf_sched() from MPTCP_SCHED_TEST() to make
>    the macro simpler as Mat suggested. (thanks)
>  - squash MPTCP_SCHED_TEST() into "selftests/bpf: Add bpf_first
>    scheduler & test", not "selftests/bpf: Add bpf scheduler test" to
>    avoid a build error "test_bpf_sched is not used".
Thank you for the v9, and the review!

@Geliang: there were a lot of Git (TopGit) manipulations here, please
check that the result is the expected one.


New patch for t/upstream:

- d0432b7d2bb0: selftests/bpf: Add RUN_MPTCP_TEST macro
- 9791281821ba: conflict in t/selftests-bpf-Add-bpf-scheduler-test
- 92efb2a19752: conflict in t/selftests-bpf-add-bpf_first-test
- 78858b124aee: conflict in t/selftests-bpf-Add-bpf_bkup-test
- e25a04564f65: conflict in t/selftests-bpf-Add-bpf_rr-test
- d474c99c9c56: conflict in t/selftests-bpf-Add-bpf_red-test
- 0091786b07e3: conflict in t/selftests-bpf-Add-bpf_burst-test
- Results: eb9a8fbc1cd3..6ad6176a437b (export)


Squash-to patches:

- da0ce2d96df7: "squashed" "1 verify" (with conflicts) in
"selftests/bpf: Add bpf scheduler test"

- d08d36c72f3e: "squashed" "2 time" in "selftests/bpf: Add bpf scheduler
test"
- f9800e6dbb07: conflict in t/selftests-bpf-add-bpf_first-test

- d910fb60db22: "squashed" (with conflicts) in "selftests/bpf: Add
bpf_first test"
- 6723021b9a04: "squashed" "2 strlen" in "selftests/bpf: Add bpf_first test"
- 1bcf273624e6: "squashed" "3 err msg" in "selftests/bpf: Add bpf_first
test"
- 20df6c66a4bf: conflict in t/selftests-bpf-Add-bpf_bkup-test

- 6f9d19a73d33: "squashed" (with conflicts) in "selftests/bpf: Add
bpf_bkup test"
- 9c86e3027008: conflict in t/selftests-bpf-Add-bpf_rr-test

- 2bbbcc6cc7c1: "squashed" (with conflicts) in "selftests/bpf: Add
bpf_rr test"
- 3bdb5c116569: conflict in t/selftests-bpf-Add-bpf_red-test

- 9eb2410e20b4: "squashed" (with conflicts) in "selftests/bpf: Add
bpf_red test"
- 55e93f797697: conflict in t/selftests-bpf-Add-bpf_burst-test

- 9004d2b898a4: "squashed" (with conflicts) in "selftests/bpf: Add
bpf_burst test"
- Results: 6ad6176a437b..665448084780 (export)


Squash "sched & test":

- 57731e73cc97: tg:squash: bpf_first sched & test
- 45b46aeeb072: tg:msg: update after squash

- a5a572331f7c: tg:squash: bpf_bkup sched & test
- d89c4282bf53: tg:msg: update after squash

- 44155448f992: tg:squash: bpf_rr sched & test
- 702454c6ba93: tg:msg: update after squash

- 71681fc66d24: tg:squash: bpf_red sched & test
- a15a6438bcbd: tg:msg: update after squash

- 297175c89808: tg:squash: bpf_burst sched & test
- c4624cdf779e: tg:msg: update after squash
- Results: 665448084780..c23ad453d8cc (export)


While at it, I also updated your email address:
- dbec7401465d: tg:msg: update Geliang's email address
- facd3cec3d0a: tg:msg: update Geliang's email address
- 59127f756c66: tg:msg: update Geliang's email address
- c20d79792bb2: tg:msg: update Geliang's email address
- 5f3d6b7755a2: tg:msg: update Geliang's email address
- 05efce6832cb: tg:msg: update Geliang's email address
- becd15a77346: tg:msg: update Geliang's email address
- e2b1e31d7720: tg:msg: update Geliang's email address
- a3bcc475f994: tg:msg: update Geliang's email address
- 699e0dbd591c: tg:msg: update Geliang's email address
- 2d5b66a3675f: tg:msg: update Geliang's email address
- 1df821d94ac8: tg:msg: update Geliang's email address
- 7a0adfdb70d0: tg:msg: update Geliang's email address
- cce49572147a: tg:msg: update Geliang's email address
- fff8347933fd: tg:msg: update Geliang's email address
- 6118caa31040: tg:msg: update Geliang's email address
- 6603ca35adf6: tg:msg: remove my SoB
- Results: c23ad453d8cc..f0f388aa6196 (export)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-next v9 0/8] refactor mptcp bpf tests
Posted by Geliang Tang 1 week, 5 days ago
Hi Matt,

On Fri, 2024-04-19 at 11:58 +0200, Matthieu Baerts wrote:
> Hi Geliang, Mat,
> 
> On 17/04/2024 04:38, Geliang Tang wrote:
> > From: Geliang Tang <tanggeliang@kylinos.cn>
> > 
> > v9:
> >  - extract a new helper test_bpf_sched() from MPTCP_SCHED_TEST() to
> > make
> >    the macro simpler as Mat suggested. (thanks)
> >  - squash MPTCP_SCHED_TEST() into "selftests/bpf: Add bpf_first
> >    scheduler & test", not "selftests/bpf: Add bpf scheduler test"
> > to
> >    avoid a build error "test_bpf_sched is not used".
> Thank you for the v9, and the review!
> 
> @Geliang: there were a lot of Git (TopGit) manipulations here, please
> check that the result is the expected one.

Thank you for applying these patches. I know there must be many
conflicts inside. Thank you for updating my email address too. All
patches merged well and all tests passed.

> 
> 
> New patch for t/upstream:
> 
> - d0432b7d2bb0: selftests/bpf: Add RUN_MPTCP_TEST macro

Please insert this commit "selftests/bpf: Add RUN_MPTCP_TEST macro"
before "mptcp: add sched_data helpers" so that it can be upstreamed
in advance with "setsockopt per subflow: BPF" series being reviewed,
without waiting for BPF scheduler APIs to be updated. WDYT?

Regards,
-Geliang

> - 9791281821ba: conflict in t/selftests-bpf-Add-bpf-scheduler-test
> - 92efb2a19752: conflict in t/selftests-bpf-add-bpf_first-test
> - 78858b124aee: conflict in t/selftests-bpf-Add-bpf_bkup-test
> - e25a04564f65: conflict in t/selftests-bpf-Add-bpf_rr-test
> - d474c99c9c56: conflict in t/selftests-bpf-Add-bpf_red-test
> - 0091786b07e3: conflict in t/selftests-bpf-Add-bpf_burst-test
> - Results: eb9a8fbc1cd3..6ad6176a437b (export)
> 
> 
> Squash-to patches:
> 
> - da0ce2d96df7: "squashed" "1 verify" (with conflicts) in
> "selftests/bpf: Add bpf scheduler test"
> 
> - d08d36c72f3e: "squashed" "2 time" in "selftests/bpf: Add bpf
> scheduler
> test"
> - f9800e6dbb07: conflict in t/selftests-bpf-add-bpf_first-test
> 
> - d910fb60db22: "squashed" (with conflicts) in "selftests/bpf: Add
> bpf_first test"
> - 6723021b9a04: "squashed" "2 strlen" in "selftests/bpf: Add
> bpf_first test"
> - 1bcf273624e6: "squashed" "3 err msg" in "selftests/bpf: Add
> bpf_first
> test"
> - 20df6c66a4bf: conflict in t/selftests-bpf-Add-bpf_bkup-test
> 
> - 6f9d19a73d33: "squashed" (with conflicts) in "selftests/bpf: Add
> bpf_bkup test"
> - 9c86e3027008: conflict in t/selftests-bpf-Add-bpf_rr-test
> 
> - 2bbbcc6cc7c1: "squashed" (with conflicts) in "selftests/bpf: Add
> bpf_rr test"
> - 3bdb5c116569: conflict in t/selftests-bpf-Add-bpf_red-test
> 
> - 9eb2410e20b4: "squashed" (with conflicts) in "selftests/bpf: Add
> bpf_red test"
> - 55e93f797697: conflict in t/selftests-bpf-Add-bpf_burst-test
> 
> - 9004d2b898a4: "squashed" (with conflicts) in "selftests/bpf: Add
> bpf_burst test"
> - Results: 6ad6176a437b..665448084780 (export)
> 
> 
> Squash "sched & test":
> 
> - 57731e73cc97: tg:squash: bpf_first sched & test
> - 45b46aeeb072: tg:msg: update after squash
> 
> - a5a572331f7c: tg:squash: bpf_bkup sched & test
> - d89c4282bf53: tg:msg: update after squash
> 
> - 44155448f992: tg:squash: bpf_rr sched & test
> - 702454c6ba93: tg:msg: update after squash
> 
> - 71681fc66d24: tg:squash: bpf_red sched & test
> - a15a6438bcbd: tg:msg: update after squash
> 
> - 297175c89808: tg:squash: bpf_burst sched & test
> - c4624cdf779e: tg:msg: update after squash
> - Results: 665448084780..c23ad453d8cc (export)
> 
> 
> While at it, I also updated your email address:
> - dbec7401465d: tg:msg: update Geliang's email address
> - facd3cec3d0a: tg:msg: update Geliang's email address
> - 59127f756c66: tg:msg: update Geliang's email address
> - c20d79792bb2: tg:msg: update Geliang's email address
> - 5f3d6b7755a2: tg:msg: update Geliang's email address
> - 05efce6832cb: tg:msg: update Geliang's email address
> - becd15a77346: tg:msg: update Geliang's email address
> - e2b1e31d7720: tg:msg: update Geliang's email address
> - a3bcc475f994: tg:msg: update Geliang's email address
> - 699e0dbd591c: tg:msg: update Geliang's email address
> - 2d5b66a3675f: tg:msg: update Geliang's email address
> - 1df821d94ac8: tg:msg: update Geliang's email address
> - 7a0adfdb70d0: tg:msg: update Geliang's email address
> - cce49572147a: tg:msg: update Geliang's email address
> - fff8347933fd: tg:msg: update Geliang's email address
> - 6118caa31040: tg:msg: update Geliang's email address
> - 6603ca35adf6: tg:msg: remove my SoB
> - Results: c23ad453d8cc..f0f388aa6196 (export)
> 
> Cheers,
> Matt
Re: [PATCH mptcp-next v9 0/8] refactor mptcp bpf tests
Posted by Matthieu Baerts 1 week, 5 days ago
Hi Geliang,

On 20/04/2024 02:18, Geliang Tang wrote:
> Hi Matt,
> 
> On Fri, 2024-04-19 at 11:58 +0200, Matthieu Baerts wrote:
>> Hi Geliang, Mat,
>>
>> On 17/04/2024 04:38, Geliang Tang wrote:
>>> From: Geliang Tang <tanggeliang@kylinos.cn>
>>>
>>> v9:
>>>  - extract a new helper test_bpf_sched() from MPTCP_SCHED_TEST() to
>>> make
>>>    the macro simpler as Mat suggested. (thanks)
>>>  - squash MPTCP_SCHED_TEST() into "selftests/bpf: Add bpf_first
>>>    scheduler & test", not "selftests/bpf: Add bpf scheduler test"
>>> to
>>>    avoid a build error "test_bpf_sched is not used".
>> Thank you for the v9, and the review!
>>
>> @Geliang: there were a lot of Git (TopGit) manipulations here, please
>> check that the result is the expected one.
> 
> Thank you for applying these patches. I know there must be many
> conflicts inside. Thank you for updating my email address too. All
> patches merged well and all tests passed.

Thank you for having checked!

>>
>>
>> New patch for t/upstream:
>>
>> - d0432b7d2bb0: selftests/bpf: Add RUN_MPTCP_TEST macro
> 
> Please insert this commit "selftests/bpf: Add RUN_MPTCP_TEST macro"
> before "mptcp: add sched_data helpers" so that it can be upstreamed
> in advance with "setsockopt per subflow: BPF" series being reviewed,
> without waiting for BPF scheduler APIs to be updated. WDYT?

I don't think we need to move it: there are no other patches modifying
the BPF selftests before that one. So we should be safe regarding conflicts.

We can indeed send it with "setsockopt per subflow: BPF" series. These
patches can be applied before "selftests/bpf: Add RUN_MPTCP_TEST macro",
in the "patches for net-next" section when they will be marked as ready.

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

Re: [PATCH mptcp-next v9 0/8] refactor mptcp bpf tests
Posted by Geliang Tang 1 week, 3 days ago
Hi Matt,

On Sat, 2024-04-20 at 11:12 +0200, Matthieu Baerts wrote:
> Hi Geliang,
> 
> On 20/04/2024 02:18, Geliang Tang wrote:
> > Hi Matt,
> > 
> > On Fri, 2024-04-19 at 11:58 +0200, Matthieu Baerts wrote:
> > > Hi Geliang, Mat,
> > > 
> > > On 17/04/2024 04:38, Geliang Tang wrote:
> > > > From: Geliang Tang <tanggeliang@kylinos.cn>
> > > > 
> > > > v9:
> > > >  - extract a new helper test_bpf_sched() from
> > > > MPTCP_SCHED_TEST() to
> > > > make
> > > >    the macro simpler as Mat suggested. (thanks)
> > > >  - squash MPTCP_SCHED_TEST() into "selftests/bpf: Add bpf_first
> > > >    scheduler & test", not "selftests/bpf: Add bpf scheduler
> > > > test"
> > > > to
> > > >    avoid a build error "test_bpf_sched is not used".
> > > Thank you for the v9, and the review!
> > > 
> > > @Geliang: there were a lot of Git (TopGit) manipulations here,
> > > please
> > > check that the result is the expected one.
> > 
> > Thank you for applying these patches. I know there must be many
> > conflicts inside. Thank you for updating my email address too. All
> > patches merged well and all tests passed.
> 
> Thank you for having checked!
> 
> > > 
> > > 
> > > New patch for t/upstream:
> > > 
> > > - d0432b7d2bb0: selftests/bpf: Add RUN_MPTCP_TEST macro
> > 
> > Please insert this commit "selftests/bpf: Add RUN_MPTCP_TEST macro"
> > before "mptcp: add sched_data helpers" so that it can be upstreamed
> > in advance with "setsockopt per subflow: BPF" series being
> > reviewed,
> > without waiting for BPF scheduler APIs to be updated. WDYT?
> 
> I don't think we need to move it: there are no other patches
> modifying
> the BPF selftests before that one. So we should be safe regarding
> conflicts.

Yes, I agree.

> 
> We can indeed send it with "setsockopt per subflow: BPF" series.
> These
> patches can be applied before "selftests/bpf: Add RUN_MPTCP_TEST
> macro",
> in the "patches for net-next" section when they will be marked as
> ready.

"setsockopt per subflow: BPF" series could be merged in this order:

1 selftests/bpf: Add mptcp subflow example
2 selftests/bpf: Add RUN_MPTCP_TEST macro
3 selftests/bpf: Add mptcp subflow subtest
4 selftests/bpf: Handle SIGINT when creating netns

Thanks,
-Geliang

> 
> Cheers,
> Matt
Re: [PATCH mptcp-next v9 0/8] refactor mptcp bpf tests
Posted by MPTCP CI 2 weeks, 1 day ago
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 (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/8715586777

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


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)