[PATCH RESEND mptcp-next v5 0/8] BPF packet scheduler

Geliang Tang posted 8 patches 2 years ago
Failed in applying to current master (apply log)
There is a newer version of this series
Documentation/networking/mptcp-sysctl.rst     |   8 +
include/net/mptcp.h                           |  13 ++
kernel/bpf/bpf_struct_ops_types.h             |   4 +
net/mptcp/Makefile                            |   2 +-
net/mptcp/bpf.c                               | 102 ++++++++++++
net/mptcp/ctrl.c                              |  14 ++
net/mptcp/protocol.c                          |  13 +-
net/mptcp/protocol.h                          |  14 ++
net/mptcp/sched.c                             | 152 ++++++++++++++++++
tools/testing/selftests/bpf/bpf_tcp_helpers.h |  12 ++
.../testing/selftests/bpf/prog_tests/mptcp.c  |  42 +++++
tools/testing/selftests/bpf/progs/bpf_first.c |  30 ++++
12 files changed, 401 insertions(+), 5 deletions(-)
create mode 100644 net/mptcp/sched.c
create mode 100644 tools/testing/selftests/bpf/progs/bpf_first.c
[PATCH RESEND mptcp-next v5 0/8] BPF packet scheduler
Posted by Geliang Tang 2 years ago
RESEND:
 - rebased to export/20220324T054815.
 - depends on: "add skc_to_mptcp_sock" v12.

v5:
 - patch 1: define per-namespace sched_list (but only used init_net
   namespace. It is difficult to get 'net' in bpf_mptcp_sched_reg and
   bpf_mptcp_sched_unreg. I need some suggestions here.)
 - patch 2: skip mptcp_sched_default in mptcp_unregister_scheduler.
 - patch 8: add tests into mptcp.c, instead of bpf_tcp_ca.c.

v4:
 - set msk->sched to &mptcp_sched_default when the sched argument is NULL
in mptcp_init_sched().

v3:
 - add mptcp_release_sched helper in patch 4.
 - rename mptcp_set_sched to mptcp_init_sched in patch 4.
 - add mptcp_sched_first_release in patch 7.
 - do some cleanups.

v2:
 - split into more small patches.
 - change all parameters of mptcp_sched_ops from sk to msk:
       void (*init)(struct mptcp_sock *msk);
       void (*release)(struct mptcp_sock *msk);
       struct sock *   (*get_subflow)(struct mptcp_sock *msk);
 - add tests in bpf_tcp_ca.c, instead of adding a new one.

v1:
 - Addressed to the commends in the RFC version.

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

Geliang Tang (8):
  mptcp: add struct mptcp_sched_ops
  mptcp: register default scheduler
  mptcp: add a new sysctl scheduler
  mptcp: add sched in mptcp_sock
  mptcp: add get_subflow wrapper
  mptcp: add bpf_mptcp_sched_ops
  selftests: bpf: add bpf_first scheduler
  selftests: bpf: add bpf_first test

 Documentation/networking/mptcp-sysctl.rst     |   8 +
 include/net/mptcp.h                           |  13 ++
 kernel/bpf/bpf_struct_ops_types.h             |   4 +
 net/mptcp/Makefile                            |   2 +-
 net/mptcp/bpf.c                               | 102 ++++++++++++
 net/mptcp/ctrl.c                              |  14 ++
 net/mptcp/protocol.c                          |  13 +-
 net/mptcp/protocol.h                          |  14 ++
 net/mptcp/sched.c                             | 152 ++++++++++++++++++
 tools/testing/selftests/bpf/bpf_tcp_helpers.h |  12 ++
 .../testing/selftests/bpf/prog_tests/mptcp.c  |  42 +++++
 tools/testing/selftests/bpf/progs/bpf_first.c |  30 ++++
 12 files changed, 401 insertions(+), 5 deletions(-)
 create mode 100644 net/mptcp/sched.c
 create mode 100644 tools/testing/selftests/bpf/progs/bpf_first.c

-- 
2.34.1


Re: [PATCH RESEND mptcp-next v5 0/8] BPF packet scheduler
Posted by Mat Martineau 2 years ago
On Thu, 24 Mar 2022, Geliang Tang wrote:

> RESEND:
> - rebased to export/20220324T054815.
> - depends on: "add skc_to_mptcp_sock" v12.
>
> v5:
> - patch 1: define per-namespace sched_list (but only used init_net
>   namespace. It is difficult to get 'net' in bpf_mptcp_sched_reg and
>   bpf_mptcp_sched_unreg. I need some suggestions here.)
> - patch 2: skip mptcp_sched_default in mptcp_unregister_scheduler.
> - patch 8: add tests into mptcp.c, instead of bpf_tcp_ca.c.
>

I ran in to a build problem because CONFIG_BPF_SYSCALL was not set in my 
.config and net/mptcp/Kconfig did not capture any BPF dependencies.

I think it would be best to allow MPTCP use without BPF enabled, so a new 
CONFIG_MPTCP_BPF_SCHEDULER config option (with dependencies on MPTCP and 
BPF_SYSCALL) would be good.


--
Mat Martineau
Intel