[PATCH mptcp-next v12 0/3] BPF round-robin scheduler

Geliang Tang posted 3 patches 1 week, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/cover.1651724418.git.geliang.tang@suse.com
Maintainers: Daniel Borkmann <daniel@iogearbox.net>, Alexei Starovoitov <ast@kernel.org>, KP Singh <kpsingh@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Yonghong Song <yhs@fb.com>, Shuah Khan <shuah@kernel.org>, Eric Dumazet <edumazet@google.com>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, Mat Martineau <mathew.j.martineau@linux.intel.com>, Andrii Nakryiko <andrii@kernel.org>, John Fastabend <john.fastabend@gmail.com>
include/net/mptcp.h                           |  2 +
net/mptcp/sched.c                             | 14 ++++++
.../testing/selftests/bpf/bpf_mptcp_helpers.h |  8 ++++
.../testing/selftests/bpf/prog_tests/mptcp.c  | 38 +++++++++++++++
.../selftests/bpf/progs/mptcp_bpf_rr.c        | 47 +++++++++++++++++++
5 files changed, 109 insertions(+)
create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c
[PATCH mptcp-next v12 0/3] BPF round-robin scheduler
Posted by Geliang Tang 1 week, 4 days ago
v12:
 - init ssk from data->contexts[0], instead of msk->first.
 - cycle through all the subflows, instead of the first two.

v11:
 - rename array to contexts.
 - drop number of subflows in mptcp_sched_data.
 - set unused array elements to NULL.
 - add MPTCP_SUBFLOWS_MAX check in mptcp_sched_data_init.

v10:
 - init subflows array in mptcp_sched_data_init.
 - for (int i = 0; i < data->subflows; i++) is not allowed in BPF, using
   this instead:
	for (int i = 0; i < MPTCP_SUBFLOWS_MAX && i < data->subflows; i++)
 - deponds on: "BPF packet scheduler" series v18.

v9:
 - add subflows array in mptcp_sched_data
 - deponds on: "BPF packet scheduler" series v17 +
               Squash to "mptcp: add struct mptcp_sched_ops v17".

v8:
 - use struct mptcp_sched_data.
 - deponds on: "BPF packet scheduler" series v14.

v7:
 - rename retrans to reinject.
 - drop last_snd setting.
 - deponds on: "BPF packet scheduler" series v13.

v6:
 - set call_me_again flag.
 - deponds on: "BPF packet scheduler" series v12.

v5:
 - update patch 2, use temporary storage instead.
 - update patch 3, use new helpers.
 - deponds on: "BPF packet scheduler" series v11.

v4:
 - add retrans argment for get_subflow()

v3:
 - add last_snd write access.
 - keep msk->last_snd setting in get_subflow().
 - deponds on: "BPF packet scheduler" series v10.

v2:
 - merge the squash-to patch.
 - implement bpf_mptcp_get_subflows helper, instead of
   bpf_mptcp_get_next_subflow.
 - deponds on: "BPF packet scheduler v9".

This patchset implements round-robin scheduler using BPF. Address to
some commends for the RFC version:

https://patchwork.kernel.org/project/mptcp/cover/cover.1631011068.git.geliangtang@xiaomi.com/

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

Geliang Tang (3):
  mptcp: add subflows array in sched data
  selftests: bpf: add bpf_rr scheduler
  selftests: bpf: add bpf_rr test

 include/net/mptcp.h                           |  2 +
 net/mptcp/sched.c                             | 14 ++++++
 .../testing/selftests/bpf/bpf_mptcp_helpers.h |  8 ++++
 .../testing/selftests/bpf/prog_tests/mptcp.c  | 38 +++++++++++++++
 .../selftests/bpf/progs/mptcp_bpf_rr.c        | 47 +++++++++++++++++++
 5 files changed, 109 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c

-- 
2.34.1


Re: [PATCH mptcp-next v12 0/3] BPF round-robin scheduler
Posted by Mat Martineau 1 week, 2 days ago
On Thu, 5 May 2022, Geliang Tang wrote:

> v12:
> - init ssk from data->contexts[0], instead of msk->first.
> - cycle through all the subflows, instead of the first two.
>

v12 looks ok for the export branch, but Andrii asked for us to use 
bpf_tcp_helpers.h instead of adding a new header file. Geliang, I think it 
would be easier to do a v13 with the header changes rather than apply v12 
and squash header changes.

- Mat

> v11:
> - rename array to contexts.
> - drop number of subflows in mptcp_sched_data.
> - set unused array elements to NULL.
> - add MPTCP_SUBFLOWS_MAX check in mptcp_sched_data_init.
>
> v10:
> - init subflows array in mptcp_sched_data_init.
> - for (int i = 0; i < data->subflows; i++) is not allowed in BPF, using
>   this instead:
> 	for (int i = 0; i < MPTCP_SUBFLOWS_MAX && i < data->subflows; i++)
> - deponds on: "BPF packet scheduler" series v18.
>
> v9:
> - add subflows array in mptcp_sched_data
> - deponds on: "BPF packet scheduler" series v17 +
>               Squash to "mptcp: add struct mptcp_sched_ops v17".
>
> v8:
> - use struct mptcp_sched_data.
> - deponds on: "BPF packet scheduler" series v14.
>
> v7:
> - rename retrans to reinject.
> - drop last_snd setting.
> - deponds on: "BPF packet scheduler" series v13.
>
> v6:
> - set call_me_again flag.
> - deponds on: "BPF packet scheduler" series v12.
>
> v5:
> - update patch 2, use temporary storage instead.
> - update patch 3, use new helpers.
> - deponds on: "BPF packet scheduler" series v11.
>
> v4:
> - add retrans argment for get_subflow()
>
> v3:
> - add last_snd write access.
> - keep msk->last_snd setting in get_subflow().
> - deponds on: "BPF packet scheduler" series v10.
>
> v2:
> - merge the squash-to patch.
> - implement bpf_mptcp_get_subflows helper, instead of
>   bpf_mptcp_get_next_subflow.
> - deponds on: "BPF packet scheduler v9".
>
> This patchset implements round-robin scheduler using BPF. Address to
> some commends for the RFC version:
>
> https://patchwork.kernel.org/project/mptcp/cover/cover.1631011068.git.geliangtang@xiaomi.com/
>
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/75
>
> Geliang Tang (3):
>  mptcp: add subflows array in sched data
>  selftests: bpf: add bpf_rr scheduler
>  selftests: bpf: add bpf_rr test
>
> include/net/mptcp.h                           |  2 +
> net/mptcp/sched.c                             | 14 ++++++
> .../testing/selftests/bpf/bpf_mptcp_helpers.h |  8 ++++
> .../testing/selftests/bpf/prog_tests/mptcp.c  | 38 +++++++++++++++
> .../selftests/bpf/progs/mptcp_bpf_rr.c        | 47 +++++++++++++++++++
> 5 files changed, 109 insertions(+)
> create mode 100644 tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c
>
> -- 
> 2.34.1
>
>
>

--
Mat Martineau
Intel

Re: [PATCH mptcp-next v12 0/3] BPF round-robin scheduler
Posted by Matthieu Baerts 1 week, 2 days ago
Hi Mat, Geliang,

7 May 2022 02:06:25 Mat Martineau <mathew.j.martineau@linux.intel.com>:

> On Thu, 5 May 2022, Geliang Tang wrote:
>
>> v12:
>> - init ssk from data->contexts[0], instead of msk->first.
>> - cycle through all the subflows, instead of the first two.
>>
>
> v12 looks ok for the export branch, but Andrii asked for us to use bpf_tcp_helpers.h instead of adding a new header file. Geliang, I think it would be easier to do a v13 with the header changes rather than apply v12 and squash header changes.

I think Andrii is not opposed to have a dedicated MPTCP helper file because from what I understood, he only asked why we created a new file, no?

For me it makes sense to have this dedicated file. The main reason is related to the maintenance: to have us being cc'd for all patches modifying this file. Would it not be easier with a dedicated file?

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

Re: [PATCH mptcp-next v12 0/3] BPF round-robin scheduler
Posted by Geliang Tang 1 week, 2 days ago
Matthieu Baerts <matthieu.baerts@tessares.net> 于2022年5月7日周六 13:34写道:
>
> Hi Mat, Geliang,
>
> 7 May 2022 02:06:25 Mat Martineau <mathew.j.martineau@linux.intel.com>:
>
> > On Thu, 5 May 2022, Geliang Tang wrote:
> >
> >> v12:
> >> - init ssk from data->contexts[0], instead of msk->first.
> >> - cycle through all the subflows, instead of the first two.
> >>
> >
> > v12 looks ok for the export branch, but Andrii asked for us to use bpf_tcp_helpers.h instead of adding a new header file. Geliang, I think it would be easier to do a v13 with the header changes rather than apply v12 and squash header changes.
>
> I think Andrii is not opposed to have a dedicated MPTCP helper file because from what I understood, he only asked why we created a new file, no?
>
> For me it makes sense to have this dedicated file. The main reason is related to the maintenance: to have us being cc'd for all patches modifying this file. Would it not be easier with a dedicated file?

Hi Matt, Mat,

I just sent out 5 squash-to patches to address to Andrii's other
comments except this bpf_tcp_helpers.h one.

Thanks,
-Geliang

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