[PATCH mptcp-next v3 0/5] add bpf_stale scheduler

Geliang Tang posted 5 patches 11 months ago
Only 3 patches received!
tools/testing/selftests/bpf/bpf_tcp_helpers.h |   1 +
.../testing/selftests/bpf/prog_tests/mptcp.c  |  38 +++++
.../selftests/bpf/progs/mptcp_bpf_bkup.c      |   4 +-
.../selftests/bpf/progs/mptcp_bpf_burst.c     |   2 +
.../selftests/bpf/progs/mptcp_bpf_rr.c        |   2 +
.../selftests/bpf/progs/mptcp_bpf_stale.c     | 152 ++++++++++++++++++
6 files changed, 198 insertions(+), 1 deletion(-)
create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_stale.c
[PATCH mptcp-next v3 0/5] add bpf_stale scheduler
Posted by Geliang Tang 11 months ago
v3:
 - init sk_storage in .init, delete it in .release.
We invoke bpf_sk_storage_get() to get the sk_storage map many times. Only
the first call is the slow path (see bpf_local_storage_lookup in
kernel/bpf/bpf_local_storage.c), alloc the map and cache it. The
subsequent calls are all in fast path, the cache hits. So we should
first call bpf_sk_storage_get in .init, then call it many times in
.get_subflow.
 - if no subflow is scheduled, it should return '-1' to indicate an error.

v2:
 - store subflow ids instead of storing subflow pointers in sk_storage.

v1:
- This patchset adds the new bpf_stale scheduler. Use sk_storage to save
the stale map instead of using subflow->stale flag to manage it.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/349

Geliang Tang (5):
  Squash to "selftests/bpf: Add bpf_bkup scheduler"
  Squash to "selftests/bpf: Add bpf_rr scheduler"
  Squash to "selftests/bpf: Add bpf_burst scheduler"
  selftests/bpf: Add bpf_stale scheduler
  selftests/bpf: Add bpf_stale test

 tools/testing/selftests/bpf/bpf_tcp_helpers.h |   1 +
 .../testing/selftests/bpf/prog_tests/mptcp.c  |  38 +++++
 .../selftests/bpf/progs/mptcp_bpf_bkup.c      |   4 +-
 .../selftests/bpf/progs/mptcp_bpf_burst.c     |   2 +
 .../selftests/bpf/progs/mptcp_bpf_rr.c        |   2 +
 .../selftests/bpf/progs/mptcp_bpf_stale.c     | 152 ++++++++++++++++++
 6 files changed, 198 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_stale.c

-- 
2.35.3
Re: [PATCH mptcp-next v3 0/5] add bpf_stale scheduler
Posted by Mat Martineau 10 months, 3 weeks ago
On Fri, 18 Aug 2023, Geliang Tang wrote:

> v3:
> - init sk_storage in .init, delete it in .release.
> We invoke bpf_sk_storage_get() to get the sk_storage map many times. Only
> the first call is the slow path (see bpf_local_storage_lookup in
> kernel/bpf/bpf_local_storage.c), alloc the map and cache it. The
> subsequent calls are all in fast path, the cache hits. So we should
> first call bpf_sk_storage_get in .init, then call it many times in
> .get_subflow.
> - if no subflow is scheduled, it should return '-1' to indicate an error.

Thanks Geliang, patches 1-3 are ok to squash.

For 4-5, see my reply to patch 4.


- Mat


>
> v2:
> - store subflow ids instead of storing subflow pointers in sk_storage.
>
> v1:
> - This patchset adds the new bpf_stale scheduler. Use sk_storage to save
> the stale map instead of using subflow->stale flag to manage it.
>
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/349
>
> Geliang Tang (5):
>  Squash to "selftests/bpf: Add bpf_bkup scheduler"
>  Squash to "selftests/bpf: Add bpf_rr scheduler"
>  Squash to "selftests/bpf: Add bpf_burst scheduler"
>  selftests/bpf: Add bpf_stale scheduler
>  selftests/bpf: Add bpf_stale test
>
> tools/testing/selftests/bpf/bpf_tcp_helpers.h |   1 +
> .../testing/selftests/bpf/prog_tests/mptcp.c  |  38 +++++
> .../selftests/bpf/progs/mptcp_bpf_bkup.c      |   4 +-
> .../selftests/bpf/progs/mptcp_bpf_burst.c     |   2 +
> .../selftests/bpf/progs/mptcp_bpf_rr.c        |   2 +
> .../selftests/bpf/progs/mptcp_bpf_stale.c     | 152 ++++++++++++++++++
> 6 files changed, 198 insertions(+), 1 deletion(-)
> create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_stale.c
>
> -- 
> 2.35.3
>
>
>
Re: [PATCH mptcp-next v3 0/5] add bpf_stale scheduler
Posted by Matthieu Baerts 10 months, 2 weeks ago
Hi Geliang, Mat,

On 02/09/2023 01:00, Mat Martineau wrote:
> On Fri, 18 Aug 2023, Geliang Tang wrote:
> 
>> v3:
>> - init sk_storage in .init, delete it in .release.
>> We invoke bpf_sk_storage_get() to get the sk_storage map many times. Only
>> the first call is the slow path (see bpf_local_storage_lookup in
>> kernel/bpf/bpf_local_storage.c), alloc the map and cache it. The
>> subsequent calls are all in fast path, the cache hits. So we should
>> first call bpf_sk_storage_get in .init, then call it many times in
>> .get_subflow.
>> - if no subflow is scheduled, it should return '-1' to indicate an error.
> 
> Thanks Geliang, patches 1-3 are ok to squash.

Thank you for the patches and your patience!

Now in our tree:

New patches for t/upstream:
- b2afd09b16a1: "squashed" patch 1/5 in "selftests/bpf: Add bpf_bkup
scheduler"
- ff989d90d2ea: "squashed" patch 2/5 in "selftests/bpf: Add bpf_rr
scheduler"
- ff0afb0f9763: "squashed" patch 3/5 in "selftests/bpf: Add bpf_burst
scheduler"
- Results: 86fa15fc9c4f..07a689bb4cbf (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20230909T152638

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net