All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Mat Martineau <mathew.j.martineau@linux.intel.com>
Cc: Florian Westphal <fw@strlen.de>, Paolo Abeni <pabeni@redhat.com>,
	mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp 02/10] mptcp: tag sequence_seq with socket state
Date: Mon, 12 Apr 2021 10:05:31 +0200	[thread overview]
Message-ID: <20210412080531.GA14932@breakpoint.cc> (raw)
In-Reply-To: <9f60e0e9-a44f-b659-14f6-f91161cf6569@linux.intel.com>

Mat Martineau <mathew.j.martineau@linux.intel.com> wrote:
> On Thu, 8 Apr 2021, Florian Westphal wrote:
> 
> > +	return sk->sk_state << 24u;
> 
> I think this works because sk->sk_state gets automatically promoted to an
> int, but maybe "(u32)sk->sk_state << 24" is the intent?

Yes, I can add an explicit cast.

> What I didn't realize at that time was that mptcp_sockopt_sync_all() might
> not be called for a very long time (or at all?) if there are no joins to
> trigger it. To really protect against overflow, mptcp_setsockopt() can call
> (or schedule) mptcp_sockopt_sync_all() if the non-sk_state bits of
> msk->setsockopt_seq exceed a threshold.

Next patch adds sockopt_seq_inc() which is supposed to guarantee that it
never wraps to 0.  I can change it so it will wrap in the 24bit sequence
space only, so it would cycle back to sk->sk_state << 24u.

  reply	other threads:[~2021-04-12  8:05 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 [this message]
2021-04-13  9:58   ` Paolo Abeni
2021-04-13 14:58     ` Florian Westphal
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=20210412080531.GA14932@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=mathew.j.martineau@linux.intel.com \
    --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.