MPTCP Linux Development
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Florian Westphal <fw@strlen.de>
Cc: mptcp@lists.linux.dev, mptcp@lists.01.org
Subject: Re: [MPTCP] [RFC PATCH mptcp-next v2 1/8] mptcp: add skeleton to sync msk socket options to subflows
Date: Thu, 25 Mar 2021 10:51:06 +0100	[thread overview]
Message-ID: <2ee15b0397e7653f8d8cfd74d53398a6a5f0c19c.camel@redhat.com> (raw)
In-Reply-To: <20210324200148.GL22603@breakpoint.cc>

On Wed, 2021-03-24 at 21:01 +0100, Florian Westphal wrote:
> Paolo Abeni <pabeni@redhat.com> wrote:
> > On Wed, 2021-03-24 at 14:15 +0100, Florian Westphal wrote:
> > > Handle following cases:
> > > 1. setsockopt is called with multiple subflows.
> > >    Change might have to be mirrored to all of them.
> > >    This is done directly in process context/setsockopt call.
> > > 2. Outgoing subflow is created after one or several setsockopt()
> > >    calls have been made.  Old setsockopt changes should be
> > >    synced to the new socket.
> > > 3. Incoming subflow, after setsockopt call(s).
> > > 
> > > Cases 2 and 3 are handled right after the join list is spliced to the
> > > conn list.
> > > 
> > > Because splicing is sometimes done from non-preemptible context, the
> > > sync action can be deferred to the work queue.
> > > 
> > > Add sequence numbers to subflow context and mptcp socket so
> > > synchronization functions know which subflow is already updated
> > > and which are not.
> > > 
> > > seqno is re-set to 1 in mptcp_sockopt_sync_all(), at this point
> > > the list of subflows is up to date.
> > > 
> > > A setsockopt sequence count of 0 means that no setsockopt call
> > > was made so no synchronization is needed.
> > > 
> > > Signed-off-by: Florian Westphal <fw@strlen.de>
> > 
> > If I read correctly, each incoming subflow always get setsockopt_seq =
> > 0 at accept time, while outgoing subflow are always synced at creation
> > time.
> 
> Yes, outgoing are synced at creation time.
> 
> > It looks like we have 2 semantically different 'msk->setsockopt_seq'
> > values:
> > * 0 -> no sync required
> > * any value greater than 0 -> sync required for incoming subflows.
> > 
> > If so, setsockopt could always set msk->setsockopt_seq to 1 and no need
> > to reset after sync_all.
> 
> In the outgoing case, the subflow isn't linked to the conn_list yet.

My bad! I did not recall we use join_list even for outgoing subflows...
I'm wondering if we could move them directly in conn_list
inside __mptcp_subflow_connect()? I think it should not be problematic.

> It syncs current msk settings, but user could setsockopt() before
> the connect finishes, in that case another sync is needed after
> connection completes.  No idea how to handle this with single toggle
> bit.

Yep, with outgoing subflow in join_list the thing I suggested above is
not usable.

> > socket()
> > sesockopt()
> > listen()
> > // msks is accepted, msk->setsockopt_seq != 0
> > // mpj subflow is accepted, ssk->setsockopt_seq == 0, the mpj ssk
> > inherited from the listener socket the same sockoptions of the msk/mpc
> > subflow
> 
> I'm not sure all options have this 'inherited from listener' behaviour.

Why not? the subflow socket is cloned from the listener TCP subflow. 

If tcp_create_openreq_child() does not propagate some socket option,
then the expected behaviour is probably not propagating it.

WDYT?

Thanks!

Paolo





  reply	other threads:[~2021-03-25  9:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 13:15 [RFC PATCH mptcp-next v2 0/8] initial SOL_SOCKET support Florian Westphal
2021-03-24 13:15 ` [RFC PATCH mptcp-next v2 1/8] mptcp: add skeleton to sync msk socket options to subflows Florian Westphal
2021-03-24 17:38   ` [MPTCP] " Paolo Abeni
2021-03-24 20:01     ` Florian Westphal
2021-03-25  9:51       ` Paolo Abeni [this message]
2021-03-25 12:49         ` Florian Westphal
2021-03-25 13:12           ` Paolo Abeni
2021-03-25 14:06             ` Florian Westphal
2021-03-25 14:33               ` Paolo Abeni
2021-03-25 14:45                 ` Florian Westphal
2021-03-26  9:59                   ` Paolo Abeni
2021-03-24 13:15 ` [RFC PATCH mptcp-next v2 2/8] mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY Florian Westphal
2021-03-24 13:15 ` [RFC PATCH mptcp-next v2 3/8] mptcp: setsockopt: handle receive/send buffer and device bind Florian Westphal
2021-03-24 16:34   ` [MPTCP] " Paolo Abeni
2021-03-24 17:15     ` Florian Westphal
2021-03-24 13:15 ` [RFC PATCH mptcp-next v2 4/8] mptcp: setsockopt: support SO_LINGER Florian Westphal
2021-03-24 13:15 ` [RFC PATCH mptcp-next v2 5/8] mptcp: setsockopt: add SO_MARK support Florian Westphal
2021-03-25  1:22   ` Mat Martineau
2021-03-25  9:32     ` Florian Westphal
2021-03-26  0:14       ` Mat Martineau
2021-03-24 13:15 ` [RFC PATCH mptcp-next v2 6/8] mptcp: setsockopt: add SO_INCOMING_CPU Florian Westphal
2021-03-24 13:15 ` [RFC PATCH mptcp-next v2 7/8] mptcp: setsockopt: SO_DEBUG and no-op options Florian Westphal
2021-03-24 13:15 ` [RFC PATCH mptcp-next v2 8/8] mptcp: sockopt: add TCP_CONGESTION and TCP_INFO 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=2ee15b0397e7653f8d8cfd74d53398a6a5f0c19c.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=fw@strlen.de \
    --cc=mptcp@lists.01.org \
    --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