MPTCP Linux Development
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang.tang@suse.com>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next v15 3/7] Squash to "mptcp: add mptcpi_subflows_total counter"
Date: Thu, 12 Oct 2023 16:36:38 +0200	[thread overview]
Message-ID: <5598412e-d08b-4fb7-8fef-893815e70405@kernel.org> (raw)
In-Reply-To: <6e9e20ed1350ac793b682042ae32be6808c1a1e4.1697100600.git.geliang.tang@suse.com>

Hi Geliang,

Thank you for the new version!

On 12/10/2023 10:52, Geliang Tang wrote:
> When the socket shuts down, it's state is TCPF_FIN_WAIT2. Add this into

Good point, but is it not first TCP_FIN_WAIT1? (then FIN_WAIT2, etc.)

> __mptcp_has_initial_subflow.
> 
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
> ---
>  net/mptcp/protocol.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 6508179e94a6..ccb97b747527 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -1081,7 +1081,8 @@ static inline bool __mptcp_has_initial_subflow(const struct mptcp_sock *msk)
>  {
>  	struct sock *ssk = READ_ONCE(msk->first);
>  
> -	return ssk && inet_sk_state_load(ssk) != TCP_CLOSE;
> +	return ssk &&
> +	       !((1 << inet_sk_state_load(ssk)) & (TCPF_FIN_WAIT2 | TCPF_CLOSE));

I see that we decrement "msk->pm.subflows" when we start closing the
subflow. To be coherent with this counter -- and also because there are
more "close/closing" state, should we not have:

   inet_sk_state_load(ssk) != TCP_ESTABLISHED;

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

  reply	other threads:[~2023-10-12 14:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12  8:51 [PATCH mptcp-next v15 0/7] userspace pm remove id 0 subflow & address Geliang Tang
2023-10-12  8:51 ` [PATCH mptcp-next v15 1/7] selftests: mptcp: join: no RST when rm subflow/addr Geliang Tang
2023-10-12 14:36   ` Matthieu Baerts
2023-10-12  8:52 ` [PATCH mptcp-next v15 2/7] mptcp: add __mptcp_subflow_disconnect helper Geliang Tang
2023-10-12  8:52 ` [PATCH mptcp-next v15 3/7] Squash to "mptcp: add mptcpi_subflows_total counter" Geliang Tang
2023-10-12 14:36   ` Matthieu Baerts [this message]
2023-10-12  8:52 ` [PATCH mptcp-next v15 4/7] selftests: mptcp: userspace pm remove initial subflow Geliang Tang
2023-10-12 14:35   ` Matthieu Baerts
2023-10-12  8:52 ` [PATCH mptcp-next v15 5/7] mptcp: userspace pm send RM_ADDR for ID 0 Geliang Tang
2023-10-12  8:52 ` [PATCH mptcp-next v15 6/7] mptcp: userspace pm rename remove_err to out Geliang Tang
2023-10-12  8:52 ` [PATCH mptcp-next v15 7/7] selftests: mptcp: userspace pm send RM_ADDR for ID 0 Geliang Tang
2023-10-12 10:09   ` selftests: mptcp: userspace pm send RM_ADDR for ID 0: Tests Results 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=5598412e-d08b-4fb7-8fef-893815e70405@kernel.org \
    --to=matttbe@kernel.org \
    --cc=geliang.tang@suse.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox