[PATCH mptcp-next v11 00/11] BPF packet scheduler updates part 1

Geliang Tang posted 11 patches 10 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/cover.1687827857.git.geliang.tang@suse.com
Maintainers: Matthieu Baerts <matthieu.baerts@tessares.net>, Mat Martineau <martineau@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Andrii Nakryiko <andrii@kernel.org>, Mykola Lysenko <mykolal@fb.com>, Alexei Starovoitov <ast@kernel.org>, Daniel Borkmann <daniel@iogearbox.net>, Martin KaFai Lau <martin.lau@linux.dev>, Song Liu <song@kernel.org>, Yonghong Song <yhs@fb.com>, John Fastabend <john.fastabend@gmail.com>, KP Singh <kpsingh@kernel.org>, Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>, Jiri Olsa <jolsa@kernel.org>, Shuah Khan <shuah@kernel.org>
include/net/mptcp.h                           | 11 +++--
net/mptcp/bpf.c                               | 17 ++++++-
net/mptcp/protocol.c                          | 10 +---
net/mptcp/protocol.h                          |  4 +-
net/mptcp/sched.c                             | 46 ++++++++++++++++++-
tools/testing/selftests/bpf/bpf_tcp_helpers.h | 20 +++++---
.../selftests/bpf/progs/mptcp_bpf_bkup.c      | 21 +++++----
.../selftests/bpf/progs/mptcp_bpf_first.c     | 12 ++---
.../selftests/bpf/progs/mptcp_bpf_red.c       | 16 +++----
.../selftests/bpf/progs/mptcp_bpf_rr.c        | 44 ++++++++++++++----
10 files changed, 143 insertions(+), 58 deletions(-)
[PATCH mptcp-next v11 00/11] BPF packet scheduler updates part 1
Posted by Geliang Tang 10 months, 1 week ago
v11:
 - use sk_storage instead of mptcp_storage.
 - drop mptcp_storage.

v10:
 - add mptcp_storage map type.
 - update scheduler API.

v9:
 - merge 'Squash to "BPF packet scheduler updates v8"' and 'mptcp:
 make the contexts array of sched_data invisible in BPF'

v8:
 address Paolo's comments in v7:
 - add sched_data into mptcp_sock as new field, not an pointer.
 - drop rename __mptcp_set_timeout, export mptcp_set_timeout into BPF
   context instead.
 - add a comment in bpf_burst to explan why not use
   "ssk = send_info[SSK_MODE_ACTIVE].ssk;" directly.
 - move mptcp_subflow_tcp_sock into bpf_tcp_helpers.h.

v7:
 - drop more last_snd, only set it in bpf_rr.
 - 1-10: save sched_data at mptcp_sock, for issues #342
 - 11-16: add bpf_burst scheduler
 - 17-19: add bpf_stale scheduler, for issues #349

v6:
 - Only update patches 14, 15. Add a helper bpf_mptcp_subflow_ctx, fix
   bug in bpf_burst_get_retrans().

v5:
 - 1-9: save sched_data at mptcp_sock, for issues #342
 - 10-15: add bpf_burst scheduler
 - 16-18: add bpf_stale scheduler, for issues #349

v4:
 - drop "mptcp: add three helpers for bpf_burst", implement the helpers
   in the bpf context directly.

v3:
 - address Florian's comments in v2.
 - split into three more patches.

v2:
 - fix this error reported by CI:
KASAN: slab-use-after-free in __mptcp_close_ssk (net/mptcp/protocol.c:2461)
 - add bpf burst scheduler.

This patchset adds sched_data pointer into mptcp_sock to to save some
data at MPTCP and subflows levels.

With these changes, the old patch "mptcp: register default scheduler" in
[1] now works.

https://patchwork.kernel.org/project/mptcp/cover/cover.1665753926.git.geliang.tang@suse.com/ [1]
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/342
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/349

Geliang Tang (11):
  Squash to "mptcp: drop last_snd and MPTCP_RESET_SCHEDULER"
  Squash to "mptcp: add struct mptcp_sched_ops"
  Squash to "mptcp: add sched_data_set_contexts helper"
  mptcp: register default scheduler
  Squash to "bpf: Add bpf_mptcp_sched_ops"
  Squash to "bpf: Add bpf_mptcp_sched_kfunc_set"
  Squash to "selftests/bpf: Add mptcp sched structs"
  Squash to "selftests/bpf: Add bpf_first scheduler"
  Squash to "selftests/bpf: Add bpf_bkup scheduler"
  Squash to "selftests/bpf: Add bpf_rr scheduler"
  Squash to "selftests/bpf: Add bpf_red scheduler"

 include/net/mptcp.h                           | 11 +++--
 net/mptcp/bpf.c                               | 17 ++++++-
 net/mptcp/protocol.c                          | 10 +---
 net/mptcp/protocol.h                          |  4 +-
 net/mptcp/sched.c                             | 46 ++++++++++++++++++-
 tools/testing/selftests/bpf/bpf_tcp_helpers.h | 20 +++++---
 .../selftests/bpf/progs/mptcp_bpf_bkup.c      | 21 +++++----
 .../selftests/bpf/progs/mptcp_bpf_first.c     | 12 ++---
 .../selftests/bpf/progs/mptcp_bpf_red.c       | 16 +++----
 .../selftests/bpf/progs/mptcp_bpf_rr.c        | 44 ++++++++++++++----
 10 files changed, 143 insertions(+), 58 deletions(-)

-- 
2.35.3
Re: [PATCH mptcp-next v11 00/11] BPF packet scheduler updates part 1
Posted by Matthieu Baerts 10 months ago
Hi Geliang, Paolo,

On 27/06/2023 03:06, Geliang Tang wrote:
> v11:
>  - use sk_storage instead of mptcp_storage.
>  - drop mptcp_storage.

Thank you for the patches and the reviews!
> https://patchwork.kernel.org/project/mptcp/cover/cover.1665753926.git.geliang.tang@suse.com/ [1]
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/342
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/349

Does this first part still close these two tickets?

Now in our tree (feat. for other trees) + one extra patch and a squash
of a squash. Please don't hesitate to check if everything has been done
properly because there were quite a few manipulations to do :)

- 8efabdbcaa2c: "squashed" patch 1/11 (with conflicts) in "mptcp: drop
last_snd and MPTCP_RESET_SCHEDULER"
- b0f6d5c5ae25: "squashed" patch 1/11 (with conflicts) in "mptcp: use
get_send wrapper"
- 9de04aa46c59: "squashed" patch 1/11 in "mptcp: use get_retrans wrapper"
- Results: e77e1cb5a372..3fcf166a9c7e (export)

- 6e930aa67c6e: "squashed" patch 2/11 in "mptcp: add struct mptcp_sched_ops"
- Results: 3fcf166a9c7e..437c8b684629 (export)

- f7e28c2443da: "squashed" patch 3/11 (with conflicts) in "mptcp: add
sched_data_set_contexts helper"
- 9dc7c0042a01: conflict in t/mptcp-add-scheduler-wrappers
- Results: 437c8b684629..504bc1f2d42d (export)

- Applied patch 4/11 with Paolo's ACK just before "bpf: Add
bpf_mptcp_sched_ops"
- 7f44744d88c6: mptcp: register default scheduler
- Results: 504bc1f2d42d..d45b69d4109b (export)

- 0c323c5cc341: "squashed" patch 5/11 in "bpf: Add bpf_mptcp_sched_ops"
- Results: d45b69d4109b..1b64ad359430 (export)

- 9ffacd26fad5: "squashed" patch 6/11 in "bpf: Add
bpf_mptcp_sched_kfunc_set"
- Results: 1b64ad359430..f95ddf57fd7e (export)

- 8f050b24bd4d: "squashed" patch 7/11 in "selftests/bpf: Add mptcp sched
structs"
- Results: f95ddf57fd7e..b1bfdcd53258 (export)

- a3eacd00bfb7: "squashed" patch 8/11 in "selftests/bpf: Add bpf_first
scheduler"
- Results: b1bfdcd53258..b80981f0543b (export)

- bc7512c33473: "squashed" patch 9/11 in "selftests/bpf: Add bpf_bkup
scheduler"
- Results: b80981f0543b..e1dbf174936b (export)

- 506feec3a419: "squashed" patch 10/11 in "selftests/bpf: Add bpf_rr
scheduler"
- Results: e1dbf174936b..c6edb7e5168c (export)

- 151a85fd02ab: "squashed" patch 11/11 in "selftests/bpf: Add bpf_red
scheduler"
- Results: c6edb7e5168c..679a4538b06c (export)

- 064c5746a0d9: "squashed" patch 12/11 (squash squash) in
"selftests/bpf: Add bpf_rr scheduler"
- Results: 679a4538b06c..255b06daaf0d (export)

- cebedb75ff65: "squashed" patch 6/7 from BPF 'force to MPTCP' v4 series
in "selftests/bpf: add two mptcp netns helpers"
- Results: 255b06daaf0d..cde4fa6a0a5e (export)


Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20230705T090903

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Re: [PATCH mptcp-next v11 00/11] BPF packet scheduler updates part 1
Posted by Geliang Tang 9 months, 4 weeks ago
On Wed, Jul 05, 2023 at 11:11:24AM +0200, Matthieu Baerts wrote:
> Hi Geliang, Paolo,
> 
> On 27/06/2023 03:06, Geliang Tang wrote:
> > v11:
> >  - use sk_storage instead of mptcp_storage.
> >  - drop mptcp_storage.
> 
> Thank you for the patches and the reviews!
> > https://patchwork.kernel.org/project/mptcp/cover/cover.1665753926.git.geliang.tang@suse.com/ [1]
> > Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/342
> > Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/349
> 
> Does this first part still close these two tickets?

This first part can close the ticket #342 only. #349 will be closed by
part 2.

Thanks,
-Geliang

> 
> Now in our tree (feat. for other trees) + one extra patch and a squash
> of a squash. Please don't hesitate to check if everything has been done
> properly because there were quite a few manipulations to do :)
> 
> - 8efabdbcaa2c: "squashed" patch 1/11 (with conflicts) in "mptcp: drop
> last_snd and MPTCP_RESET_SCHEDULER"
> - b0f6d5c5ae25: "squashed" patch 1/11 (with conflicts) in "mptcp: use
> get_send wrapper"
> - 9de04aa46c59: "squashed" patch 1/11 in "mptcp: use get_retrans wrapper"
> - Results: e77e1cb5a372..3fcf166a9c7e (export)
> 
> - 6e930aa67c6e: "squashed" patch 2/11 in "mptcp: add struct mptcp_sched_ops"
> - Results: 3fcf166a9c7e..437c8b684629 (export)
> 
> - f7e28c2443da: "squashed" patch 3/11 (with conflicts) in "mptcp: add
> sched_data_set_contexts helper"
> - 9dc7c0042a01: conflict in t/mptcp-add-scheduler-wrappers
> - Results: 437c8b684629..504bc1f2d42d (export)
> 
> - Applied patch 4/11 with Paolo's ACK just before "bpf: Add
> bpf_mptcp_sched_ops"
> - 7f44744d88c6: mptcp: register default scheduler
> - Results: 504bc1f2d42d..d45b69d4109b (export)
> 
> - 0c323c5cc341: "squashed" patch 5/11 in "bpf: Add bpf_mptcp_sched_ops"
> - Results: d45b69d4109b..1b64ad359430 (export)
> 
> - 9ffacd26fad5: "squashed" patch 6/11 in "bpf: Add
> bpf_mptcp_sched_kfunc_set"
> - Results: 1b64ad359430..f95ddf57fd7e (export)
> 
> - 8f050b24bd4d: "squashed" patch 7/11 in "selftests/bpf: Add mptcp sched
> structs"
> - Results: f95ddf57fd7e..b1bfdcd53258 (export)
> 
> - a3eacd00bfb7: "squashed" patch 8/11 in "selftests/bpf: Add bpf_first
> scheduler"
> - Results: b1bfdcd53258..b80981f0543b (export)
> 
> - bc7512c33473: "squashed" patch 9/11 in "selftests/bpf: Add bpf_bkup
> scheduler"
> - Results: b80981f0543b..e1dbf174936b (export)
> 
> - 506feec3a419: "squashed" patch 10/11 in "selftests/bpf: Add bpf_rr
> scheduler"
> - Results: e1dbf174936b..c6edb7e5168c (export)
> 
> - 151a85fd02ab: "squashed" patch 11/11 in "selftests/bpf: Add bpf_red
> scheduler"
> - Results: c6edb7e5168c..679a4538b06c (export)
> 
> - 064c5746a0d9: "squashed" patch 12/11 (squash squash) in
> "selftests/bpf: Add bpf_rr scheduler"
> - Results: 679a4538b06c..255b06daaf0d (export)
> 
> - cebedb75ff65: "squashed" patch 6/7 from BPF 'force to MPTCP' v4 series
> in "selftests/bpf: add two mptcp netns helpers"
> - Results: 255b06daaf0d..cde4fa6a0a5e (export)
> 
> 
> Tests are now in progress:
> 
> https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20230705T090903
> 
> Cheers,
> Matt
> -- 
> Tessares | Belgium | Hybrid Access Solutions
> www.tessares.net
Re: [PATCH mptcp-next v11 00/11] BPF packet scheduler updates part 1
Posted by Mat Martineau 10 months ago
On Wed, 5 Jul 2023, Matthieu Baerts wrote:

> Hi Geliang, Paolo,
>
> On 27/06/2023 03:06, Geliang Tang wrote:
>> v11:
>>  - use sk_storage instead of mptcp_storage.
>>  - drop mptcp_storage.
>

sk_storage (and bpf_sk_storage_{get,delete}) are a very good solution for 
bpf scheduler data - thanks for finding that Geliang!

Glad that this is merged, appreciate the review by Paolo and Mattheiu 
applying the series.


- Mat

> Thank you for the patches and the reviews!
>> https://patchwork.kernel.org/project/mptcp/cover/cover.1665753926.git.geliang.tang@suse.com/ [1]
>> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/342
>> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/349
>
> Does this first part still close these two tickets?
>
> Now in our tree (feat. for other trees) + one extra patch and a squash
> of a squash. Please don't hesitate to check if everything has been done
> properly because there were quite a few manipulations to do :)
>
> - 8efabdbcaa2c: "squashed" patch 1/11 (with conflicts) in "mptcp: drop
> last_snd and MPTCP_RESET_SCHEDULER"
> - b0f6d5c5ae25: "squashed" patch 1/11 (with conflicts) in "mptcp: use
> get_send wrapper"
> - 9de04aa46c59: "squashed" patch 1/11 in "mptcp: use get_retrans wrapper"
> - Results: e77e1cb5a372..3fcf166a9c7e (export)
>
> - 6e930aa67c6e: "squashed" patch 2/11 in "mptcp: add struct mptcp_sched_ops"
> - Results: 3fcf166a9c7e..437c8b684629 (export)
>
> - f7e28c2443da: "squashed" patch 3/11 (with conflicts) in "mptcp: add
> sched_data_set_contexts helper"
> - 9dc7c0042a01: conflict in t/mptcp-add-scheduler-wrappers
> - Results: 437c8b684629..504bc1f2d42d (export)
>
> - Applied patch 4/11 with Paolo's ACK just before "bpf: Add
> bpf_mptcp_sched_ops"
> - 7f44744d88c6: mptcp: register default scheduler
> - Results: 504bc1f2d42d..d45b69d4109b (export)
>
> - 0c323c5cc341: "squashed" patch 5/11 in "bpf: Add bpf_mptcp_sched_ops"
> - Results: d45b69d4109b..1b64ad359430 (export)
>
> - 9ffacd26fad5: "squashed" patch 6/11 in "bpf: Add
> bpf_mptcp_sched_kfunc_set"
> - Results: 1b64ad359430..f95ddf57fd7e (export)
>
> - 8f050b24bd4d: "squashed" patch 7/11 in "selftests/bpf: Add mptcp sched
> structs"
> - Results: f95ddf57fd7e..b1bfdcd53258 (export)
>
> - a3eacd00bfb7: "squashed" patch 8/11 in "selftests/bpf: Add bpf_first
> scheduler"
> - Results: b1bfdcd53258..b80981f0543b (export)
>
> - bc7512c33473: "squashed" patch 9/11 in "selftests/bpf: Add bpf_bkup
> scheduler"
> - Results: b80981f0543b..e1dbf174936b (export)
>
> - 506feec3a419: "squashed" patch 10/11 in "selftests/bpf: Add bpf_rr
> scheduler"
> - Results: e1dbf174936b..c6edb7e5168c (export)
>
> - 151a85fd02ab: "squashed" patch 11/11 in "selftests/bpf: Add bpf_red
> scheduler"
> - Results: c6edb7e5168c..679a4538b06c (export)
>
> - 064c5746a0d9: "squashed" patch 12/11 (squash squash) in
> "selftests/bpf: Add bpf_rr scheduler"
> - Results: 679a4538b06c..255b06daaf0d (export)
>
> - cebedb75ff65: "squashed" patch 6/7 from BPF 'force to MPTCP' v4 series
> in "selftests/bpf: add two mptcp netns helpers"
> - Results: 255b06daaf0d..cde4fa6a0a5e (export)
>
>
> Tests are now in progress:
>
> https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20230705T090903
>
> Cheers,
> Matt
> -- 
> Tessares | Belgium | Hybrid Access Solutions
> www.tessares.net
>
>