All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Florian Westphal <fw@strlen.de>, mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp 02/10] mptcp: tag sequence_seq with socket state
Date: Tue, 13 Apr 2021 16:58:06 +0200	[thread overview]
Message-ID: <20210413145806.GD14932@breakpoint.cc> (raw)
In-Reply-To: <ab943483882219110f0bcb79efd1629b9512102b.camel@redhat.com>

Paolo Abeni <pabeni@redhat.com> wrote:
> > +	list_for_each_entry(subflow, &msk->join_list, node) {
> > +		u32 sseq = READ_ONCE(subflow->setsockopt_seq);
> >  
> > +		mptcp_propagate_sndbuf((struct sock *)msk, mptcp_subflow_tcp_sock(subflow));
> > +		if (READ_ONCE(msk->setsockopt_seq) != sseq)
> > +			ret = true;
> 
> I'm a bit lost WRT 'ret' scope. I don't see where it's initialized.
> Does the compiler emit a warning here?

Did not see one, but it looks broken.

> Perhaps moving the 'ret' variable definition to this patch will makes
> the things clearer?!?

Done.

> > -	if (!test_and_set_bit(MPTCP_WORK_SYNC_SETSOCKOPT, &msk->flags))
> > +	if (msk->setsockopt_seq &&
> > +	    !test_and_set_bit(MPTCP_WORK_SYNC_SETSOCKOPT, &msk->flags))
> >  		mptcp_schedule_work((struct sock *)msk);
> 
> It's not obvious to me why the 'msk->setsockopt_seq' check is needed
> here (and in the below chunk) ???
> 
> Perhaps a comment would help?

Perhaps:
+static bool setsockopt_was_called(const struct mptcp_sock *msk)
+{
+       return msk->setsockopt_seq > 0;
+}
+

if (setsockopt_was_called(msk) && ..

?

  reply	other threads:[~2021-04-13 14:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 18:49 [PATCH mptcp 00/10] mptcp: add SOL_SOCKET support Florian Westphal
2021-04-08 18:49 ` [PATCH mptcp 01/10] mptcp: add skeleton to sync msk socket options to subflows Florian Westphal
2021-04-08 18:49 ` [PATCH mptcp 02/10] mptcp: tag sequence_seq with socket state Florian Westphal
2021-04-10  0:12   ` Mat Martineau
2021-04-12  8:05     ` Florian Westphal
2021-04-13  9:58   ` Paolo Abeni
2021-04-13 14:58     ` Florian Westphal [this message]
2021-04-08 18:49 ` [PATCH mptcp 03/10] mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY Florian Westphal
2021-04-13 10:10   ` Paolo Abeni
2021-04-08 18:49 ` [PATCH mptcp 04/10] mptcp: setsockopt: handle receive/send buffer and device bind Florian Westphal
2021-04-08 18:49 ` [PATCH mptcp 05/10] mptcp: setsockopt: support SO_LINGER Florian Westphal
2021-04-08 18:49 ` [PATCH mptcp 06/10] mptcp: setsockopt: add SO_MARK support Florian Westphal
2021-04-08 18:49 ` [PATCH mptcp 07/10] mptcp: setsockopt: add SO_INCOMING_CPU Florian Westphal
2021-04-08 18:49 ` [PATCH mptcp 08/10] mptcp: setsockopt: SO_DEBUG and no-op options Florian Westphal
2021-04-08 18:49 ` [PATCH mptcp 09/10] mptcp: sockopt: add TCP_CONGESTION and TCP_INFO Florian Westphal
2021-04-08 18:49 ` [PATCH mptcp 10/10] selftests: mptcp: add packet mark test case Florian Westphal

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=20210413145806.GD14932@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=mptcp@lists.linux.dev \
    --cc=pabeni@redhat.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.