All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Geliang Tang <geliang.tang@suse.com>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v18 5/7] mptcp: add bpf_mptcp_sched_ops
Date: Mon, 02 May 2022 16:09:38 +0200	[thread overview]
Message-ID: <6d7ce54488bd5524f750c52cf2cfd7b0ff68eb40.camel@redhat.com> (raw)
In-Reply-To: <2ade81287c82a673c3e6f03d8700e8f77fcfc651.1651412613.git.geliang.tang@suse.com>

Hello,

On Sun, 2022-05-01 at 21:48 +0800, Geliang Tang wrote:
> This patch implements a new struct bpf_struct_ops, bpf_mptcp_sched_ops.
> Register and unregister the bpf scheduler in .reg and .unreg.
> 
> This MPTCP BPF scheduler implementation is similar to BPF TCP CC. And
> net/ipv4/bpf_tcp_ca.c is a frame of reference for this patch.
> 
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
>  kernel/bpf/bpf_struct_ops_types.h |   4 +
>  net/mptcp/bpf.c                   | 154 ++++++++++++++++++++++++++++++
>  2 files changed, 158 insertions(+)
> 
> diff --git a/kernel/bpf/bpf_struct_ops_types.h b/kernel/bpf/bpf_struct_ops_types.h
> index 5678a9ddf817..5a6b0c0d8d3d 100644
> --- a/kernel/bpf/bpf_struct_ops_types.h
> +++ b/kernel/bpf/bpf_struct_ops_types.h
> @@ -8,5 +8,9 @@ BPF_STRUCT_OPS_TYPE(bpf_dummy_ops)
>  #ifdef CONFIG_INET
>  #include <net/tcp.h>
>  BPF_STRUCT_OPS_TYPE(tcp_congestion_ops)
> +#ifdef CONFIG_MPTCP
> +#include <net/mptcp.h>
> +BPF_STRUCT_OPS_TYPE(mptcp_sched_ops)
> +#endif
>  #endif
>  #endif
> diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
> index 535602ba2582..ad770deb5a72 100644
> --- a/net/mptcp/bpf.c
> +++ b/net/mptcp/bpf.c
> @@ -10,8 +10,162 @@
>  #define pr_fmt(fmt) "MPTCP: " fmt
>  
>  #include <linux/bpf.h>
> +#include <linux/bpf_verifier.h>
> +#include <linux/btf.h>
> +#include <linux/btf_ids.h>
>  #include "protocol.h"
>  
> +#ifdef CONFIG_BPF_JIT
> +extern struct bpf_struct_ops bpf_mptcp_sched_ops;
> +extern struct btf *btf_vmlinux;
> +static const struct btf_type *mptcp_sched_type __read_mostly;
> +static u32 mptcp_sched_id;
> +
> +static u32 optional_ops[] = {
> +	offsetof(struct mptcp_sched_ops, init),
> +	offsetof(struct mptcp_sched_ops, release),
> +	offsetof(struct mptcp_sched_ops, get_subflow),

I think that the 'get_subflow' member should not be options. Otherwise
the scheduler will useless, right ?!?

Otherwise LGTM.

Thanks!

Paolo


  reply	other threads:[~2022-05-02 14:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-01 13:48 [PATCH mptcp-next v18 0/7] BPF packet scheduler Geliang Tang
2022-05-01 13:48 ` [PATCH mptcp-next v18 1/7] mptcp: add struct mptcp_sched_ops Geliang Tang
2022-05-01 13:48 ` [PATCH mptcp-next v18 2/7] mptcp: add a new sysctl scheduler Geliang Tang
2022-05-01 13:48 ` [PATCH mptcp-next v18 3/7] mptcp: add sched in mptcp_sock Geliang Tang
2022-05-01 13:48 ` [PATCH mptcp-next v18 4/7] mptcp: add get_subflow wrappers Geliang Tang
2022-05-01 13:48 ` [PATCH mptcp-next v18 5/7] mptcp: add bpf_mptcp_sched_ops Geliang Tang
2022-05-02 14:09   ` Paolo Abeni [this message]
2022-05-03  0:08     ` Mat Martineau
2022-05-01 13:48 ` [PATCH mptcp-next v18 6/7] selftests: bpf: add bpf_first scheduler Geliang Tang
2022-05-01 13:48 ` [PATCH mptcp-next v18 7/7] selftests: bpf: add bpf_first test Geliang Tang
2022-05-01 14:12   ` selftests: bpf: add bpf_first test: Build Failure MPTCP CI
2022-05-01 15:37   ` selftests: bpf: add bpf_first test: Tests Results MPTCP CI
2022-05-03 16:28 ` [PATCH mptcp-next v18 0/7] BPF packet scheduler Matthieu Baerts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6d7ce54488bd5524f750c52cf2cfd7b0ff68eb40.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=geliang.tang@suse.com \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.