From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v8 04/12] mptcp: sysctl: map path_manager to pm_type
Date: Wed, 5 Mar 2025 12:48:32 +0100 [thread overview]
Message-ID: <9614d184-bddf-41fb-866d-9357904c7070@kernel.org> (raw)
In-Reply-To: <c83ba5bf407386ae9160ce1e570a93d3eb74e3b1.1741088339.git.tanggeliang@kylinos.cn>
Hi Geliang,
On 04/03/2025 12:40, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> This patch maps the newly added path manager sysctl "path_manager"
> to the old one "pm_type".
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> net/mptcp/ctrl.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/net/mptcp/ctrl.c b/net/mptcp/ctrl.c
> index d425fcbd036a..a158a337cdb5 100644
> --- a/net/mptcp/ctrl.c
> +++ b/net/mptcp/ctrl.c
> @@ -200,6 +200,9 @@ static int mptcp_set_path_manager(char *path_manager, const char *name)
> static int proc_path_manager(const struct ctl_table *ctl, int write,
> void *buffer, size_t *lenp, loff_t *ppos)
> {
> + struct mptcp_pernet *pernet = container_of(ctl->data,
> + struct mptcp_pernet,
> + path_manager);
> char (*path_manager)[MPTCP_PM_NAME_MAX] = ctl->data;
> char val[MPTCP_PM_NAME_MAX];
> const struct ctl_table tbl = {
> @@ -211,8 +214,14 @@ static int proc_path_manager(const struct ctl_table *ctl, int write,
> strscpy(val, *path_manager, MPTCP_PM_NAME_MAX);
>
> ret = proc_dostring(&tbl, write, buffer, lenp, ppos);
> - if (write && ret == 0)
> + if (write && ret == 0) {
> + u8 pm_type = MPTCP_PM_TYPE_KERNEL;
> +
> + if (!strncmp(val, "userspace", MPTCP_PM_NAME_MAX))
(detail: please use '== 0', that feels more natural than "not strncmp")
> + pm_type = MPTCP_PM_TYPE_USERSPACE;
> + pernet->pm_type = pm_type;
Should we not already cope with the future BPF PMs?
if "kernel":
pm_type = MPTCP_PM_TYPE_KERNEL;
elif "userspace:
pm_type = MPTCP_PM_TYPE_USERSPACE;
else:
pm_type = __MPTCP_PM_TYPE_NR;
Please check that this doesn't cause issue to display "pm_type" to 2
here -- note that we should not change the current mptcp_pm_type_max:
the userspace **cannot** set "net.mptcp.pm_type=2".
In other words, please check that this is OK:
# sysctl net.mptcp.pm_type=2
sysctl: setting key "net.mptcp.pm_type": Invalid argument
# sysctl -q net.mptcp.path_manager = "$BPF_PM"
# sysctl -n net.mptcp.pm_type
2
> ret = mptcp_set_path_manager(*path_manager, val);
> + }
>
> return ret;
> }
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2025-03-05 11:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 11:40 [PATCH mptcp-next v8 00/12] BPF path manager, part 5 Geliang Tang
2025-03-04 11:40 ` [PATCH mptcp-next v8 01/12] mptcp: pm: define struct mptcp_pm_ops Geliang Tang
2025-03-05 11:42 ` Matthieu Baerts
2025-03-04 11:40 ` [PATCH mptcp-next v8 02/12] mptcp: sysctl: new sysctl to set path manager by name Geliang Tang
2025-03-04 11:40 ` [PATCH mptcp-next v8 03/12] mptcp: sysctl: map pm_type to path_manager Geliang Tang
2025-03-05 11:45 ` Matthieu Baerts
2025-03-04 11:40 ` [PATCH mptcp-next v8 04/12] mptcp: sysctl: map path_manager to pm_type Geliang Tang
2025-03-05 11:48 ` Matthieu Baerts [this message]
2025-03-04 11:40 ` [PATCH mptcp-next v8 05/12] mptcp: sysctl: add available_path_managers Geliang Tang
2025-03-04 11:40 ` [PATCH mptcp-next v8 06/12] mptcp: pm: in-kernel: register mptcp_pm_kernel Geliang Tang
2025-03-05 1:35 ` Geliang Tang
2025-03-05 9:11 ` Matthieu Baerts
2025-03-05 9:14 ` Geliang Tang
2025-03-05 9:22 ` Matthieu Baerts
2025-03-05 9:29 ` Geliang Tang
2025-03-05 11:51 ` Matthieu Baerts
2025-03-06 11:09 ` Geliang Tang
2025-03-06 11:27 ` Matthieu Baerts
2025-03-04 11:40 ` [PATCH mptcp-next v8 07/12] mptcp: pm: userspace: register mptcp_pm_userspace Geliang Tang
2025-03-05 11:53 ` Matthieu Baerts
2025-03-04 11:40 ` [PATCH mptcp-next v8 08/12] mptcp: pm: initialize and release mptcp_pm_ops Geliang Tang
2025-03-05 11:57 ` Matthieu Baerts
2025-03-04 11:40 ` [PATCH mptcp-next v8 09/12] mptcp: pm: add get_local_id() interface Geliang Tang
2025-03-04 11:40 ` [PATCH mptcp-next v8 10/12] mptcp: pm: add get_priority() interface Geliang Tang
2025-03-04 11:40 ` [PATCH mptcp-next v8 11/12] selftests: mptcp: add pm_type mapping tests Geliang Tang
2025-03-05 11:58 ` Matthieu Baerts
2025-03-04 11:40 ` [PATCH mptcp-next v8 12/12] selftests: mptcp: add path_manager sysctl test Geliang Tang
2025-03-05 11:59 ` Matthieu Baerts
2025-03-05 11:41 ` [PATCH mptcp-next v8 00/12] BPF path manager, part 5 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=9614d184-bddf-41fb-866d-9357904c7070@kernel.org \
--to=matttbe@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.