From: Geliang Tang <geliang.tang@suse.com>
To: Matthieu Baerts <matthieu.baerts@tessares.net>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v8 1/8] mptcp: add NO_INITIAL_SUBFLOW flag
Date: Thu, 14 Sep 2023 20:43:01 +0800 [thread overview]
Message-ID: <20230914124301.GA3508@bogon> (raw)
In-Reply-To: <93643f82-21ff-4a54-9c1b-3d5be689793c@tessares.net>
Hi Matt,
On Thu, Sep 14, 2023 at 12:19:01PM +0200, Matthieu Baerts wrote:
> Hi Geliang,
>
> On 14/09/2023 12:03, Geliang Tang wrote:
> > If the initial subflow has been removed, we cannot know without checking
> > other counters, e.g. ss -ti <filter> | grep -c tcp-ulp-mptcp or
> > getsockopt(SOL_MPTCP, MPTCP_FULL_INFO, ...) (or others except MPTCP_INFO
> > of course) and then check mptcp_subflow_data->num_subflows to get the
> > total amount of subflows.
> >
> > This patch adds a new flag NO_INITIAL_SUBFLOW in mptcpi_flags to know if
> > the initial subflow has been removed. With this bit, we can then compute
> > the total amount of subflows from mptcp_info by doing something like:
> >
> > if (mptcpi_flags & MPTCP_INFO_FLAG_HAS_INITIAL_SUBFLOW)
> > mptcpi_subflows += 1;
>
> Thank you for looking at that!
>
> (...)
>
> > diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> > index 8260202c0066..aebf692543a5 100644
> > --- a/net/mptcp/sockopt.c
> > +++ b/net/mptcp/sockopt.c
> > @@ -919,6 +919,8 @@ void mptcp_diag_fill_info(struct mptcp_sock *msk, struct mptcp_info *info)
> > flags |= MPTCP_INFO_FLAG_FALLBACK;
> > if (READ_ONCE(msk->can_ack))
> > flags |= MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED;
> > + if (__mptcp_check_no_initial_subflow(msk))
> > + flags |= MPTCP_INFO_FLAG_NO_INITIAL_SUBFLOW;
>
> I had a very brief look but can we not just check if msk->first == NULL
> instead?
msk->first is not NULL in this case.
When closing the initial subflow in __mptcp_close_ssk(), dispose_it is
false, it goes to:
if (!dispose_it) {
/* The MPTCP code never wait on the subflow sockets, TCP-level
* disconnect should never fail
*/
WARN_ON_ONCE(tcp_disconnect(ssk, 0));
mptcp_subflow_ctx_reset(subflow);
release_sock(ssk);
goto out;
}
... ...
if (ssk == msk->first)
WRITE_ONCE(msk->first, NULL);
out:
if (need_push)
__mptcp_push_pending(sk, 0);
"WRITE_ONCE(msk->first, NULL)" is skipped in this case.
Thanks,
-Geliang
>
> Cheers,
> Matt
> --
> Tessares | Belgium | Hybrid Access Solutions
> www.tessares.net
next prev parent reply other threads:[~2023-09-14 12:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-14 10:03 [PATCH mptcp-next v8 0/8] userspace pm remove id 0 subflow & address Geliang Tang
2023-09-14 10:03 ` [PATCH mptcp-next v8 1/8] mptcp: add NO_INITIAL_SUBFLOW flag Geliang Tang
2023-09-14 10:19 ` Matthieu Baerts
2023-09-14 12:43 ` Geliang Tang [this message]
2023-09-14 12:55 ` Matthieu Baerts
2023-09-14 10:03 ` [PATCH mptcp-next v8 2/8] selftests: mptcp: add evts_get_info helper Geliang Tang
2023-09-14 10:03 ` [PATCH mptcp-next v8 3/8] selftests: mptcp: update userspace pm test helpers Geliang Tang
2023-09-14 10:03 ` [PATCH mptcp-next v8 4/8] selftests: mptcp: userspace pm remove id 0 subflow Geliang Tang
2023-09-14 10:03 ` [PATCH mptcp-next v8 5/8] mptcp: userspace pm allow creating " Geliang Tang
2023-09-14 10:03 ` [PATCH mptcp-next v8 6/8] selftests: mptcp: userspace pm create " Geliang Tang
2023-09-14 10:03 ` [PATCH mptcp-next v8 7/8] mptcp: userspace pm remove id 0 address Geliang Tang
2023-09-14 10:03 ` [PATCH mptcp-next v8 8/8] selftests: " Geliang Tang
2023-09-14 10:03 ` [PATCH mptcp-next] ss: mptcp: print no_initial_subflow flag Geliang Tang
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=20230914124301.GA3508@bogon \
--to=geliang.tang@suse.com \
--cc=matthieu.baerts@tessares.net \
--cc=mptcp@lists.linux.dev \
/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.