All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mat Martineau <martineau@kernel.org>
To: Geliang Tang <geliang@kernel.org>
Cc: mptcp@lists.linux.dev, Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v1 1/8] mptcp: add mptcp_validate_scheduler helper
Date: Mon, 17 Mar 2025 18:09:15 -0700 (PDT)	[thread overview]
Message-ID: <757da9a0-9243-1df8-36ca-828410836768@kernel.org> (raw)
In-Reply-To: <01f14f2e6c9ba32887af1d52e29753dd6b85e544.1741226722.git.tanggeliang@kylinos.cn>

On Thu, 6 Mar 2025, Geliang Tang wrote:

> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> New interface .validate is added in struct bpf_struct_ops recently, this
> patch implements it as a new helper mptcp_validate_scheduler() for struct
> mptcp_sched_ops.
>
> In this helper, check whether the required ops "get_subflow" of struct
> mptcp_sched_ops has been implemented.
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>

This patch LGTM:

Reviewed-by: Mat Martineau <martineau@kernel.org>

The rest of the series looks ok to squash, with one note on patch 3.


- Mat

> ---
> net/mptcp/protocol.h |  1 +
> net/mptcp/sched.c    | 17 +++++++++++++++--
> 2 files changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 3492b256ecba..77b4ec0b0dd8 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -740,6 +740,7 @@ void mptcp_info2sockaddr(const struct mptcp_addr_info *info,
> 			 struct sockaddr_storage *addr,
> 			 unsigned short family);
> struct mptcp_sched_ops *mptcp_sched_find(const char *name);
> +int mptcp_validate_scheduler(struct mptcp_sched_ops *sched);
> int mptcp_register_scheduler(struct mptcp_sched_ops *sched);
> void mptcp_unregister_scheduler(struct mptcp_sched_ops *sched);
> void mptcp_sched_init(void);
> diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c
> index f09f7eb1d63f..1e59072d478c 100644
> --- a/net/mptcp/sched.c
> +++ b/net/mptcp/sched.c
> @@ -82,10 +82,23 @@ void mptcp_get_available_schedulers(char *buf, size_t maxlen)
> 	rcu_read_unlock();
> }
>
> -int mptcp_register_scheduler(struct mptcp_sched_ops *sched)
> +int mptcp_validate_scheduler(struct mptcp_sched_ops *sched)
> {
> -	if (!sched->get_send)
> +	if (!sched->get_send) {
> +		pr_err("%s does not implement required ops\n", sched->name);
> 		return -EINVAL;
> +	}
> +
> +	return 0;
> +}
> +
> +int mptcp_register_scheduler(struct mptcp_sched_ops *sched)
> +{
> +	int ret;
> +
> +	ret = mptcp_validate_scheduler(sched);
> +	if (ret)
> +		return ret;
>
> 	spin_lock(&mptcp_sched_list_lock);
> 	if (mptcp_sched_find(sched->name)) {
> -- 
> 2.43.0
>
>
>

  reply	other threads:[~2025-03-18  1:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06  2:15 [PATCH mptcp-next v1 0/8] cleanups for bpf schedulers Geliang Tang
2025-03-06  2:15 ` [PATCH mptcp-next v1 1/8] mptcp: add mptcp_validate_scheduler helper Geliang Tang
2025-03-18  1:09   ` Mat Martineau [this message]
2025-03-06  2:15 ` [PATCH mptcp-next v1 2/8] Squash to "bpf: Add bpf_mptcp_sched_ops" Geliang Tang
2025-03-06  2:15 ` [PATCH mptcp-next v1 3/8] Squash to "selftests/bpf: Add bpf scheduler test" Geliang Tang
2025-03-18  1:11   ` Mat Martineau
2025-03-20 19:38     ` Matthieu Baerts
2025-03-06  2:15 ` [PATCH mptcp-next v1 4/8] Squash to "selftests/bpf: Add bpf_first scheduler & test" Geliang Tang
2025-03-06  2:15 ` [PATCH mptcp-next v1 5/8] Squash to "selftests/bpf: Add bpf_bkup " Geliang Tang
2025-03-06  2:15 ` [PATCH mptcp-next v1 6/8] Squash to "selftests/bpf: Add bpf_rr " Geliang Tang
2025-03-06  2:15 ` [PATCH mptcp-next v1 7/8] Squash to "selftests/bpf: Add bpf_red " Geliang Tang
2025-03-06  2:15 ` [PATCH mptcp-next v1 8/8] Squash to "selftests/bpf: Add bpf_burst " Geliang Tang
2025-03-06  3:26 ` [PATCH mptcp-next v1 0/8] cleanups for bpf schedulers MPTCP CI
2025-03-20 17:31 ` 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=757da9a0-9243-1df8-36ca-828410836768@kernel.org \
    --to=martineau@kernel.org \
    --cc=geliang@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=tanggeliang@kylinos.cn \
    /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.