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 v1 4/6] mptcp: pm: in-kernel: drop is_userspace in remove_id_zero
Date: Thu, 27 Feb 2025 13:10:50 +0100 [thread overview]
Message-ID: <ddb71ab4-145f-429c-9cc0-aba2e8c04c91@kernel.org> (raw)
In-Reply-To: <d9e2fc66a1207673f07510b7b34f08edd9828220.1740638334.git.tanggeliang@kylinos.cn>
Hi Geliang,
On 27/02/2025 07:43, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> There're duplicate operations in mptcp_nl_remove_subflow_and_signal_addr()
> and mptcp_nl_remove_id_zero_address(), both of which traverse all mptcp
> sockets in the net namespace. This patch drops the traversal operation in
> the latter and reuse the traversal loop of the former to do the removal of
> id zero address.
I'm hesitating here. It "feels" wrong to deal with an endpoint having 0
for the ID in the in-kernel manager code. Currently, the code is
separated from the beginning, and even if there is bit of duplication,
it looks clearer to deal with this special case.
(Also, I don't really see a use-case to delete only the first subflows
of all connections, but that's a different topic).
> An additional benefit is that the check for mptcp_pm_is_userspace() in
> mptcp_nl_remove_id_zero_address() is dropped, which reduces the path
> manager's reliance on mptcp_pm_is_userspace() and mptcp_pm_is_kernel()
> helpers.
I think these checks here make sense: we are iterating over all
connections, but we just need the ones handled by the in-kernel PM.
When the pm->ops will be there, can you not simply replace all these
checks under a mptcp_token_iter_next() by something like:
if (&msk->pm.ops != &mptcp_pm_netlink)
continue;
or:
if (mptcp_pm_ops(msk) != mptcp_pm_netlink)
or with a macro for the iterator:
mptcp_pm_for_each_msk(net, &s_slot, &s_num, &mptcp_pm_netlink) {
WDYT?
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2025-02-27 12:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-27 6:43 [PATCH mptcp-next v1 0/6] BPF path manager, part 5 Geliang Tang
2025-02-27 6:43 ` [PATCH mptcp-next v1 1/6] mptcp: pm: use pm variable instead of msk->pm Geliang Tang
2025-02-27 6:43 ` [PATCH mptcp-next v1 2/6] mptcp: pm: userspace: drop is_userspace in free_local_addr_list Geliang Tang
2025-02-27 11:44 ` Matthieu Baerts
2025-02-27 6:43 ` [PATCH mptcp-next v1 3/6] mptcp: pm: drop is_kernel in alloc_anno_list Geliang Tang
2025-02-27 6:43 ` [PATCH mptcp-next v1 4/6] mptcp: pm: in-kernel: drop is_userspace in remove_id_zero Geliang Tang
2025-02-27 12:10 ` Matthieu Baerts [this message]
2025-02-27 6:43 ` [PATCH mptcp-next v1 5/6] mptcp: pm: add remote parameter for set_flags Geliang Tang
2025-02-27 12:26 ` Matthieu Baerts
2025-02-27 6:43 ` [PATCH mptcp-next v1 6/6] mptcp: pm: in-kernel: drop changed parameter of set_flags Geliang Tang
2025-02-27 12:30 ` Matthieu Baerts
2025-02-28 7:56 ` kernel test robot
2025-02-27 7:04 ` [PATCH mptcp-next v1 0/6] BPF path manager, part 5 MPTCP CI
2025-02-27 7:48 ` 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=ddb71ab4-145f-429c-9cc0-aba2e8c04c91@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.