From: gang.yan@linux.dev
To: "Abdul Wasey" <w453y.me@gmail.com>, mptcp@lists.linux.dev
Cc: "Matthieu Baerts" <matttbe@kernel.org>,
"Mat Martineau" <martineau@kernel.org>,
"Geliang Tang" <geliang@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Mohit P. Tahiliani" <tahiliani@nitk.edu.in>,
stable@vger.kernel.org
Subject: Re: [PATCH mptcp-net v9 1/2] mptcp: pm: in-kernel: fullmesh: skip closed subflows
Date: Thu, 26 Nov 2026 15:01:19 +0000 [thread overview]
Message-ID: <0f1d9633b78cdacd57f4c235a5a787426083d788@linux.dev> (raw)
In-Reply-To: <20261126101818.3916631-2-w453y.me@gmail.com>
Hi Abdul,
>
> diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
> index d465524902f0..af3b092e45ba 100644
> --- a/net/mptcp/pm_kernel.c
> +++ b/net/mptcp/pm_kernel.c
> @@ -199,6 +199,16 @@ fill_remote_addr(struct mptcp_sock *msk, struct mptcp_addr_info *local,
> return 1;
> }
>
> +/* Closed subflows can stay in the conn_list, e.g. the initial one: their
> + * addresses and IDs are not reliable, possibly even reset.
> + */
What about dropping this comment here?
mptcp_subflow_is_closed() is a generic predicate — "is this subflow
closed?" — while "closed subflows can stay in the conn_list with
unreliable IDs" is a concern of the two loops calling it. And the commit message
already spells out the rationale.
> +static bool mptcp_subflow_is_closed(struct mptcp_subflow_context *subflow)
> +{
> + struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
> +
> + return subflow->closing || inet_sk_state_load(ssk) == TCP_CLOSE;
> +}
> +
> static unsigned int
> fill_remote_addresses_fullmesh(struct mptcp_sock *msk,
> struct mptcp_addr_info *local,
> @@ -216,11 +226,18 @@ fill_remote_addresses_fullmesh(struct mptcp_sock *msk,
> * already created by incoming ADD_ADDR
> */
> bitmap_zero(unavail_id, MPTCP_PM_MAX_ADDR_ID + 1);
> - mptcp_for_each_subflow(msk, subflow)
> + mptcp_for_each_subflow(msk, subflow) {
> + if (mptcp_subflow_is_closed(subflow))
> + continue;
> +
> if (READ_ONCE(subflow->local_id) == local->id)
> __set_bit(subflow->remote_id, unavail_id);
> + }
>
> mptcp_for_each_subflow(msk, subflow) {
> + if (mptcp_subflow_is_closed(subflow))
> + continue;
> +
> ssk = mptcp_subflow_tcp_sock(subflow);
> mptcp_remote_address((struct sock_common *)ssk, &addrs[i]);
> addrs[i].id = READ_ONCE(subflow->remote_id);
> @@ -243,6 +260,20 @@ fill_remote_addresses_fullmesh(struct mptcp_sock *msk,
> break;
> }
>
> + /* The initial subflow can be closed: like fill_remote_addr(), use the
> + * remote address of the MPTCP socket for the remote ID 0.
> + */
Another question, why don't you just use 'full_remote_addr' here, like:
'''
if (!test_bit(0, unavail_id) && i < addrs_size &&
msk->pm.extra_subflows < limit_extra_subflows)
i += fill_remote_addr(msk, local, &addrs[i]);
'''
It hasn't been tested, just wondering if there is a specific reason to keep
the duplication here, as I would rather reuse the existing code.
Thanks
Gang
> + if (!deny_id0 && !test_bit(0, unavail_id) && i < addrs_size &&
> + msk->pm.extra_subflows < limit_extra_subflows) {
> + struct mptcp_addr_info remote = { 0 };
> +
> + mptcp_remote_address((struct sock_common *)sk, &remote);
> + if (mptcp_pm_addr_families_match(sk, local, &remote)) {
> + addrs[i++] = remote;
> + msk->pm.extra_subflows++;
> + }
> + }
> +
> return i;
> }
>
> --
> 2.43.0
>
next prev parent reply other threads:[~2026-11-26 15:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-26 10:18 [PATCH mptcp-net v9 0/2] mptcp: pm: in-kernel: fullmesh: re-add of the initial subflow endp Abdul Wasey
2026-11-26 10:18 ` [PATCH mptcp-net v9 1/2] mptcp: pm: in-kernel: fullmesh: skip closed subflows Abdul Wasey
2026-11-26 15:01 ` gang.yan [this message]
2026-11-26 15:09 ` Matthieu Baerts
2026-11-26 15:29 ` Abdul Wasey
2026-11-26 10:18 ` [PATCH mptcp-net v9 2/2] selftests: mptcp: join: re-add the initial subflow endp with fullmesh Abdul Wasey
2026-11-26 12:43 ` [PATCH mptcp-net v9 0/2] mptcp: pm: in-kernel: fullmesh: re-add of the initial subflow endp 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=0f1d9633b78cdacd57f4c235a5a787426083d788@linux.dev \
--to=gang.yan@linux.dev \
--cc=geliang@kernel.org \
--cc=martineau@kernel.org \
--cc=matttbe@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tahiliani@nitk.edu.in \
--cc=w453y.me@gmail.com \
/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.