From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>,
Mat Martineau <martineau@kernel.org>
Subject: Re: [PATCH mptcp-next v2 05/11] mptcp: add mptcp_subflow_sched bpf_iter
Date: Sat, 8 Mar 2025 12:00:44 +0100 [thread overview]
Message-ID: <edca2df3-f80f-4e68-bf7f-9f042bd80f7c@kernel.org> (raw)
In-Reply-To: <e13f64bb99b08d8d64b9398e4684cd46f3c9de91.1741347233.git.tanggeliang@kylinos.cn>
Hi Geliang,
On 07/03/2025 12:36, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> Add a new bpt_iter mptcp_subflow_sched, it's a wrapper of mptcp_subflow.
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> net/mptcp/bpf.c | 28 ++++++++++++++++++++++++++++
> 1 file changed, 28 insertions(+)
>
> diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c
> index 3921261b4fd4..c31f7b407b84 100644
> --- a/net/mptcp/bpf.c
> +++ b/net/mptcp/bpf.c
> @@ -288,6 +288,31 @@ bpf_iter_mptcp_subflow_destroy(struct bpf_iter_mptcp_subflow *it)
> {
> }
>
> +struct bpf_iter_mptcp_subflow_sched {
> + struct bpf_iter_mptcp_subflow it;
> +};
> +
> +__bpf_kfunc static int
> +bpf_iter_mptcp_subflow_sched_new(struct bpf_iter_mptcp_subflow_sched *it,
> + struct sock *sk, struct mptcp_sched_data *data)
> +{
> + if (!mptcp_sched_check_bpf_iter_task(data))
> + return -EINVAL;
> +
> + return bpf_iter_mptcp_subflow_new(&it->it, sk);
We would need the same thing for the BPF PM I suppose, no?
Then, why not having something more generic, either:
- add "struct task_struct *" in the msk structure
- or pass a "const struct task_struct *bpf_iter_task" instead of
something sched specific?
For the first idea, I guess it should work because the helper will be
called when the msk lock will be owned by the caller. So we should not
have the PM and scheduler setting it at the same time from different
context, right?
Also, if this helper receives a msk in argument, no need to check that
it is a valid MPTCP socket, etc., right?
If one of these two ideas is used, no need to re-introduce
mptcp_sched_data. The API is not settled yet, so no need to worry about
that. It is even a good time to change it.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2025-03-08 11:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 11:36 [PATCH mptcp-next v2 00/11] add bpf_iter_task Geliang Tang
2025-03-07 11:36 ` [PATCH mptcp-next v2 01/11] Revert "mptcp: sched: remove mptcp_sched_data" Geliang Tang
2025-03-07 11:36 ` [PATCH mptcp-next v2 02/11] Squash to "bpf: Add bpf_mptcp_sched_ops" Geliang Tang
2025-03-07 11:36 ` [PATCH mptcp-next v2 03/11] mptcp: add bpf_iter_task for mptcp_sched_data Geliang Tang
2025-03-08 10:49 ` Matthieu Baerts
2025-03-07 11:36 ` [PATCH mptcp-next v2 04/11] mptcp: set and clear bpf_iter_task Geliang Tang
2025-03-07 11:36 ` [PATCH mptcp-next v2 05/11] mptcp: add mptcp_subflow_sched bpf_iter Geliang Tang
2025-03-08 11:00 ` Matthieu Baerts [this message]
2025-03-07 11:36 ` [PATCH mptcp-next v2 06/11] Squash to "selftests/bpf: Add bpf_first scheduler & test" Geliang Tang
2025-03-07 11:36 ` [PATCH mptcp-next v2 07/11] Squash to "selftests/bpf: Add bpf_bkup " Geliang Tang
2025-03-07 11:36 ` [PATCH mptcp-next v2 08/11] Squash to "selftests/bpf: Add bpf_rr " Geliang Tang
2025-03-07 11:36 ` [PATCH mptcp-next v2 09/11] Squash to "selftests/bpf: Add bpf_red " Geliang Tang
2025-03-07 11:36 ` [PATCH mptcp-next v2 10/11] Squash to "selftests/bpf: Add bpf_burst " Geliang Tang
2025-03-07 11:36 ` [PATCH mptcp-next v2 11/11] mptcp: drop subflow contexts in mptcp_sched_data Geliang Tang
2025-03-07 11:49 ` [PATCH mptcp-next v2 00/11] add bpf_iter_task MPTCP CI
2025-03-07 12:33 ` MPTCP CI
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=edca2df3-f80f-4e68-bf7f-9f042bd80f7c@kernel.org \
--to=matttbe@kernel.org \
--cc=geliang@kernel.org \
--cc=martineau@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.