[PATCH mptcp-next v25 0/5] BPF redundant scheduler, part 2

Geliang Tang posted 5 patches 1 year, 4 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/cover.1671107241.git.geliang.tang@suse.com
Maintainers: Mat Martineau <mathew.j.martineau@linux.intel.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, "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>
net/mptcp/protocol.c                          | 187 +++++++++++-------
net/mptcp/protocol.h                          |   4 +
net/mptcp/sched.c                             |  69 +++++++
.../testing/selftests/bpf/prog_tests/mptcp.c  |  34 ++++
.../selftests/bpf/progs/mptcp_bpf_red.c       |  45 +++++
5 files changed, 264 insertions(+), 75 deletions(-)
create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_red.c
[PATCH mptcp-next v25 0/5] BPF redundant scheduler, part 2
Posted by Geliang Tang 1 year, 4 months ago
v25:
- update calls to mptcp_subflow_set_scheduled(subflow, false) in
  __mptcp_subflow_push_pending().
- rebased on "tag: export/20221215T054923"

v24:
- rename push to keep_pushing
- check the scheduled bit on ssk first
- drop delegate flag 
- depends on "mptcp: use msk_owned_by_me helper"

v23:
- patch 2 and 3: clear subflow->scheduled flag on the error paths.

v22:
- update patch 2 as Mat suggested.
- patch 4 and 5 in v21 will send later.

v21:
- address Mat's comments in v20.
- redundant sends on retransmit code path.

v20:
- rebased on "Squash to "mptcp: refactor push_pending logic" v19"

v19:
- patch 1, use 'continue' instead of 'goto again'.

v18:
 - some cleanups
 - update commit logs.

v17:
 - address to Mat's comments in v16
 - rebase to export/20221108T055508.

v16:
- keep last_snd and snd_burst in struct mptcp_sock.
- drop "mptcp: register default scheduler".
- drop "mptcp: add scheduler wrappers", move it into "mptcp: use
get_send wrapper" and "mptcp: use get_retrans wrapper".
- depends on 'v2, Revert "mptcp: add get_subflow wrappers" - fix
divide error in mptcp_subflow_get_send'

v15:
 1: "refactor push pending" v10
 2-11: "register default scheduler" v3
  - move last_snd and snd_burst into struct mptcp_sched_ops
 12-19: "BPF redundant scheduler" v15
  - split "use get_send wrapper" into two patches
 - rebase to export/20221021T061837.

v14:
- add "mptcp: refactor push_pending logic" v10 as patch 1
- drop update_first_pending in patch 4
- drop update_already_sent in patch 5

v13:
- deponds on "refactor push pending" v9.
- Simply 'goto out' after invoking mptcp_subflow_delegate in patch 1.
- All selftests (mptcp_connect.sh, mptcp_join.sh and simult_flows.sh) passed.

v12:
 - fix WARN_ON_ONCE(reuse_skb) and WARN_ON_ONCE(!msk->recovery) errors
   in kernel logs.

v11:
 - address to Mat's comments in v10.
 - rebase to export/20220908T063452

v10:
 - send multiple dfrags in __mptcp_push_pending().

v9:
 - drop the extra *err paramenter of mptcp_sched_get_send() as Florian
   suggested.

v8:
 - update __mptcp_push_pending(), send the same data on each subflow.
 - update __mptcp_retrans, track the max sent data.
 = add a new patch.

v7:
 - drop redundant flag in v6
 - drop __mptcp_subflows_push_pending in v6
 - update redundant subflows support in __mptcp_push_pending
 - update redundant subflows support in __mptcp_retrans

v6:
 - Add redundant flag for struct mptcp_sched_ops.
 - add a dedicated function __mptcp_subflows_push_pending() to deal with
   redundat subflows push pending.

v5:
 - address to Paolo's comment, keep the optimization to
mptcp_subflow_get_send() for the non eBPF case.
 - merge mptcp_sched_get_send() and __mptcp_sched_get_send() in v4 into one.
 - depends on "cleanups for bpf sched selftests".

v4:
 - small cleanups in patch 1, 2.
 - add TODO in patch 3.
 - rebase patch 5 on 'cleanups for bpf sched selftests'.

v3:
 - use new API.
 - fix the link failure tests issue mentioned in ("https://patchwork.kernel.org/project/mptcp/cover/cover.1653033459.git.geliang.tang@suse.com/").

v2:
 - add MPTCP_SUBFLOWS_MAX limit to avoid infinite loops when the
   scheduler always sets call_again to true.
 - track the largest copied amount.
 - deal with __mptcp_subflow_push_pending() and the retransmit loop.
 - depends on "BPF round-robin scheduler" v14.

v1:

Implements the redundant BPF MPTCP scheduler, which sends all packets
redundantly on all available subflows.

Geliang Tang (5):
  mptcp: add scheduler wrappers
  mptcp: use get_send wrapper
  mptcp: use get_retrans wrapper
  selftests/bpf: Add bpf_red scheduler
  selftests/bpf: Add bpf_red test

 net/mptcp/protocol.c                          | 187 +++++++++++-------
 net/mptcp/protocol.h                          |   4 +
 net/mptcp/sched.c                             |  69 +++++++
 .../testing/selftests/bpf/prog_tests/mptcp.c  |  34 ++++
 .../selftests/bpf/progs/mptcp_bpf_red.c       |  45 +++++
 5 files changed, 264 insertions(+), 75 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_red.c

-- 
2.35.3
Re: [PATCH mptcp-next v25 0/5] BPF redundant scheduler, part 2
Posted by Matthieu Baerts 1 year, 4 months ago
Hi Geliang, Mat,

On 15/12/2022 13:32, Geliang Tang wrote:
> Implements the redundant BPF MPTCP scheduler, which sends all packets
> redundantly on all available subflows.

Thank you for the hard work with the patches and the reviews!

I just applied them in our tree in 2 different places as requested by
Geliang. I also integrated the Squash-to patch sent by Geliang and added
Mat's RvB tag.

New patches for t/upstream:
- 324b3cbe75ae: mptcp: add scheduler wrappers
- 2e6f3e6c3604: mptcp: use get_send wrapper
- 52f8f6af934c: mptcp: use get_retrans wrapper
- Results: 6c58a377c113..4254b6598308 (export)

- 61c95bbb18c7: selftests/bpf: Add bpf_red scheduler
- 46cf70243ce8: selftests/bpf: Add bpf_red test
- Results: 4254b6598308..224f92634d88 (export)

Tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20221221T140648

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
Re: [PATCH mptcp-next v25 0/5] BPF redundant scheduler, part 2
Posted by Mat Martineau 1 year, 4 months ago
On Thu, 15 Dec 2022, Geliang Tang wrote:

> v25:
> - update calls to mptcp_subflow_set_scheduled(subflow, false) in
>  __mptcp_subflow_push_pending().
> - rebased on "tag: export/20221215T054923"
>

Thanks for all the work on this Geliang. I think it's ok to add this to 
the export branch for further testing, and any fixes/updates can be 
squashed if needed.

I do have feedback on one line to delete in patch 2 (see that reply). Not 
sure if Matthieu needs a squash-to patch for that or can update when 
applying.

Should this be applied after the bpf_rr patches, or earlier in the 
"features other trees" section of the export branch?

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>


- Mat

> v24:
> - rename push to keep_pushing
> - check the scheduled bit on ssk first
> - drop delegate flag
> - depends on "mptcp: use msk_owned_by_me helper"
>
> v23:
> - patch 2 and 3: clear subflow->scheduled flag on the error paths.
>
> v22:
> - update patch 2 as Mat suggested.
> - patch 4 and 5 in v21 will send later.
>
> v21:
> - address Mat's comments in v20.
> - redundant sends on retransmit code path.
>
> v20:
> - rebased on "Squash to "mptcp: refactor push_pending logic" v19"
>
> v19:
> - patch 1, use 'continue' instead of 'goto again'.
>
> v18:
> - some cleanups
> - update commit logs.
>
> v17:
> - address to Mat's comments in v16
> - rebase to export/20221108T055508.
>
> v16:
> - keep last_snd and snd_burst in struct mptcp_sock.
> - drop "mptcp: register default scheduler".
> - drop "mptcp: add scheduler wrappers", move it into "mptcp: use
> get_send wrapper" and "mptcp: use get_retrans wrapper".
> - depends on 'v2, Revert "mptcp: add get_subflow wrappers" - fix
> divide error in mptcp_subflow_get_send'
>
> v15:
> 1: "refactor push pending" v10
> 2-11: "register default scheduler" v3
>  - move last_snd and snd_burst into struct mptcp_sched_ops
> 12-19: "BPF redundant scheduler" v15
>  - split "use get_send wrapper" into two patches
> - rebase to export/20221021T061837.
>
> v14:
> - add "mptcp: refactor push_pending logic" v10 as patch 1
> - drop update_first_pending in patch 4
> - drop update_already_sent in patch 5
>
> v13:
> - deponds on "refactor push pending" v9.
> - Simply 'goto out' after invoking mptcp_subflow_delegate in patch 1.
> - All selftests (mptcp_connect.sh, mptcp_join.sh and simult_flows.sh) passed.
>
> v12:
> - fix WARN_ON_ONCE(reuse_skb) and WARN_ON_ONCE(!msk->recovery) errors
>   in kernel logs.
>
> v11:
> - address to Mat's comments in v10.
> - rebase to export/20220908T063452
>
> v10:
> - send multiple dfrags in __mptcp_push_pending().
>
> v9:
> - drop the extra *err paramenter of mptcp_sched_get_send() as Florian
>   suggested.
>
> v8:
> - update __mptcp_push_pending(), send the same data on each subflow.
> - update __mptcp_retrans, track the max sent data.
> = add a new patch.
>
> v7:
> - drop redundant flag in v6
> - drop __mptcp_subflows_push_pending in v6
> - update redundant subflows support in __mptcp_push_pending
> - update redundant subflows support in __mptcp_retrans
>
> v6:
> - Add redundant flag for struct mptcp_sched_ops.
> - add a dedicated function __mptcp_subflows_push_pending() to deal with
>   redundat subflows push pending.
>
> v5:
> - address to Paolo's comment, keep the optimization to
> mptcp_subflow_get_send() for the non eBPF case.
> - merge mptcp_sched_get_send() and __mptcp_sched_get_send() in v4 into one.
> - depends on "cleanups for bpf sched selftests".
>
> v4:
> - small cleanups in patch 1, 2.
> - add TODO in patch 3.
> - rebase patch 5 on 'cleanups for bpf sched selftests'.
>
> v3:
> - use new API.
> - fix the link failure tests issue mentioned in ("https://patchwork.kernel.org/project/mptcp/cover/cover.1653033459.git.geliang.tang@suse.com/").
>
> v2:
> - add MPTCP_SUBFLOWS_MAX limit to avoid infinite loops when the
>   scheduler always sets call_again to true.
> - track the largest copied amount.
> - deal with __mptcp_subflow_push_pending() and the retransmit loop.
> - depends on "BPF round-robin scheduler" v14.
>
> v1:
>
> Implements the redundant BPF MPTCP scheduler, which sends all packets
> redundantly on all available subflows.
>
> Geliang Tang (5):
>  mptcp: add scheduler wrappers
>  mptcp: use get_send wrapper
>  mptcp: use get_retrans wrapper
>  selftests/bpf: Add bpf_red scheduler
>  selftests/bpf: Add bpf_red test
>
> net/mptcp/protocol.c                          | 187 +++++++++++-------
> net/mptcp/protocol.h                          |   4 +
> net/mptcp/sched.c                             |  69 +++++++
> .../testing/selftests/bpf/prog_tests/mptcp.c  |  34 ++++
> .../selftests/bpf/progs/mptcp_bpf_red.c       |  45 +++++
> 5 files changed, 264 insertions(+), 75 deletions(-)
> create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_red.c
>
> -- 
> 2.35.3
>
>
>

--
Mat Martineau
Intel
Re: [PATCH mptcp-next v25 0/5] BPF redundant scheduler, part 2
Posted by Geliang Tang 1 year, 4 months ago
Hi Mat, Matt,

On Mon, Dec 19, 2022 at 05:39:59PM -0800, Mat Martineau wrote:
> On Thu, 15 Dec 2022, Geliang Tang wrote:
> 
> > v25:
> > - update calls to mptcp_subflow_set_scheduled(subflow, false) in
> >  __mptcp_subflow_push_pending().
> > - rebased on "tag: export/20221215T054923"
> > 
> 
> Thanks for all the work on this Geliang. I think it's ok to add this to the
> export branch for further testing, and any fixes/updates can be squashed if
> needed.
> 
> I do have feedback on one line to delete in patch 2 (see that reply). Not
> sure if Matthieu needs a squash-to patch for that or can update when
> applying.

I just sent a squash-to patch to delete this line in ML.

> 
> Should this be applied after the bpf_rr patches, or earlier in the "features
> other trees" section of the export branch?

The first three patches should be inserted between the commits "mptcp: add
sched_data_set_contexts helper" and "bpf: Add bpf_mptcp_sched_ops". The
last two should be applied after the commit "selftests/bpf: Add bpf_rr
test".

> 
> Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
> 
> 
> - Mat
> 
> > Geliang Tang (5):
> >  mptcp: add scheduler wrappers
> >  mptcp: use get_send wrapper
> >  mptcp: use get_retrans wrapper

In addition, the commit logs of these two patches need to be updated
too since sock_owned_by_me() are now replaced by msk_owned_by_me().

The first one:

 Move sock_owned_by_me() check and fallback check into get_send() wrapper
 from mptcp_subflow_get_send().
->
 Move owned_by_me() and fallback checks into get_send() wrapper from
 mptcp_subflow_get_send().

The second:

 Move sock_owned_by_me() check and fallback check into get_retrans()
 wrapper from mptcp_subflow_get_retrans().
->
 Move owned_by_me() and fallback checks into get_retrans() wrapper from
 mptcp_subflow_get_retrans().

Thanks,
-Geliang

> >  selftests/bpf: Add bpf_red scheduler
> >  selftests/bpf: Add bpf_red test
> > 
> > net/mptcp/protocol.c                          | 187 +++++++++++-------
> > net/mptcp/protocol.h                          |   4 +
> > net/mptcp/sched.c                             |  69 +++++++
> > .../testing/selftests/bpf/prog_tests/mptcp.c  |  34 ++++
> > .../selftests/bpf/progs/mptcp_bpf_red.c       |  45 +++++
> > 5 files changed, 264 insertions(+), 75 deletions(-)
> > create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_red.c
> > 
> > -- 
> > 2.35.3
> > 
> > 
> > 
> 
> --
> Mat Martineau
> Intel