From: Geliang Tang <geliang@kernel.org>
To: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
mptcp@lists.linux.dev, Mat Martineau <martineau@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Shuah Khan <shuah@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next 2/8] mptcp: sched: split validation part
Date: Fri, 11 Apr 2025 09:57:39 -0400 [thread overview]
Message-ID: <1fb5a9e97e97b86c8b0d6008eee579a0bebea708.camel@kernel.org> (raw)
In-Reply-To: <20250411-net-next-mptcp-sched-mib-sft-misc-v1-2-85ac8c6654c3@kernel.org>
Hi Matt,
On Fri, 2025-04-11 at 13:04 +0200, Matthieu Baerts (NGI0) wrote:
> From: Geliang Tang <geliang@kernel.org>
Please update my email as "Geliang Tang <tanggeliang@kylinos.cn>" here
and in patch 7, otherwise, CI will complain that the email address
after "From: " is different from that after "Signed-off-by: ".
Thanks,
-Geliang
>
> A new interface .validate has been added in struct bpf_struct_ops
> recently. This patch prepares a future struct_ops support by
> implementing 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>
> Reviewed-by: Mat Martineau <martineau@kernel.org>
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> ---
> 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
> d409586b5977f93bff14fffd83b1d3020d57353b..7aa38d74fef6b5f00d97a114d74
> b711014d0a52d 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -744,6 +744,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
> f09f7eb1d63f86b9899c72b5c2fd36c8445898a8..1e59072d478c9b52c7f7b60431b
> 589f6ca3abe65 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_validate_scheduler(struct mptcp_sched_ops *sched)
> +{
> + 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)
> {
> - if (!sched->get_send)
> - return -EINVAL;
> + int ret;
> +
> + ret = mptcp_validate_scheduler(sched);
> + if (ret)
> + return ret;
>
> spin_lock(&mptcp_sched_list_lock);
> if (mptcp_sched_find(sched->name)) {
>
next prev parent reply other threads:[~2025-04-11 14:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-11 11:04 [PATCH net-next 0/8] mptcp: various small and unrelated improvements Matthieu Baerts (NGI0)
2025-04-11 11:04 ` [PATCH net-next 1/8] mptcp: sched: remove mptcp_sched_data Matthieu Baerts (NGI0)
2025-04-11 11:04 ` [PATCH net-next 2/8] mptcp: sched: split validation part Matthieu Baerts (NGI0)
2025-04-11 13:57 ` Geliang Tang [this message]
2025-04-11 14:14 ` Matthieu Baerts
2025-04-11 11:04 ` [PATCH net-next 3/8] mptcp: pm: Return local variable instead of freed pointer Matthieu Baerts (NGI0)
2025-04-11 11:04 ` [PATCH net-next 4/8] mptcp: pass right struct to subflow_hmac_valid Matthieu Baerts (NGI0)
2025-04-11 11:04 ` [PATCH net-next 5/8] mptcp: add MPJoinRejected MIB counter Matthieu Baerts (NGI0)
2025-04-11 11:04 ` [PATCH net-next 6/8] selftests: mptcp: validate MPJoinRejected counter Matthieu Baerts (NGI0)
2025-04-11 11:04 ` [PATCH net-next 7/8] selftests: mptcp: diag: drop nlh parameter of recv_nlmsg Matthieu Baerts (NGI0)
2025-04-11 11:04 ` [PATCH net-next 8/8] selftests: mptcp: use IPPROTO_MPTCP for getaddrinfo Matthieu Baerts (NGI0)
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=1fb5a9e97e97b86c8b0d6008eee579a0bebea708.camel@kernel.org \
--to=geliang@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/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.