All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Geliang Tang <geliangtang@gmail.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next 1/2] mptcp: optimize out option generation
Date: Mon, 26 Jul 2021 12:06:55 +0200	[thread overview]
Message-ID: <fa45051b3d450d2ec7445b1cf1d7e20bbfcfa28a.camel@redhat.com> (raw)
In-Reply-To: <CA+WQbwsKBpXVVqDX32EDROX8kjo1efcgoPd10kDOt9hCHHNvdA@mail.gmail.com>

On Mon, 2021-07-26 at 11:21 +0800, Geliang Tang wrote:
> Hi Paolo,
> 
> Thanks for this patchset, and I have some small comments.
> 
> Paolo Abeni <pabeni@redhat.com> 于2021年7月24日周六 上午1:06写道:
> > Currently we have several protocol contraint on MPTCP option
> > generation (e.g. MPC and MPJ subopt are mutually exclusive)
> > and some additionall ones required by our implementation
> > (e.g. almost all ADD_ADDR variant are mutually exclusive with
> > everything else).
> > 
> > We can leverage the above to optimize the out option generation:
> > we check DSS/MPC/MPJ presencence in a mutually exclusive way,
> > avoiding many unneeded conditionals in the common case.
> > 
> > Additionally extend the existing constraint on ADD_ADDR opt on
> > all subvariant, so that it become fully mutually exclusive with
> > the above and we can skip another conditional statement the common
> > case.
> > 
> > This change is also need by the next patch.
> > 
> > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> > --
> > side node: we could probably optimize the conditionals in
> > mptcp_established_options()
> > ---
> >  net/mptcp/options.c  | 225 ++++++++++++++++++++++---------------------
> >  net/mptcp/pm.c       |   9 +-
> >  net/mptcp/protocol.h |   1 +
> >  3 files changed, 122 insertions(+), 113 deletions(-)
> > 
> > diff --git a/net/mptcp/options.c b/net/mptcp/options.c
> > index eafdb9408f3a..38f324667761 100644
> > --- a/net/mptcp/options.c
> > +++ b/net/mptcp/options.c
> > @@ -592,6 +592,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
> >                 dss_size = map_size;
> >                 if (skb && snd_data_fin_enable)
> >                         mptcp_write_data_fin(subflow, skb, &opts->ext_copy);
> > +               opts->suboptions = OPTION_MPTCP_DSS;
> >                 ret = true;
> >         }
> > 
> > @@ -615,6 +616,7 @@ static bool mptcp_established_options_dss(struct sock *sk, struct sk_buff *skb,
> >                 opts->ext_copy.ack64 = 0;
> >         }
> >         opts->ext_copy.use_ack = 1;
> > +       opts->suboptions = OPTION_MPTCP_DSS;
> >         WRITE_ONCE(msk->old_wspace, __mptcp_space((struct sock *)msk));
> > 
> >         /* Add kind/length/subtype/flag overhead if mapping is not populated */
> > @@ -663,9 +665,9 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff *
> 
> I think no need to modify the code in mptcp_established_options_add_addr.

Uhmmm... I just noted with need an additional change in there: avoid
clearing 'ext_copy'.

/P


  parent reply	other threads:[~2021-07-26 10:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 17:06 [PATCH mptcp-next 0/2] mptcp: minor out optimization Paolo Abeni
2021-07-23 17:06 ` [PATCH mptcp-next 1/2] mptcp: optimize out option generation Paolo Abeni
2021-07-26  3:21   ` Geliang Tang
2021-07-26  9:44     ` Paolo Abeni
2021-07-26 10:02       ` Geliang Tang
2021-07-26 10:06     ` Paolo Abeni [this message]
2021-07-23 17:06 ` [PATCH mptcp-next 2/2] mptcp: shrink mptcp_out_options struct Paolo Abeni

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=fa45051b3d450d2ec7445b1cf1d7e20bbfcfa28a.camel@redhat.com \
    --to=pabeni@redhat.com \
    --cc=geliangtang@gmail.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 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.